mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-05-07 01:02:36 +00:00
chore: restructure project into yarn workspaces, remove next
This commit is contained in:
parent
49e308507e
commit
8d06327c03
266 changed files with 16466 additions and 3350 deletions
29
packages/design-system/atoms/avatar/Avatar.tsx
Normal file
29
packages/design-system/atoms/avatar/Avatar.tsx
Normal file
|
@ -0,0 +1,29 @@
|
|||
import React from 'react';
|
||||
import { Container, Image } from './Avatar.styled';
|
||||
|
||||
export type AvatarProps = {
|
||||
src?: string;
|
||||
children?: string | React.ReactNode;
|
||||
size?: number;
|
||||
hash?: string;
|
||||
deliberatelyEmpty?: boolean;
|
||||
};
|
||||
|
||||
/** Chuldren is recommended to not be larger than 2 uppercase letters. */
|
||||
export const Avatar = (props: AvatarProps) => (
|
||||
<Container size={props.size} deliberatelyEmpty={props.deliberatelyEmpty}>
|
||||
{props.src && props.hash && (
|
||||
<Image
|
||||
style={{
|
||||
backgroundImage: `url(${props.src})`,
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<div>
|
||||
{props.children || (
|
||||
/* needs specifically to prevent layout issues. */
|
||||
<> </>
|
||||
)}
|
||||
</div>
|
||||
</Container>
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue