Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

기사의 제목(헤드라인)을 표시하는 부분 생성 #10

Merged
merged 19 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/components/Headline.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Box, Typography, Stack } from '@mui/material';

interface HeadlineProps {
title: string;
uploadDate: string;
viewCount: number;
source: string;
}

const Headline = ({ title, uploadDate, viewCount, source }: HeadlineProps) => {
return (
<Box>
<Typography mb={1} variant="h1">
{title}
</Typography>
<Stack alignItems="center" direction="row">
<Typography variant="h4">
{uploadDate} | 조회 {viewCount}회 | {source}
</Typography>
</Stack>
</Box>
);
};

export default Headline;
17 changes: 17 additions & 0 deletions src/components/TagChip.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Chip from '@mui/material/Chip';

import color from '@/constants/color';

const TagChip = ({ label }: { label: string }) => {
return (
<Chip
color="primary"
label={label}
sx={{
background: `linear-gradient(${color.gradient_blue_dark}, ${color.gradient_blue_light})`
}}
/>
);
};

export default TagChip;
2 changes: 2 additions & 0 deletions src/constants/color.ts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저도 색상 하나를 추가했어서 아마 이 파일에서 충돌이 일어날텐데, 풀 받아서 잘 해결해주세용!!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오키오키!!

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ const color = {
blue: '#4187FF',
gray_light: '#F8F8F8',
gray_dark: '#3E3E3E',
gradient_blue_dark: '#1D71F1', // 진한 파란색
gradient_blue_light: '#1AC6FB', // 밝은 파란색
};

export default color;
Loading