-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from softeerbootcamp4th/feat/CLAP-139
feat(CLAP-139): 내 아반떼N 공유 페이지 구현
- Loading branch information
Showing
26 changed files
with
429 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { IMyParts } from "@watermelon-clap/core/src/types"; | ||
import { customFetch } from "@watermelon-clap/core/src/utils"; | ||
|
||
export const apiGetSharedParts = (link_key?: string): Promise<IMyParts[]> => { | ||
return customFetch( | ||
`${import.meta.env.VITE_BACK_BASE_URL}/event/parts/link/${link_key}`, | ||
).then((res) => res.json()); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
packages/service/src/components/share/CustomCard/CustomCard.css.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import { css } from "@emotion/react"; | ||
import { mobile } from "@service/common/responsive/responsive"; | ||
|
||
export const card = css` | ||
width: 700px; | ||
aspect-ratio: 16 / 9; | ||
border-radius: 20px; | ||
background-color: white; | ||
margin: 0 auto; | ||
position: relative; | ||
${mobile(css` | ||
width: 400px; | ||
`)} | ||
`; | ||
|
||
export const bgImg = css` | ||
position: absolute; | ||
width: 700px; | ||
top: 0; | ||
left: 0; | ||
z-index: 1; | ||
border-radius: 20px; | ||
height: 100%; | ||
${mobile(css` | ||
width: 400px; | ||
`)} | ||
`; | ||
|
||
export const carImg = css` | ||
width: 700px; | ||
z-index: 2; | ||
position: absolute; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
${mobile(css` | ||
width: 450px; | ||
`)} | ||
`; | ||
|
||
export const colorImg = css` | ||
width: 700px; | ||
z-index: 2; | ||
position: absolute; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
${mobile(css` | ||
width: 450px; | ||
`)} | ||
`; | ||
|
||
export const wheelImg = css` | ||
z-index: 3; | ||
position: absolute; | ||
width: 245px; | ||
bottom: 95px; | ||
left: 305px; | ||
${mobile(css` | ||
bottom: 45px; | ||
left: 170px; | ||
width: 161px; | ||
`)} | ||
`; | ||
|
||
export const spoilerImg = css` | ||
z-index: 3; | ||
position: absolute; | ||
width: 50px; | ||
top: 144px; | ||
right: 118px; | ||
${mobile(css` | ||
width: 30px; | ||
top: 78px; | ||
right: 53px; | ||
`)} | ||
`; |
26 changes: 26 additions & 0 deletions
26
packages/service/src/components/share/CustomCard/CustomCard.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import * as style from "./CustomCard.css"; | ||
|
||
export interface ICustomCardProps { | ||
bgImg?: string; | ||
spoilerImg?: string; | ||
wheelImg?: string; | ||
colorImg?: string; | ||
} | ||
|
||
export const CustomCard = ({ | ||
bgImg, | ||
spoilerImg, | ||
wheelImg, | ||
colorImg, | ||
}: ICustomCardProps) => { | ||
return ( | ||
<div css={style.card}> | ||
<img css={style.carImg} src="/images/partsCollection/defaultCar.svg" /> | ||
|
||
{bgImg && <img css={style.bgImg} src={bgImg} />} | ||
<img css={style.spoilerImg} src={spoilerImg} /> | ||
<img css={style.wheelImg} src={wheelImg} /> | ||
<img css={style.colorImg} src={colorImg} /> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { CustomCard } from "./CustomCard"; |
37 changes: 37 additions & 0 deletions
37
packages/service/src/components/share/PartsTab/PartsCard/PartsCard.css.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { css } from "@emotion/react"; | ||
import { mobile } from "@service/common/responsive/responsive"; | ||
import { theme } from "@watermelon-clap/core/src/theme"; | ||
|
||
export const container = css` | ||
${theme.flex.column} | ||
width : 20%; | ||
flex-shrink: 1; | ||
${mobile(css` | ||
width: 30%; | ||
margin: 0 4%; | ||
`)} | ||
`; | ||
|
||
export const card = css` | ||
border-radius: 20px; | ||
aspect-ratio: 1 / 1; | ||
overflow: hidden; | ||
position: relative; | ||
background-color: ${theme.color.white}; | ||
${theme.flex.center}; | ||
`; | ||
|
||
export const img = (cate: string) => css` | ||
width: 100%; | ||
width: ${cate === "REAR" && "80%"}; | ||
${cate === "DRIVE_MODE" && | ||
"height : 80%; width : 80%; border-radius : 10px; object-fit : cover"}; | ||
`; | ||
|
||
export const name = css` | ||
${theme.font.preB}; | ||
font-size: clamp(0px, calc(10px + 1vw), 24px); | ||
color: ${theme.color.white}; | ||
margin-top: 20px; | ||
`; |
20 changes: 20 additions & 0 deletions
20
packages/service/src/components/share/PartsTab/PartsCard/PartsCard.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import * as style from "./PartsCard.css"; | ||
import { IParts } from "@watermelon-clap/core/src/types"; | ||
|
||
interface IPartsCardProps { | ||
partsData: IParts; | ||
} | ||
|
||
export const PartsCard = ({ partsData }: IPartsCardProps) => { | ||
return ( | ||
<div css={style.container}> | ||
<div css={style.card}> | ||
<img | ||
src={partsData.thumbnailImgSrc} | ||
css={style.img(partsData.category)} | ||
/> | ||
</div> | ||
<span css={style.name}>{partsData.name}</span> | ||
</div> | ||
); | ||
}; |
1 change: 1 addition & 0 deletions
1
packages/service/src/components/share/PartsTab/PartsCard/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { PartsCard } from "./PartsCard"; |
54 changes: 54 additions & 0 deletions
54
packages/service/src/components/share/PartsTab/PartsWrap.css.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { css } from "@emotion/react"; | ||
import { mobile } from "@service/common/responsive/responsive"; | ||
import { theme } from "@watermelon-clap/core/src/theme"; | ||
|
||
export const container = css` | ||
${theme.flex.column} | ||
margin: 0 auto; | ||
`; | ||
export const tabWrap = css` | ||
display: flex; | ||
justify-content: space-between; | ||
margin: 0 auto; | ||
margin-top: 80px; | ||
width: 700px; | ||
${mobile(css` | ||
width: 100%; | ||
flex-wrap: wrap; | ||
justify-content: space-around; | ||
`)} | ||
`; | ||
|
||
export const tabBtn = (isSelected: boolean) => css` | ||
border: ${isSelected ? `2px solid ${theme.color.white}` : `none`}; | ||
${theme.font.preB}; | ||
font-size: 20px; | ||
border-radius: 100px; | ||
width: 130px; | ||
height: 48px; | ||
cursor: pointer; | ||
background: none; | ||
color: ${isSelected ? theme.color.white : theme.color.gray300}; | ||
outline: none; | ||
${mobile(css` | ||
margin: 10px 8%; | ||
`)} | ||
`; | ||
|
||
export const partsCardWrap = css` | ||
${theme.flex.between} | ||
gap: 80px 20px; | ||
flex-wrap: wrap; | ||
width: 90%; | ||
max-width: 1000px; | ||
margin-top: 100px; | ||
${mobile(css` | ||
justify-content: center; | ||
gap: 20px; | ||
`)} | ||
`; |
Oops, something went wrong.