-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'design/#126-adjust' into Master
- Loading branch information
Showing
25 changed files
with
398 additions
and
380 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
import { AD_LIST } from '@/constants/search'; | ||
import * as S from './styles'; | ||
|
||
const SearchAd = () => { | ||
return ( | ||
<S.SectionWrapper> | ||
<S.SectionTitle> | ||
<span className="section-title-highlight">요즘 뜨는</span> 작품 | ||
</S.SectionTitle> | ||
<AdTag>광고</AdTag> | ||
<AdWrapper> | ||
{AD_LIST.map((ad, index) => ( | ||
<AdImage key={index}> | ||
<img src={ad.imageUrl} alt="Ad image" /> | ||
</AdImage> | ||
))} | ||
</AdWrapper> | ||
</S.SectionWrapper> | ||
); | ||
}; | ||
|
||
export default SearchAd; | ||
|
||
const AdWrapper = styled.div` | ||
display: flex; | ||
gap: 12px; | ||
`; | ||
|
||
const AdTag = styled.p` | ||
background: var(--color-gray-md); | ||
border-radius: 50px; | ||
padding: 3px 7px; | ||
font-size: var(--font-size-xs); | ||
color: var(--color-white); | ||
font-weight: 500; | ||
position: absolute; | ||
top: 16px; | ||
right: 16px; | ||
`; | ||
|
||
const AdImage = styled.div` | ||
width: 100%; | ||
aspect-ratio: 1 / 1; | ||
background-color: var(--color-gray-lt); | ||
img { | ||
object-fit: cover; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
`; |
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 |
---|---|---|
@@ -1,63 +1,31 @@ | ||
import { Text } from '@chakra-ui/react'; | ||
import styled from '@emotion/styled'; | ||
|
||
import { POPULAR_SEARCH_LIST } from '@/constants/search'; | ||
import * as G from '@/styles/globalStyles'; | ||
import PopularSearchItem from '../PopularSearchItem'; | ||
import * as S from './styles'; | ||
|
||
const PopularSearch = () => { | ||
const midPoint = Math.ceil(POPULAR_SEARCH_LIST.length / 2); | ||
|
||
return ( | ||
<Wrapper> | ||
<TitleWrapper> | ||
<TitleText> | ||
<RedText>인기</RedText> 검색어 | ||
</TitleText> | ||
</TitleWrapper> | ||
<G.Grid col={2} style={{ justifyItems: 'flex-start' }}> | ||
<Column> | ||
{POPULAR_SEARCH_LIST.slice(0, midPoint).map((item, index) => ( | ||
<PopularSearchItem key={item.id} text={item.text} rank={index + 1} /> | ||
))} | ||
</Column> | ||
<Column> | ||
{POPULAR_SEARCH_LIST.slice(midPoint).map((item, index) => ( | ||
<PopularSearchItem key={item.id} text={item.text} rank={midPoint + index + 1} /> | ||
))} | ||
</Column> | ||
</G.Grid> | ||
</Wrapper> | ||
<S.SectionWrapper> | ||
<S.SectionTitle> | ||
<span className="section-title-highlight">인기</span> 검색어 | ||
</S.SectionTitle> | ||
<PopularSearchGrid> | ||
{POPULAR_SEARCH_LIST.map((item, index) => ( | ||
<PopularSearchItem key={index} name={item} rank={index + 1} /> | ||
))} | ||
</PopularSearchGrid> | ||
</S.SectionWrapper> | ||
); | ||
}; | ||
|
||
export default PopularSearch; | ||
|
||
const Wrapper = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
padding: 16px; | ||
`; | ||
|
||
const TitleWrapper = styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
`; | ||
|
||
const TitleText = styled(Text)` | ||
color: var(--color-black, #020715); | ||
font-size: var(--font-size-md); | ||
font-weight: 700; | ||
line-height: normal; | ||
`; | ||
|
||
const Column = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 5px; | ||
`; | ||
|
||
const RedText = styled.span` | ||
color: var(--color-red); | ||
const PopularSearchGrid = styled.div` | ||
display: grid; | ||
grid-auto-flow: column; // 세로 방향 배치 | ||
grid-template-rows: repeat(5, 1fr); | ||
justify-items: flex-start; | ||
gap: 8px 12px; | ||
font-size: var(--font-size-sm); | ||
`; |
Oops, something went wrong.