-
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 #58 from Strong-Potato/41-feat-create-search-page
Feat: create search page
- Loading branch information
Showing
55 changed files
with
1,694 additions
and
38 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,10 @@ | ||
.container { | ||
width: 100%; | ||
height: 24.8rem; | ||
|
||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
|
||
background-color: #efefef; | ||
} |
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,7 @@ | ||
import styles from "./Swiper.module.scss"; | ||
|
||
function Swiper() { | ||
return <div className={styles.container}>Swiper</div>; | ||
} | ||
|
||
export default Swiper; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
@use "@/sass" as *; | ||
|
||
.container { | ||
display: flex; | ||
gap: 8px; | ||
padding: 24px 20px; | ||
border-bottom: 1px solid $neutral100; | ||
|
||
&__contentsBox { | ||
width: 100%; | ||
|
||
display: flex; | ||
flex-direction: column; | ||
gap: 4px; | ||
|
||
&__name { | ||
@include typography(button); | ||
} | ||
|
||
&__secondItems { | ||
display: flex; | ||
align-items: center; | ||
|
||
&__star { | ||
display: inline; | ||
font-size: 1.6rem; | ||
color: $etc0; | ||
} | ||
|
||
&__point { | ||
margin-left: 2px; | ||
@include typography(captionSmall); | ||
} | ||
|
||
&__visitedAt { | ||
margin-left: 9px; | ||
color: $primary300; | ||
@include typography(captionSmall); | ||
} | ||
} | ||
|
||
&__content { | ||
@include typography(bodySmall); | ||
text-overflow: ellipsis; | ||
} | ||
} | ||
} |
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,52 @@ | ||
import { Avatar } from "@chakra-ui/react"; | ||
import { GoStarFill } from "react-icons/go"; | ||
|
||
import styles from "./Review.module.scss"; | ||
|
||
import ReviewImageSlider from "./ReviewImageSlider/ReviewImageSlider"; | ||
|
||
import { ReviewPropsTypes } from "@/types/detail"; | ||
|
||
function Review({ | ||
name, | ||
isGoogle = false, | ||
point, | ||
visitedAt, | ||
content, | ||
images, | ||
}: ReviewPropsTypes) { | ||
return ( | ||
<div className={styles.container}> | ||
<div> | ||
<Avatar | ||
size="sm" | ||
name="Dan Abrahmov" | ||
src="https://bit.ly/dan-abramov" | ||
/> | ||
</div> | ||
<div className={styles.container__contentsBox}> | ||
<div className={styles.container__contentsBox__name}> | ||
<span>{name}</span> | ||
{isGoogle && <span>구글</span>} | ||
</div> | ||
<div className={styles.container__contentsBox__secondItems}> | ||
<GoStarFill | ||
className={styles.container__contentsBox__secondItems__star} | ||
/> | ||
<span className={styles.container__contentsBox__secondItems__point}> | ||
{point} | ||
</span> | ||
<span | ||
className={styles.container__contentsBox__secondItems__visitedAt} | ||
> | ||
{visitedAt} | ||
</span> | ||
</div> | ||
<div className={styles.container__contentsBox__content}>{content}</div> | ||
{images && <ReviewImageSlider images={images} />} | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default Review; |
56 changes: 56 additions & 0 deletions
56
src/components/Review/ReviewImageSlider/ReviewImageSlider.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,56 @@ | ||
.container { | ||
overflow: hidden; | ||
position: relative; | ||
|
||
&__imgWrapper { | ||
position: relative; | ||
display: flex; | ||
gap: 8px; | ||
|
||
transition: all 1s; | ||
img { | ||
width: 7.6rem; | ||
height: 7.6rem; | ||
} | ||
} | ||
|
||
&__leftBtn { | ||
position: absolute; | ||
top: 50%; | ||
left: 10px; | ||
transform: translate(-10px, -50%); | ||
|
||
width: 2.4rem; | ||
height: 2.2rem; | ||
border-radius: 1.2rem; | ||
|
||
background-color: #ffffff; | ||
z-index: 2; | ||
&__icon { | ||
position: absolute; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
} | ||
} | ||
|
||
&__rightBtn { | ||
position: absolute; | ||
top: 50%; | ||
right: 10px; | ||
transform: translate(-10px, -50%); | ||
|
||
width: 2.4rem; | ||
height: 2.4rem; | ||
border-radius: 1.2rem; | ||
|
||
background-color: #ffffff; | ||
z-index: 2; | ||
&__icon { | ||
position: absolute; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
} | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
src/components/Review/ReviewImageSlider/ReviewImageSlider.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,50 @@ | ||
import { useState } from "react"; | ||
import { AiOutlineLeft, AiOutlineRight } from "react-icons/ai"; | ||
|
||
import styles from "./ReviewImageSlider.module.scss"; | ||
|
||
import useComponentSize from "@/hooks/useComponetSize"; | ||
|
||
function ReviewImageSlider({ images }: { images: string[] }) { | ||
const [slideLocation, setSlideLocation] = useState<number>(0); | ||
const [componentRef, size] = useComponentSize(); | ||
|
||
return ( | ||
<div className={styles.container}> | ||
<div | ||
className={styles.container__leftBtn} | ||
style={{ display: slideLocation === 0 ? "none" : "block" }} | ||
onClick={() => { | ||
setSlideLocation(slideLocation + 84); | ||
}} | ||
> | ||
<AiOutlineLeft className={styles.container__leftBtn__icon} /> | ||
</div> | ||
<div | ||
className={styles.container__rightBtn} | ||
style={{ | ||
display: | ||
-slideLocation >= 84 * images.length - 1 - size.width | ||
? "none" | ||
: "block", | ||
}} | ||
onClick={() => { | ||
setSlideLocation(slideLocation - 84); | ||
}} | ||
> | ||
<AiOutlineRight className={styles.container__rightBtn__icon} /> | ||
</div> | ||
<div | ||
className={styles.container__imgWrapper} | ||
style={{ left: slideLocation + "px" }} | ||
ref={componentRef} | ||
> | ||
{images.map((data) => ( | ||
<img src={data} /> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default ReviewImageSlider; |
66 changes: 66 additions & 0 deletions
66
src/components/SearchFromHome/SearchBar/SearchBar.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,66 @@ | ||
@use "@/sass" as *; | ||
|
||
@mixin icon { | ||
position: absolute; | ||
top: calc(50% - 1.5px); | ||
|
||
width: 24px; | ||
height: 24px; | ||
|
||
font-size: 24px; | ||
|
||
transform: translateY(-50%); | ||
} | ||
|
||
.container { | ||
width: 100%; | ||
height: 4.8rem; | ||
|
||
padding: 0 20px 8px 20px; | ||
|
||
.search_container { | ||
position: relative; | ||
|
||
padding: 5px 32px 8px 32px; | ||
|
||
.bottom_line { | ||
position: absolute; | ||
bottom: 0; | ||
left: 0; | ||
|
||
width: 100%; | ||
height: 2px; | ||
|
||
background-color: $primary300; | ||
} | ||
} | ||
|
||
.searchBar { | ||
position: relative; | ||
|
||
width: 100%; | ||
height: 100%; | ||
|
||
@include typography(subTitle); | ||
|
||
&__input { | ||
width: 100%; | ||
&:focus { | ||
outline: none; | ||
} | ||
} | ||
} | ||
|
||
.return { | ||
left: 0; | ||
|
||
@include icon; | ||
} | ||
.enter { | ||
right: 0; | ||
|
||
@include icon; | ||
|
||
cursor: pointer; | ||
} | ||
} |
Oops, something went wrong.