diff --git a/client/src/common/components/Avatar/index.tsx b/client/src/common/components/Avatar/index.tsx new file mode 100644 index 00000000..8968a8da --- /dev/null +++ b/client/src/common/components/Avatar/index.tsx @@ -0,0 +1,38 @@ +import React from 'react'; + +export interface AvatarProps { + size: 'small' | 'medium'; + variant: 'circle' | 'rectangle'; + name: string; + url?: string; +} + +const ROUNDED = { + rectangle: 'rounded-2xl', + circle: 'rounded-full', +}; + +const WH = { + small: 'w-[57px] h-[57px]', + medium: 'w-[65px] h-[65px]', +}; + +const Avatar: React.FC = ({ name, url, size, variant }) => { + return ( +
+ {url ? ( + {`커뮤니티 + ) : ( + name.at(0) + )} +
+ ); +}; + +export default Avatar; diff --git a/client/src/common/components/CommunityAvatar/index.tsx b/client/src/common/components/CommunityAvatar/index.tsx new file mode 100644 index 00000000..bc0306f7 --- /dev/null +++ b/client/src/common/components/CommunityAvatar/index.tsx @@ -0,0 +1,13 @@ +import Avatar, { AvatarProps } from '@components/Avatar'; +import React from 'react'; + +const CommunityAvatar: React.FC = ({ + variant = 'rectangle', + size = 'medium', + name, + url, +}) => { + return ; +}; + +export default CommunityAvatar; diff --git a/client/src/common/components/UserAvatar/index.tsx b/client/src/common/components/UserAvatar/index.tsx new file mode 100644 index 00000000..2f7dbaa4 --- /dev/null +++ b/client/src/common/components/UserAvatar/index.tsx @@ -0,0 +1,13 @@ +import Avatar, { AvatarProps } from '@components/Avatar'; +import React from 'react'; + +const UserAvatar: React.FC = ({ + variant = 'circle', + size = 'small', + name, + url, +}) => { + return ; +}; + +export default UserAvatar;