Skip to content

Commit

Permalink
Refactor: Banner 컴포넌트 내용 이미지로 수정
Browse files Browse the repository at this point in the history
- 텍스트를 props로 주던것을 이미지로 대체함
  • Loading branch information
juriurj committed Sep 30, 2024
1 parent c15c118 commit 9a796c4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 29 deletions.
Binary file added src/assets/imgs/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 3 additions & 16 deletions src/components/Banner/index.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,15 @@
import { H24, P16 } from '@/components/Text';
import * as S from './styles';
import { CommonResponseType } from '@/types/apis';

interface BannerProps {
bInfo: Pick<
CommonResponseType,
'mt20id' | 'prfnm' | 'poster' | 'prfplcnm' | 'pcseguidance' | 'prfpdfrom' | 'prfpdto'
>;
src: string;
width?: number;
height?: number;
}

export const Banner = ({ bInfo, width = 100, height = 30 }: BannerProps) => {
export const Banner = ({ src, width = 100, height = 30 }: BannerProps) => {
return (
<S.Banner width={width} height={height}>
<img src={bInfo.poster} alt="banner"></img>
<S.Text>
<H24>{bInfo.prfnm}</H24>
<P16>{bInfo.prfplcnm}</P16>
<P16>{bInfo.pcseguidance}</P16>
<P16>
{bInfo.prfpdfrom} - {bInfo.prfpdto}
</P16>
</S.Text>
<img src={src} alt="banner"></img>
</S.Banner>
);
};
13 changes: 0 additions & 13 deletions src/components/Banner/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export const Banner = styled.div<{ width: number; height: number }>`
padding-top: ${({ height }) => height}%;
max-width: 1280px;
margin: auto;
overflow: hidden;
& > img {
position: absolute;
Expand All @@ -21,15 +20,3 @@ export const Banner = styled.div<{ width: number; height: number }>`
padding-top: 300px;
}
`;
export const Text = styled.div`
position: absolute;
top: 10%;
left: 10%;
& > h2 {
margin-bottom: 5rem;
}
& > p {
margin-bottom: 1rem;
width: 80%;
}
`;

0 comments on commit 9a796c4

Please sign in to comment.