Skip to content

Commit d83df75

Browse files
authored
Merge pull request #50 from DevKor-github/feat/#32/home-page
ํ™ˆํŽ˜์ด์ง€ ์ง€๊ธˆ๊นŒ์ง€ ๊ตฌํ˜„ํ•œ๊ฑฐ ์ผ๋‹จ ๋จธ์ง€
2 parents ffe5135 + 6ec6896 commit d83df75

18 files changed

Lines changed: 345 additions & 71 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { Link } from 'react-router';
2+
import * as s from './style.css';
3+
4+
import RepickaTitle from '@/libs/assets/RepickaTitle';
5+
6+
const MainTopBar = () => {
7+
return (
8+
<div className={s.Wrapper}>
9+
<Link className={s.Title} to={'/'}>
10+
{/* TODO: ์‹ค์ œ ๋กœ๊ณ  ๋„ฃ๊ธฐ ! */}
11+
<div className={s.Logo} />
12+
<RepickaTitle />
13+
</Link>
14+
<div className={s.Menu}>
15+
{/* TODO: ๋งํฌ ์—ฐ๊ฒฐํ•˜๊ธฐ */}
16+
<button className="mgc_search_2_fill" />
17+
<button className="mgc_chat_3_fill" />
18+
<button className="mgc_notification_fill" />
19+
</div>
20+
</div>
21+
);
22+
};
23+
export default MainTopBar;
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { css } from '@styled-system/css';
2+
3+
export const Wrapper = css({
4+
w: 'full',
5+
display: 'flex',
6+
justifyContent: 'space-between',
7+
alignItems: 'center',
8+
padding: '0.875rem 1.25rem 0.875rem 1rem',
9+
});
10+
11+
export const Title = css({
12+
display: 'flex',
13+
alignItems: 'center',
14+
gap: '0.45rem',
15+
color: '100',
16+
});
17+
18+
export const Logo = css({
19+
width: '1.5rem',
20+
height: '1.5rem',
21+
bgColor: '100',
22+
rounded: '3.2px',
23+
});
24+
25+
export const Menu = css({
26+
display: 'flex',
27+
alignItems: 'center',
28+
justifyContent: 'flex-end',
29+
gap: '0.75rem',
30+
fontSize: '1.5rem',
31+
color: 'systemGray',
32+
'& button': {
33+
cursor: 'pointer',
34+
},
35+
});

โ€Žsrc/common/components/Navigator/index.tsxโ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Link, useLocation } from 'react-router';
22
import * as s from './style.css';
3+
import { NAVIGATOR_HEIGHT_PX } from '@/libs/constants/sizes';
34

45
const MENU_LIST = [
56
{
@@ -33,7 +34,7 @@ const Navigator = () => {
3334
const { pathname } = useLocation();
3435

3536
return (
36-
<nav className={s.Container}>
37+
<nav className={s.Container} style={{ height: `${NAVIGATOR_HEIGHT_PX}px` }}>
3738
{MENU_LIST.map(({ label, path, selectedClassName, unSelectedClassName }) => {
3839
const selected = pathname === path;
3940
return (

โ€Žsrc/common/components/Navigator/style.css.tsโ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const Menu = cva({
2727
flexShrink: 0,
2828
textAlign: 'center',
2929
fontSize: '0.875rem',
30-
lineHeight: 'normal',
30+
lineHeight: 1.2,
3131
letterSpacing: '-0.0175rem',
3232
cursor: 'pointer',
3333
'& p': {

โ€Žsrc/common/components/TestAPIButton/index.tsxโ€Ž

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

โ€Žsrc/common/components/TestAPIButton/style.css.tsโ€Ž

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import type { PropsWithChildren } from 'react';
2+
3+
import * as s from './style.css';
4+
5+
const Token = ({ children }: PropsWithChildren) => {
6+
return <span className={s.Container}>{children}</span>;
7+
};
8+
export default Token;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { css } from '@styled-system/css';
2+
3+
export const Container = css({
4+
padding: '0.1875rem 0.3125rem',
5+
borderRadius: '4px',
6+
bgColor: 'main-26',
7+
color: 'main',
8+
fontSize: '0.625rem',
9+
fontWeight: 500,
10+
letterSpacing: '-0.025rem',
11+
});
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import { PRODUCT_TYPES_MAP, type PostInterface } from '@/libs/types/post';
2+
3+
import * as s from './style.css';
4+
5+
import Token from '@/common/components/Token';
6+
7+
interface Props {
8+
data: PostInterface;
9+
}
10+
const PostCard = ({ data }: Props) => {
11+
return (
12+
<div className={s.Container}>
13+
<img className={s.Image} src={data.thumbnail} aria-hidden />
14+
<div className={s.Info}>
15+
<div className={s.Header}>
16+
<h2 className={s.Title}>{data.title}</h2>
17+
<div className={s.Price}>
18+
<div className={s.PriceItem}>
19+
<label>๋Œ€์—ฌ๋ฃŒ</label>
20+
<p>{data.price.toLocaleString()}์›</p>
21+
</div>
22+
<div className={s.PriceItem}>
23+
<label>๋ณด์ฆ๊ธˆ</label>
24+
<p>{data.price.toLocaleString()}์›</p>
25+
</div>
26+
</div>
27+
</div>
28+
<div className={s.Footer}>
29+
<div className={s.Tokens}>
30+
{data.productTypes.map((type, index) => (
31+
<Token key={`${type}-${index}`}>{PRODUCT_TYPES_MAP[type]}</Token>
32+
))}
33+
</div>
34+
<div className={s.Interactions}>
35+
<div className={s.InteractionItem}>
36+
<span className="mgc_heart_fill" />
37+
<p>{data.likeCount}</p>
38+
</div>
39+
<div className={s.InteractionItem}>
40+
<span className="mgc_chat_2_fill" />
41+
<p>{data.chatRoomCount}</p>
42+
</div>
43+
</div>
44+
</div>
45+
</div>
46+
</div>
47+
);
48+
};
49+
export default PostCard;
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
import { css } from '@styled-system/css';
2+
3+
export const Container = css({
4+
w: 'full',
5+
h: '6.25rem',
6+
display: 'flex',
7+
alignItems: 'stretch',
8+
gap: '1rem',
9+
});
10+
11+
export const Image = css({
12+
w: '6.25rem',
13+
h: '6.25rem',
14+
borderRadius: '12.5px',
15+
objectFit: 'cover',
16+
});
17+
18+
export const Info = css({
19+
flex: '1 0 0',
20+
display: 'flex',
21+
flexDir: 'column',
22+
justifyContent: 'space-between',
23+
padding: '0.25rem 0',
24+
});
25+
26+
export const Header = css({
27+
display: 'flex',
28+
flexDir: 'column',
29+
gap: '0.25rem',
30+
});
31+
32+
export const Title = css({
33+
color: '100',
34+
fontSize: '1rem',
35+
fontWeight: 500,
36+
lineHeight: 1.2,
37+
letterSpacing: '-0.04rem',
38+
});
39+
40+
export const Price = css({
41+
display: 'flex',
42+
alignItems: 'center',
43+
gap: '0.875rem',
44+
height: '1.5625rem',
45+
});
46+
47+
export const PriceItem = css({
48+
display: 'flex',
49+
alignItems: 'baseline',
50+
gap: '0.25rem',
51+
'& label': {
52+
color: '54',
53+
fontSize: '0.875rem',
54+
fontWeight: 500,
55+
lineHeight: 1.4,
56+
letterSpacing: '-0.035rem',
57+
},
58+
'& p': {
59+
color: '100',
60+
fontSize: '1rem',
61+
fontWeight: 600,
62+
lineHeight: 1.4,
63+
letterSpacing: '-0.04rem',
64+
},
65+
});
66+
67+
export const Footer = css({
68+
display: 'flex',
69+
alignItems: 'center',
70+
justifyContent: 'space-between',
71+
});
72+
73+
export const Tokens = css({
74+
display: 'flex',
75+
alignItems: 'center',
76+
gap: '0.25rem',
77+
});
78+
79+
export const Interactions = css({
80+
display: 'flex',
81+
alignItems: 'center',
82+
gap: '0.875rem',
83+
});
84+
85+
export const InteractionItem = css({
86+
display: 'flex',
87+
alignItems: 'flex-end',
88+
gap: '0.1875rem',
89+
color: '54',
90+
'& span': {
91+
fontSize: '1rem',
92+
},
93+
'& p': {
94+
fontSize: '0.75rem',
95+
fontWeight: 400,
96+
letterSpacing: '-0.03rem',
97+
lineHeight: 1.2,
98+
},
99+
});

0 commit comments

Comments
ย (0)