Skip to content

Commit 5c90803

Browse files
committed
[FE] refactor: AddGuildButton 컴포넌트 병합 (#31)
1 parent 012d22f commit 5c90803

File tree

4 files changed

+25
-42
lines changed

4 files changed

+25
-42
lines changed

src/frontend/src/components/guild/AddGuildButton/index.tsx

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/frontend/src/components/guild/AddGuildButton/styles.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/frontend/src/components/guild/GuildList/index.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
1-
import AddGuildButton from '../AddGuildButton';
1+
import useModalStore from '@/stores/modalStore';
2+
3+
import CreateGuildModalContent from '../CreateGuildModalContent';
24

35
import * as S from './styles';
46

57
const GuildList = () => {
8+
const { openModal } = useModalStore();
9+
10+
const handleChangeModal = () => {
11+
openModal('basic', <CreateGuildModalContent />);
12+
};
13+
614
return (
715
<S.GuildList>
816
<S.DMButton>
917
<S.DiscordIcon size={32} />
1018
</S.DMButton>
1119
{/* 서버 리스트 추가 예정 */}
12-
<AddGuildButton />
20+
<S.AddGuildButton onClick={handleChangeModal}>
21+
<S.PlusIcon size={24} />
22+
</S.AddGuildButton>
1323
<S.SearchCommunityButton>
1424
<S.CompassIcon size={36} />
1525
</S.SearchCommunityButton>

src/frontend/src/components/guild/GuildList/styles.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { BiCompass } from 'react-icons/bi';
22
import { BsDiscord } from 'react-icons/bs';
3+
import { TbPlus } from 'react-icons/tb';
34
import styled from 'styled-components';
45

56
export const GuildList = styled.nav`
@@ -30,7 +31,7 @@ export const DiscordIcon = styled(BsDiscord)`
3031
color: ${({ theme }) => theme.colors.white};
3132
`;
3233

33-
export const SearchCommunityButton = styled.button`
34+
export const CircleButton = styled.button`
3435
display: flex;
3536
align-items: center;
3637
justify-content: center;
@@ -42,6 +43,17 @@ export const SearchCommunityButton = styled.button`
4243
background-color: ${({ theme }) => theme.colors.dark[600]};
4344
`;
4445

46+
export const AddGuildButton = styled(CircleButton)`
47+
/* 버튼별 역할 구별을 위해 분리 */
48+
`;
49+
export const SearchCommunityButton = styled(CircleButton)`
50+
/* 버튼별 역할 구별을 위해 분리 */
51+
`;
52+
53+
export const PlusIcon = styled(TbPlus)`
54+
color: ${({ theme }) => theme.colors.dark[400]};
55+
`;
56+
4557
export const CompassIcon = styled(BiCompass)`
4658
color: ${({ theme }) => theme.colors.dark[400]};
4759
`;

0 commit comments

Comments
 (0)