Skip to content

Commit

Permalink
feat: member title 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
hae-on committed Aug 11, 2023
1 parent 0c0f488 commit 4165078
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 0 deletions.
54 changes: 54 additions & 0 deletions frontend/src/components/Members/MembersTitle/MembersTitle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { Button, Heading, theme } from '@fun-eat/design-system';
import { styled } from 'styled-components';

import { SvgIcon } from '@/components/Common';
import type { Member } from '@/types/member';

interface MembersTitleProps {
member: Member;
}

const MembersTitle = ({ member }: MembersTitleProps) => {
const { nickname, profileImage } = member;

return (
<MembersTitleContainer>
<MemberTitleInfoWrapper>
<MembersImage src={profileImage} width={45} height={45} alt={`${nickname}의 프로필`} />
<Heading size="xl" weight="bold">
{nickname}
</Heading>
<MemberModifyButton type="button" variant="transparent">
<SvgIcon variant="pencil" width={20} height={24} color={theme.colors.gray3} />
</MemberModifyButton>
</MemberTitleInfoWrapper>
<Button textColor="disabled" variant="transparent">
로그아웃
</Button>
</MembersTitleContainer>
);
};

export default MembersTitle;

const MembersTitleContainer = styled.div`
display: flex;
align-items: center;
justify-content: space-between;
`;

const MemberTitleInfoWrapper = styled.div`
display: flex;
align-items: center;
`;

const MemberModifyButton = styled(Button)`
margin-left: 5px;
transform: translateY(1px);
`;

const MembersImage = styled.img`
margin-right: 16px;
border-radius: 50%;
border: 2px solid ${({ theme }) => theme.colors.primary};
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { Meta, StoryObj } from '@storybook/react';

import MembersTitle from './MembersTitle';

import member from '@/mocks/data/members.json';

const meta: Meta<typeof MembersTitle> = {
title: 'Members/MembersTitle',
component: MembersTitle,
args: {
member: member,
},
};

export default meta;
type Story = StoryObj<typeof MembersTitle>;

export const Default: Story = {};
4 changes: 4 additions & 0 deletions frontend/src/mocks/data/members.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"nickname": "펀잇",
"profileImage": "https://github.com/woowacourse-teams/2023-fun-eat/assets/78616893/1f0fd418-131c-4cf8-b540-112d762b7c34"
}

0 comments on commit 4165078

Please sign in to comment.