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

feat : add insta-archive and item (#34) #35

Merged
merged 6 commits into from
Mar 10, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 8 additions & 0 deletions src/assets/favorite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions src/components/common-components/Chip/Chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ const baseStyles = css`
display: inline-flex;
align-items: center;
justify-content: center;
position: relative;
/* position: relative; */
box-sizing: border-box;
margin: 0;
padding: 0;
/* margin: 0;
padding: 0; */
font-weight: bold;
cursor: pointer;
transition: background-color 0.1s ease-in-out;
Expand All @@ -26,8 +26,8 @@ const sizeStyles: Record<ChipSize, ReturnType<typeof css>> = {
`,
md: css`
min-height: 23px;
width: 99px;
padding: 3px 12px;
width: 120px;
font-size: 14px;
font-weight: 500;
gap: 10px;
Expand Down
74 changes: 74 additions & 0 deletions src/components/sns/InstaArchive.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import styled from 'styled-components';
import { Card } from '../common-components/Card/Card';
import { InstaItem } from './InstaItem';

const dummy = [
{
imageUrl:
'https://kobaco2.s3.ap-northeast-2.amazonaws.com/KakaoTalk_20240309_195142929.jpg',
title: '์„ฑ์ˆ˜์—์„œ ๋ฐ์ดํŠธ~',
tags: ['์›ํ”ผ์Šค', '๋ฐ์ดํŠธ๋ฃฉ', '์˜ค๋น ๋ž‘', '์„ฑ์ˆ˜ํ•ซํ”Œ'],
like: 132,
},
{
imageUrl:
'https://kobaco2.s3.ap-northeast-2.amazonaws.com/KakaoTalk_20240309_195142929_01.jpg',
title: '์˜ค๋žœ๋งŒ์— ์นœ๊ตฌ๋“ค์ด๋ž‘ ๋†€๋Ÿฌ์™”๋‹ค',
tags: ['์—ฐ๋‚จ๋ง›์ง‘', '์›ํ”ผ์Šค', '๋ง›์ง‘ํˆฌ์–ด'],
like: 34,
},
{
imageUrl:
'https://kobaco2.s3.ap-northeast-2.amazonaws.com/KakaoTalk_20240309_195142929_02.jpg',
title: 'ํ™๋Œ€์—์„œ ๋ฐ์ดํŠธ',
tags: ['์›ํ”ผ์Šค', '๋ฐ์ดํŠธ๋ฃฉ', 'ํŒŒ๋ฌ˜', '์—ฌ์นœ๋ฃฉ'],
like: 2323,
},
];

export const InstaArchive = () => {
return (
<Card
title="์ธ์Šคํƒ€๊ทธ๋žจ ์ฝ˜ํ…์ธ  ์•„์นด์ด๋ธŒ"
subTitle="* 2022๋…„ 11์›” ์ดํ›„ ์ˆ˜์ง‘ํ•œ ์ธ์Šคํƒ€๊ทธ๋žจ ์ฝ˜ํ…์ธ  ์ค‘ ๊ฒ€์ƒ‰ ํ‚ค์›Œ๋“œ๋ฅผ ํฌํ•จํ•˜๋Š” ์ฝ˜ํ…์ธ ์ž…๋‹ˆ๋‹ค."
>
<ContentsWrapper>
<LengthTitle>์ด 123๊ฐœ์˜ ์ฝ˜ํ…์ธ </LengthTitle>
<InstaGridWrapper>
{dummy.map((item, idx) => {
return (
<InstaItem
key={idx}
title={item.title}
tags={item.tags}
like={item.like}
imageUrl={item.imageUrl}
/>
);
})}
</InstaGridWrapper>
</ContentsWrapper>
</Card>
);
};

export const ContentsWrapper = styled.div`
width: 100%;
`;

export const InstaGridWrapper = styled.div`
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 30px;
width: 100%;
`;

export const LengthTitle = styled.div`
padding-bottom: 50px;
color: ${(props) => props.theme.gray_01};
font-size: 24px;
font-style: normal;
font-weight: 700;
line-height: normal;
letter-spacing: -0.48px;
`;
88 changes: 88 additions & 0 deletions src/components/sns/InstaItem.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import styled from 'styled-components';
import heartIcon from '../../assets/favorite.svg';

export type InstaItemProps = {
imageUrl: string;
title: string;
tags: string[];
like: number;
};

export const InstaItem = (props: InstaItemProps) => {
const { imageUrl, title, tags, like } = props;

return (
<ItemWrapper>
<img className="insta-img" src={imageUrl} alt="" />
<div className="text-box">
<div className="first-line">
<div className="title">{title}</div>
<div className="heart">
<img src={heartIcon} alt="" />
{like}
</div>
</div>
<div className="tag-box">
{tags?.map((item, idx) => {
return <div key={idx}>#{item}</div>;
})}
</div>
</div>
</ItemWrapper>
);
};

export const ItemWrapper = styled.div`
display: flex;
flex-direction: column;
gap: 10px;
width: 100%;

.tag-box {
display: flex;
gap: 4px;
align-items: center;
padding-top: 10px;
}

.insta-img {
max-width: 380px;
max-height: 380px;
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 12px;
}

.text-box {
color: ${(props) => props.theme.gray_01};
font-size: 20px;
font-style: normal;
font-weight: 500;
line-height: normal;
letter-spacing: -0.4px;

.first-line {
display: flex;
justify-content: space-between;
align-items: center;

font-size: 20px;
font-style: normal;
font-weight: 500;
line-height: normal;
letter-spacing: -0.4px;

.title {
font-weight: 600;
}

.heart {
display: flex;
align-items: center;
gap: 4px;
color: ${(props) => props.theme.gray_02};
}
}
}
`;
163 changes: 163 additions & 0 deletions src/components/sns/NaverArchive.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
import styled from 'styled-components';
import { Card } from '../common-components/Card/Card';
import { NaverItem } from './NaverItem';
import { CustomButton } from '../advertisement-archive/AdvertisementList';
import { Menu, MenuItem } from '@mui/material';
import { useState } from 'react';
import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown';
import ArrowDropUpIcon from '@mui/icons-material/ArrowDropUp';

const dummyData = [
{
postType: '๋„ค์ด๋ฒ„ ๋ธ”๋กœ๊ทธ',
imageUrl:
'https://kobaco2.s3.ap-northeast-2.amazonaws.com/KakaoTalk_20240309_195142929_01.jpg',
title: '๋‹ฅ์Šค ๋ ˆ์ด๋””์Šค ์—ฌ์„ฑ 24SS ๋ด„ ํŠธ๋ Œ์น˜์ฝ”ํŠธ',
content:
'๋ด„ ์›ํ”ผ์Šค๋ถ€ํ„ฐ ์‹œ์ž‘ํ•ด ํŠธ๋ Œ์น˜์ฝ”ํŠธ ๋“ฑ ๊ทธ ์ข…๋ฅ˜๋„ ์ƒ๊ฐ๋ณด๋‹ค ๋‹ค์–‘ํ•˜๊ฒŒ ์ถœ์‹œ๊ฐ€ ๋˜์—ˆ๋”๋ผ๊ณ ์š”. ํŠนํžˆ๋‚˜ ์ฐฝ์˜์ ์ธ ๋ชจ๋˜ํ•จ์€ ๋ฌผ๋ก  ํด๋ž˜์‹ํ•œ ๋ถ„์œ„๊ธฐ๋ฅผ ๋Š๋‚„ ์ˆ˜ ์žˆ๋Š” ๋‹ฅ์Šค๋งŒ์˜ ์ปฌ๋Ÿฌ์™€ ๋ชจ๋˜ํ•œ ํŒจํ„ด ๊ฐ™์€ ๊ฒฝ์šฐ ํŠน์œ ์˜ ๊ฐ๊ฐ์ ์ธ ๋Š๋‚Œ์„ ๋ฐ›์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.',
},
{
postType: '๋„ค์ด๋ฒ„ ๋‰ด์Šค',
imageUrl:
'https://kobaco2.s3.ap-northeast-2.amazonaws.com/KakaoTalk_20240309_195142929_02.jpg',
title:
'์‚ฐ๋‹ค๋ผ๋ฐ•, ํŒŒ๋ฆฌ์—์„œ ์„ผ์Šค ๋งŒ์  ๋น„์œจ ์ฒœ์žฌ! ํ‚ค ์ปค ๋ณด์ด๋Š” ๋จธ๋ฉ”์ด๋“œ ์›ํ”ผ์Šค๋ฃฉ',
content:
'๋จธ๋ฉ”์ด๋“œ ์›ํ”ผ์Šค๋ฃฉ์œผ๋กœ ์„ผ์Šค ๋งŒ์  ๋น„์œจ ์ฒœ์žฌ ๋ชจ์Šต์„ ๋ฝ๋ƒˆ๋‹ค. ์‚ฐ๋‹ค๋ผ๋ฐ•์€ 2์ผ ์ž์‹ ์˜ ์ฑ„๋„์— โ€œPFW 2024 vetementsโ€์ด๋ผ๋Š” ๊ธ€๊ณผ ํ•จ๊ป˜ ๋ฒ ํŠธ๋ฉ 2024 F/W ํŒŒ๋ฆฌํŒจ์…˜์œ„ํฌ ๊ด€๋ จ ์‚ฌ์ง„์„ ๊ฒŒ์žฌํ–ˆ๋‹ค. ๊ณต๊ฐœํ•œ ์‚ฌ์ง„์—์„œ ์‚ฐ๋‹ค๋ผ๋ฐ•์€ ํ‚ค๊ฐ€ ์ปค ๋ณด์ด๋Š” ํ™”์ดํŠธ ๋ผ์ธ ํŠธ์œ„๋“œ์ž์ผ“์„ ์ž…๊ณ  ์žˆ๋‹ค.',
},
{
postType: '๋„ค์ด๋ฒ„ ๋ธ”๋กœ๊ทธ',
imageUrl:
'https://kobaco2.s3.ap-northeast-2.amazonaws.com/KakaoTalk_20240309_195142929_03.jpg',
title: '24FW ์„œ์šธํŒจ์…˜์œ„ํฌ, ๋””์ž์ด๋„ˆ๋ธŒ๋žœ๋“œ ์–ผํ‚จ & ๋‰ด์ง„์Šค ๋ฏผ์ง€ ์›ํ”ผ์Šค',
content:
'ํ•œ๊ตญ์„ ๋Œ€ํ‘œํ•˜๋Š” ํŒจ์…˜๋ธŒ๋žœ๋“œ ์–ผํ‚จ ํŒจ์…˜์‡ผ & ์„œ์šธํŒจ์…˜์œ„ํฌ ํ™”๋ณด ์† ๋‰ด์ง„์Šค ๋ฏผ์ง€ ์›ํ”ผ์Šค ์ •๋ณด! ์„œ์šธํŒจ์…˜์‡ผ 2024. 02. 03. ์˜คํ›„ 6์‹œ @DDP ๊บ„์•„! ์„œ์šธํŒจ์…˜์œ„ํฌ ๊ฐœ๋ง‰์ด... ํŠนํžˆ ์–ธ๋ฐธ๋Ÿฐ์Šคํ•˜๊ฒŒ',
},
{
postType: '๋„ค์ด๋ฒ„ ๋ธ”๋กœ๊ทธ',
imageUrl:
'https://kobaco2.s3.ap-northeast-2.amazonaws.com/KakaoTalk_20240309_195142929_04.jpg',
title: 'ํŠธ์œ„๋“œ์›ํ”ผ์Šค ์ถ”์ฒœ) ๋“€์—˜ ๋‚ด๋ˆ๋‚ด์‚ฐ',
content:
'์•„๋‚˜์šด์„œ์›ํ”ผ์Šค, ์‡ผํ˜ธ์ŠคํŠธ์›ํ”ผ์Šค๊ฐ€ ๊ถ๊ธˆํ•˜์…จ๋˜ ๋ถ„๋“ค์—๊ฒŒ ๋„์›€์ด ๋˜๊ธธ ๋ฐ”๋ž๋‹ˆ๋‹ค. ์•„! ๊ทธ๋ฆฌ๊ณ  ๊ทธ๋ƒฅ ์ œํ’ˆ ์‹ค์ œ ์‚ฌ์ง„์ด ๊ถ๊ธˆํ•˜์…จ๋˜ ๋ถ„๋“ค๋„ ์ฐธ๊ณ ํ•˜์…”์š”ใ…Žใ…Ž ์ €๋„ ๊ฐ€๋” ๋ธŒ๋žœ๋“œ ํ™ˆํŽ˜์ด์ง€์— ์˜ฌ๋ผ์˜จ ์‚ฌ์ง„์œผ๋กœ๋Š” ๊ฐ์ด ์˜ค์ง€ ์•Š๋”๋ผ๊ณ ์š”.',
},
{
postType: '๋„ค์ด๋ฒ„ ๋‰ด์Šค',
imageUrl:
'https://kobaco2.s3.ap-northeast-2.amazonaws.com/KakaoTalk_20240309_195142929_05.jpg',
title: "์—ฌ์„ฑ์˜๋ฅ˜ ์ฃผ์คŒ, '๋ด„ ์›ํ”ผ์Šค' ์‹ ์ƒ ์ถœ์‹œ",
content:
'์—ฌ์„ฑ์˜๋ฅ˜ ๋ธŒ๋žœ๋“œ ์ฃผ์คŒ์ด ๊ฐ์„ฑ ๋‹ด์€ ๋ด„ ์›ํ”ผ์Šค ๋“ฑ ์‹ ์ƒ ์˜๋ฅ˜ ์ปฌ๋ ‰์…˜์„ ์„ ๋ณด์˜€๋‹ค. ์•ผ์™ธ ํ™œ๋™์ด ๋Š˜์–ด๋‚˜๋Š” ๊ณ„์ ˆ์  ํŠน์„ฑ์„ ๋ฐ˜์˜ํ•œ ์ฃผ์คŒ์˜ ์ด๋ฒˆ ์‹ ์ƒํ’ˆ ์ปฌ๋ ‰์…˜์€ 30~50๋Œ€์˜ ๋‹ค์–‘ํ•œ ์—ฐ๋ น์ธต์ด ์ทจํ–ฅ ๋Œ€๋กœ ๋ฏน์Šค๋งค์น˜ ํ•  ์ˆ˜ ์žˆ๋„๋ก ๊ตฌ์„ฑ๋˜์—ˆ์œผ๋ฉฐ ๋ฒ ์ด์งํ•œ ์•„์ดํ…œ๋ถ€ํ„ฐ ๊ณ ๊ธ‰ ์•„์ดํ…œ๊นŒ์ง€ ๋‹ค์–‘ํ•˜๋‹ค',
},
{
postType: '๋„ค์ด๋ฒ„ ๋ธ”๋กœ๊ทธ',
imageUrl:
'https://kobaco2.s3.ap-northeast-2.amazonaws.com/KakaoTalk_20240309_195142929_06.jpg',
title: '๋งˆ์ฅฌ ํ”Œ๋ผ์›Œ ์›ํ”ผ์Šค ์‚ฌ์ด์ฆˆ',
content:
'์–ผ๋ฅธ ๋ด„์ด ์˜ค๊ธฐ๋ฅผ ๊ธฐ๋‹ค๋ฆฌ๋ฉฐ ๋งˆ์ฅฌ ์›ํ”ผ์Šค ํญํ’ ์‡ผํ•‘! ํŽ˜๋ฏธ๋‹Œํ•˜๋ฉด์„œ๋„ ๋Œ€๋‹ดํ•œ ๋ฃฉ๋“ค๋กœ ๋งŽ์€ ์—ฌ์„ฑ ๋ถ„๋“ค์—๊ฒŒ ์‚ฌ๋ž‘๋ฐ›๋Š” ๊ณณ์ด์ฃ . ํ˜„์žฌ ๋ฏธ๊ตญ ๊ณต์‹ํ™ˆํŽ˜์ด์ง€์—์„œ ์ตœ๋Œ€ 50% ์„ธ์ผ์— ์ถ”๊ฐ€ 20% ํ• ์ธ ์ค‘์ž…๋‹ˆ๋‹ค.',
},
{
postType: '๋„ค์ด๋ฒ„ ๋ธ”๋กœ๊ทธ',
imageUrl:
'https://kobaco2.s3.ap-northeast-2.amazonaws.com/KakaoTalk_20240309_195142929_07.jpg',
title: '์…€ํ”„ํฌํŠธ๋ ˆ์ดํŠธ ์›ํ”ผ์Šค ๊ฐ€๋””๊ฑด ์ง๊ตฌ - ์„ธํƒ€์ด์–ด ์„ธ์ผ',
content:
'์ตœ๊ทผ ๊ธ€๋กœ๋ฒŒ ์›ํ”ผ์Šค ํŒจ์…˜ ์‹œ์žฅ์—์„œ ํญ๋ฐœ์ ์ธ ์ธ๊ธฐ๋ฅผ ๋Œ๊ณ  ์žˆ๋Š” ๋ธŒ๋žœ๋“œ๊ฐ€ ์žˆ์–ด์š”. ๋ฐ”๋กœ ์˜๊ตญ ๋Ÿฐ๋˜์˜ ์ปจํ…œํผ๋Ÿฌ๋ฆฌ ๋ธŒ๋žœ๋“œ ์…€ํ”„ํฌํŠธ๋ ˆ์ดํŠธ์ž…๋‹ˆ๋‹ค. ํŽ˜๋ฏธ๋‹Œํ•˜๊ณ  ๋Ÿญ์…”๋ฆฌํ•œ ๋””์ž์ธ๊ณผ ํŒŒ์›Œ ๋ฉ”์‹œ, ๋ฆฌ๋ณธ, ํŠธ์œ„๋“œ ์†Œ์žฌ ๋“ฑ์„ ์ด์šฉํ–ˆ์Šต๋‹ˆ๋‹ค.',
},
];

export const NaverArchive = () => {
const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);

const handleClose = (selectedSort: string) => {
setSort(selectedSort);
if (selectedSort === '์ตœ์‹ ์ˆœ') {
// setSortType('RECENT');
} else {
// setSortType('RELEVANT');
}
setAnchorEl(null);
};
const [sort, setSort] = useState<string>('์ตœ์‹ ์ˆœ');

const open = Boolean(anchorEl);
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
setAnchorEl(event.currentTarget);
};

return (
<Card
title="์ธ์Šคํƒ€๊ทธ๋žจ ์ฝ˜ํ…์ธ  ์•„์นด์ด๋ธŒ"
subTitle="* 2022๋…„ 11์›” ์ดํ›„ ์ˆ˜์ง‘ํ•œ ์ธ์Šคํƒ€๊ทธ๋žจ ์ฝ˜ํ…์ธ  ์ค‘ ๊ฒ€์ƒ‰ ํ‚ค์›Œ๋“œ๋ฅผ ํฌํ•จํ•˜๋Š” ์ฝ˜ํ…์ธ ์ž…๋‹ˆ๋‹ค."
>
<SortContainer>
<div className="sort-box">
<CustomButton
id="basic-button"
aria-controls={open ? 'basic-menu' : undefined}
aria-haspopup="true"
aria-expanded={open ? 'true' : undefined}
onClick={handleClick}
>
<span>{sort}</span>
<span>{open ? <ArrowDropUpIcon /> : <ArrowDropDownIcon />}</span>
</CustomButton>
<Menu
id="basic-menu"
anchorEl={anchorEl}
open={open}
onClose={() => setAnchorEl(null)}
MenuListProps={{
'aria-labelledby': 'basic-button',
}}
sx={{ fontFamily: 'Pretendard', marginTop: '3px' }}
>
<MenuItem
sx={{ fontFamily: 'Pretendard' }}
style={{}}
onClick={() => handleClose('์ตœ์‹ ์ˆœ')}
onMouseEnter={(e) => (e.currentTarget.style.color = '#D33B4D')}
onMouseLeave={(e) => (e.currentTarget.style.color = '#424242')}
>
์ตœ์‹ ์ˆœ
</MenuItem>
<MenuItem
sx={{ fontFamily: 'Pretendard' }}
onClick={() => handleClose('๊ด€๋ จ๋„์ˆœ')}
onMouseEnter={(e) => (e.currentTarget.style.color = '#D33B4D')}
onMouseLeave={(e) => (e.currentTarget.style.color = '#424242')}
>
๊ด€๋ จ๋„์ˆœ
</MenuItem>
</Menu>
</div>
</SortContainer>
<ItemWrapper>
{dummyData.map((item, idx) => {
return (
<NaverItem
key={idx}
postType={item.postType}
title={item.title}
imageUrl={item.imageUrl}
content={item.content}
/>
);
})}
</ItemWrapper>
</Card>
);
};

export const ItemWrapper = styled.div`
display: flex;
flex-direction: column;
gap: 30px;
`;

export const SortContainer = styled.div`
display: flex;
justify-content: flex-end;
padding-bottom: 20px;
`;
Loading