Skip to content

Commit

Permalink
Feat: Panel 컴포넌트에서 버튼 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
juriurj committed Oct 2, 2024
1 parent 47e9c62 commit d5d7555
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 30 deletions.
18 changes: 3 additions & 15 deletions src/components/Panel/index.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,18 @@
import { ReactNode } from 'react';
import * as S from './styles';
import { H32 } from '@/components/Text';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faChevronRight } from '@fortawesome/free-solid-svg-icons';

interface PanelProps {
children: ReactNode;
title: string;
btnText?: string | null;
width?: string;
}

export const Panel = ({ children, title, btnText = null, width = '600px' }: PanelProps) => {
export const Panel = ({ children, title, width = '100%' }: PanelProps) => {
return (
<S.Panel width={width}>
<S.Title>
<H32>{title}</H32>
</S.Title>
<H32>{title}</H32>
{children}
{btnText ? (
<S.Button>
<span>{btnText} </span>
<FontAwesomeIcon icon={faChevronRight} />
</S.Button>
) : (
<></>
)}
</S.Panel>
);
};
18 changes: 3 additions & 15 deletions src/components/Panel/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,9 @@ import { styled } from 'styled-components';

export const Panel = styled.div<{ width: string }>`
width: ${({ width }) => width};
`;

export const Title = styled.div`
margin: 3rem 0;
text-align: center;
`;
export const Button = styled.button`
display: block;
margin: 3rem auto;
padding: 0.5rem 1rem;
border: 1px solid ${({ theme }) => theme.colors.gray};
border-radius: 1rem;
background-color: ${({ theme }) => theme.colors.white};
& > span {
margin-right: 1rem;
& > h2 {
margin: 3rem 0;
text-align: center;
}
`;

0 comments on commit d5d7555

Please sign in to comment.