-
Notifications
You must be signed in to change notification settings - Fork 3
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 #99 from sprint-military-9team/feat#98-skeleton
Feat#98 skeleton컴포넌트
- Loading branch information
Showing
8 changed files
with
248 additions
and
81 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import LoadingSpinner from '@/components/shopinfoPage/LoadingSpinner'; | ||
|
||
export default function Loading() { | ||
return <LoadingSpinner />; | ||
} |
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
45 changes: 45 additions & 0 deletions
45
src/components/announcelist/SuggestCard/skeleton/CardListSkeleton.module.scss
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,45 @@ | ||
@import '@/styles/_index'; | ||
@import '@/styles/_media'; | ||
|
||
.sectionWrapper { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
gap: 3.2rem; | ||
} | ||
|
||
.title { | ||
color: $black; | ||
font-family: 'Spoqa Han Sans Neo'; | ||
font-size: 2.8rem; | ||
font-style: normal; | ||
font-weight: 700; | ||
line-height: normal; | ||
letter-spacing: 0.056rem; | ||
margin-left: 0.3rem; | ||
} | ||
|
||
.cardWrapper { | ||
display: grid; | ||
grid-template-columns: 1fr 1fr 1fr; | ||
width: 98rem; | ||
position: relative; | ||
gap: 1.4rem; | ||
} | ||
|
||
@include media(tablet) { | ||
.cardWrapper { | ||
width: 66.6rem; | ||
} | ||
} | ||
|
||
@include media(mobile) { | ||
.cardWrapper { | ||
width: 37.1rem; | ||
grid-template-columns: 1fr 1fr; | ||
} | ||
|
||
.cardWrapper>*:nth-child(n + 3) { | ||
display: none; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/components/announcelist/SuggestCard/skeleton/CardListSkeleton.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,19 @@ | ||
import Card from './CardSkeleton'; | ||
import styles from './CardListSkeleton.module.scss'; | ||
|
||
export default function CardListSkeleton({ title, length }: { title: string; length: number }) { | ||
const dataList = []; | ||
for (let i = 0; i < length; i += 1) { | ||
dataList.push(i); | ||
} | ||
return ( | ||
<section className={styles.sectionWrapper}> | ||
{title && <p className={styles.title}>{title}</p>} | ||
<div className={styles.cardWrapper}> | ||
{dataList.map((data) => ( | ||
<Card key={data} /> | ||
))} | ||
</div> | ||
</section> | ||
); | ||
} |
81 changes: 81 additions & 0 deletions
81
src/components/announcelist/SuggestCard/skeleton/CardSkeleton.module.scss
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,81 @@ | ||
@use '@/styles/color' as c; | ||
@use '@/styles/mixins' as m; | ||
@use '@/styles/media' as r; | ||
|
||
@mixin common { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
} | ||
|
||
.cardWrapper { | ||
padding: 1.6rem; | ||
width: 31.2rem; | ||
min-width: 31.2rem; | ||
height: 34.8rem; | ||
min-height: 34.8rem; | ||
gap: 2.4rem; | ||
border-radius: 1.2rem; | ||
border: 0.1rem solid c.$gray-300; | ||
background: c.$white; | ||
cursor: pointer; | ||
|
||
@include r.media('mobile') { | ||
padding: 1.2rem; | ||
width: 17.1rem; | ||
height: 26rem; | ||
min-width: 17.1rem; | ||
min-height: 26rem; | ||
gap: 1.2rem; | ||
} | ||
} | ||
|
||
.imageWrapper { | ||
position: relative; | ||
width: 100%; | ||
height: 16rem; | ||
overflow: hidden; | ||
border-radius: 1.2rem; | ||
background: c.$gray-200; | ||
|
||
@include r.media('mobile') { | ||
max-height: 9.1rem; | ||
} | ||
} | ||
|
||
.contentWrapper { | ||
width: 100%; | ||
height: 1.6rem; | ||
} | ||
|
||
.title { | ||
margin-top: 2rem; | ||
background: c.$gray-200; | ||
width: 12rem; | ||
height: 3rem; | ||
@include m.rounded-lg; | ||
} | ||
|
||
.location { | ||
margin-top: 1rem; | ||
background: c.$gray-200; | ||
width: 8rem; | ||
height: 1.6rem; | ||
@include m.rounded-lg; | ||
} | ||
|
||
.time { | ||
margin-top: 1rem; | ||
background: c.$gray-200; | ||
width: 100%; | ||
height: 1.6rem; | ||
@include m.rounded-lg; | ||
} | ||
|
||
.salary { | ||
margin-top: 1rem; | ||
background: c.$gray-200; | ||
width: 13rem; | ||
height: 3rem; | ||
@include m.rounded-lg; | ||
} |
16 changes: 16 additions & 0 deletions
16
src/components/announcelist/SuggestCard/skeleton/CardSkeleton.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,16 @@ | ||
import styles from './CardSkeleton.module.scss'; | ||
|
||
function Card() { | ||
return ( | ||
<div className={styles.cardWrapper}> | ||
<div className={styles.imageWrapper} /> | ||
<div className={styles.contentWrapper}> | ||
<div className={styles.title} /> | ||
<div className={styles.time} /> | ||
<div className={styles.location} /> | ||
<div className={styles.salary} /> | ||
</div> | ||
</div> | ||
); | ||
} | ||
export default Card; |
Oops, something went wrong.