Skip to content

Commit 4bdc839

Browse files
authored
Merge branch 'dev' into feat/#82/login-page
2 parents 3d651dd + 388ab00 commit 4bdc839

75 files changed

Lines changed: 1386 additions & 492 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

โ€Žeslint.config.jsโ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export default tseslint.config(
2020
react,
2121
'react-hooks': reactHooks,
2222
'react-refresh': reactRefresh,
23+
'@tanstack/query': tanstackPlugin,
2324
prettier,
2425
},
2526
rules: {

โ€Žpackage.jsonโ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"react": "^19.1.0",
2222
"react-dom": "^19.1.0",
2323
"react-router": "^7.6.3",
24-
"swiper": "^11.2.10"
24+
"swiper": "^11.2.10",
25+
"zustand": "^5.0.6"
2526
},
2627
"devDependencies": {
2728
"@eslint/js": "^9.25.0",
-1.84 KB
Loading

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,22 @@ export const Button = cva({
66
gap: '0.625rem',
77
flexShrink: '0',
88
justifyContent: 'center',
9+
alignItems: 'center',
910
padding: '0.625rem',
1011
borderRadius: '0.375rem',
11-
width: '100%',
12+
// width: '100%',
1213
height: '3.125rem',
1314
fontFamily: 'Pretendard',
1415
fontSize: '1.25rem',
1516
fontStyle: 'normal',
1617
fontWeight: '500',
1718
lineHeight: 'normal',
1819
letterSpacing: '-0.05rem',
20+
transition: 'background 0.3s ease-in-out',
21+
cursor: 'pointer',
1922
},
2023
variants: {
24+
// TODO: ์–ธ์ œ ์“ฐ์ด๋Š” ๊ฑด์ง€ ์ด๋ฆ„ ๋ฐ”๊พธ๊ธฐ
2125
color: {
2226
main: {
2327
backgroundColor: 'main',
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import type { ItemInfoInterface } from '@/features/detail/types';
2+
import Token from '@/common/components/Token';
3+
import { TAG_TYPES_MAP, type TagType } from '@/libs/types/item';
4+
5+
interface Props {
6+
itemInfo: ItemInfoInterface;
7+
}
8+
const ItemTokenList = ({ itemInfo }: Props) => {
9+
const tags: TagType[] = [
10+
...itemInfo.transactionTypes,
11+
...itemInfo.productTypes,
12+
itemInfo.color,
13+
...itemInfo.tradeMethods,
14+
itemInfo.quality,
15+
itemInfo.size,
16+
];
17+
18+
return (
19+
<>
20+
{tags.map(type => (
21+
<Token key={type}>{TAG_TYPES_MAP[type]}</Token>
22+
))}
23+
</>
24+
);
25+
};
26+
export default ItemTokenList;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import VerifyIcon from '@/libs/assets/VerifyIcon';
2+
3+
import * as s from './style.css';
4+
5+
// TODO: ๋””์ž์ธ ์—…๋ฐ์ดํŠธ ... ์ง€๊ธˆ ์ธ์ฆ๋œ ์œ ์ €๊ฐ€ ์—†์–ด์„œ ํ™•์ธ์ด ๋ถˆ๊ฐ€๋Šฅ ใ…‹ใ…‹
6+
const SchoolVerifiedTag = () => {
7+
return (
8+
<span className={s.Container}>
9+
<p>ํ•™๊ต์ธ์ฆ</p>
10+
<VerifyIcon />
11+
</span>
12+
);
13+
};
14+
export default SchoolVerifiedTag;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { css } from '@styled-system/css';
2+
3+
export const Container = css({
4+
padding: '0.1rem 0.275rem',
5+
fontSize: '0.625rem',
6+
fontWeight: 400,
7+
lineHeight: 1.4,
8+
letterSpacing: '-0.025rem',
9+
color: 'main',
10+
display: 'flex',
11+
alignItems: 'center',
12+
gap: '0.22rem',
13+
borderRadius: '0.25rem',
14+
backgroundColor: 'main-26',
15+
'& > p': {
16+
color: '100',
17+
},
18+
});

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { css } from '@styled-system/css';
22

33
export const Container = css({
4+
width: 'fit-content',
45
padding: '0.1875rem 0.3125rem',
56
borderRadius: '4px',
67
bgColor: 'main-26',
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* ๊ฒŒ์‹œ๊ธ€ ์ž‘์„ฑ ์‹œ๊ฐ„ ํ‘œ์‹œ ํ•จ์ˆ˜
3+
* Date ๊ฐ์ฒด๋ฅผ ๋ฐ›์•„ ์•Œ์ž˜๋”ฑํ•˜๊ฒŒ ํ•œ๊ธ€์„ ๋ฑ‰์–ด์คŒ
4+
*/
5+
export const getKoreanRelativeTime = (a: Date) => {
6+
const milliSeconds = new Date().getTime() - a.getTime();
7+
const seconds = milliSeconds / 1000;
8+
const minutes = seconds / 60;
9+
const hours = minutes / 60;
10+
const days = hours / 24;
11+
const weeks = days / 7;
12+
const months = days / 30;
13+
const years = days / 365;
14+
15+
if (seconds < 60) return `๋ฐฉ๊ธˆ ์ „`;
16+
if (minutes < 60) return `${Math.floor(minutes)}๋ถ„ ์ „`;
17+
if (hours < 24) return `${Math.floor(hours)}์‹œ๊ฐ„ ์ „`;
18+
if (days < 7) return `${Math.floor(days)}์ผ ์ „`;
19+
if (weeks < 5) return `${Math.floor(weeks)}์ฃผ ์ „`;
20+
if (months < 12) return `${Math.floor(months)}๊ฐœ์›” ์ „`;
21+
return `${Math.floor(years)}๋…„ ์ „`;
22+
};

โ€Žsrc/common/utils/toKST.tsโ€Ž

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* UTC Date๋ฅผ KST Date๋กœ ๋ณ€ํ™˜
3+
*/
4+
export const toKST = (date: Date) => {
5+
// KST : UTC + 9
6+
return new Date(date.getTime() + 9 * 60 * 60 * 1000);
7+
};

0 commit comments

Comments
ย (0)