-
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.
Browse files
Browse the repository at this point in the history
[feat] 트렌드분석 페이지
- Loading branch information
Showing
23 changed files
with
1,406 additions
and
17 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,3 @@ | ||
{ | ||
"editor.formatOnSave": true | ||
} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import NOSSR from "@/components/common/NOSSR"; | ||
import TrendPage from "@/components/trend/TrendPage"; | ||
|
||
const Trend = async () => { | ||
return ( | ||
<NOSSR> | ||
<TrendPage /> | ||
</NOSSR> | ||
); | ||
}; | ||
|
||
export default Trend; |
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,29 @@ | ||
"use client"; | ||
|
||
import { ContainerAnimation } from "@/styles/animation"; | ||
import { motion } from "framer-motion"; | ||
import styled from "styled-components"; | ||
|
||
interface ContainerProps { | ||
children: React.ReactNode; | ||
} | ||
|
||
const Container = ({ children }: ContainerProps) => { | ||
return ( | ||
<ContainerStyle variants={ContainerAnimation}>{children}</ContainerStyle> | ||
); | ||
}; | ||
|
||
export default Container; | ||
|
||
const ContainerStyle = styled(motion.div)` | ||
display: flex; | ||
flex-direction: column; | ||
margin: 0.5rem; | ||
width: 100%; | ||
padding: 2rem; | ||
background: #212121; | ||
border-radius: 30px; | ||
color: ${({ theme }) => theme.colors.white}; | ||
`; |
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,36 @@ | ||
"use client"; | ||
|
||
import { styled } from "styled-components"; | ||
import Container from "../common/Container"; | ||
|
||
const AgeSearch = () => { | ||
return ( | ||
<StyledContainer> | ||
<TopBox> | ||
<div>연령별 검색량 TOP 3</div> | ||
<span>모든 순위 확인하기</span> | ||
</TopBox> | ||
<ChartBox></ChartBox> | ||
</StyledContainer> | ||
); | ||
}; | ||
|
||
export default AgeSearch; | ||
|
||
const StyledContainer = styled(Container)``; | ||
|
||
const TopBox = styled.div` | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
margin-bottom: 1rem; | ||
font-size: 1.2rem; | ||
font-weight: 700; | ||
span { | ||
font-size: 0.8rem; | ||
color: ${({ theme }) => theme.colors.grey2}; | ||
cursor: pointer; | ||
} | ||
`; | ||
|
||
const ChartBox = styled.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,47 @@ | ||
import { styled } from "styled-components"; | ||
import Ranking from "./Ranking"; | ||
import Container from "../common/Container"; | ||
import { brandRequtation } from "@/lib/trend/trendData"; | ||
|
||
const BrandReputationIndex = () => { | ||
return ( | ||
<Container> | ||
<BrandText>브랜드 평판 지수</BrandText> | ||
<RankingBox> | ||
{brandRequtation.map((brand) => ( | ||
<Ranking | ||
key={brand.id} | ||
title={brand.title} | ||
ranking={brand.ranking} | ||
trend={brand.trend} | ||
updown={brand.updown} | ||
/> | ||
))} | ||
</RankingBox> | ||
</Container> | ||
); | ||
}; | ||
|
||
export default BrandReputationIndex; | ||
|
||
const BrandText = styled.div` | ||
font-size: 1.2rem; | ||
font-weight: 700; | ||
margin-bottom: 2rem; | ||
`; | ||
|
||
const RankingBox = styled.div` | ||
display: flex; | ||
flex-wrap: wrap; | ||
justify-content: center; | ||
gap: 1rem; | ||
& > * { | ||
flex-basis: calc(50% - 0.5rem); // 요소의 초기 크기를 50%로 설정 | ||
margin-bottom: 1rem; // 각 요소의 아래 여백 설정 | ||
} | ||
& > *:first-child { | ||
flex-basis: 100%; // 첫 번째 요소의 크기를 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 |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import { styled } from "styled-components"; | ||
|
||
interface RankingProps { | ||
title: string; | ||
ranking?: number; | ||
trend?: number; | ||
updown?: boolean; | ||
} | ||
|
||
const Ranking = (props: RankingProps) => { | ||
const { title, ranking, trend, updown } = props; | ||
|
||
return ( | ||
<Layout> | ||
<Button ranking={ranking}>{title}</Button> | ||
{ranking ? ( | ||
<> | ||
<Rank ranking={ranking}>{ranking}위</Rank> | ||
<Trend updown={updown}> | ||
{trend}% {updown ? <span>▲</span> : <span>▼</span>} | ||
</Trend> | ||
</> | ||
) : ( | ||
<Blank>-</Blank> | ||
)} | ||
</Layout> | ||
); | ||
}; | ||
|
||
export default Ranking; | ||
|
||
const Layout = styled.div` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
flex-direction: column; | ||
gap: 0.5rem; | ||
height: 100%; | ||
width: 100%; | ||
`; | ||
|
||
const Button = styled.button<{ ranking?: number }>` | ||
background: transparent; | ||
border-radius: 100px; | ||
border: 1px solid ${({ ranking, theme }) => | ||
ranking ? theme.colors.grey3 : theme.colors.grey1}; | ||
color: ${({ ranking, theme }) => | ||
ranking ? theme.colors.grey3 : theme.colors.grey1}; | ||
padding: 0.5rem 1rem; | ||
font-size: 0.9rem; | ||
font-weight: 400; | ||
`; | ||
|
||
const Rank = styled.div<{ ranking?: number }>` | ||
font-size: 2rem; | ||
font-weight: 700; | ||
color: ${({ ranking, theme }) => | ||
ranking === 1 ? theme.colors.main : theme.colors.white}; | ||
`; | ||
|
||
const Trend = styled.div<{ updown?: boolean }>` | ||
font-size: 0.9rem; | ||
font-weight: 400; | ||
color: ${({ theme }) => theme.colors.grey1}; | ||
span { | ||
color: ${({ updown, theme }) => | ||
updown ? theme.colors.main : theme.colors.secondary}; | ||
margin-left: 0.2rem; | ||
} | ||
`; | ||
|
||
const Blank = styled.div` | ||
font-size: 0.8rem; | ||
color: ${({ theme }) => theme.colors.grey3}; | ||
font-weight: 800; | ||
margin-top: 2rem; | ||
`; |
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,33 @@ | ||
import { styled } from "styled-components"; | ||
import Image from "next/image"; | ||
|
||
interface RecentSearchContentProps { | ||
name: string; | ||
} | ||
|
||
const RecentSearchContent = ({ name }: RecentSearchContentProps) => { | ||
return ( | ||
<Box>{name} | ||
<Image | ||
src="/common/cross.svg" | ||
alt="cross" | ||
width={25} | ||
height={25} | ||
/> | ||
</Box> | ||
) | ||
}; | ||
|
||
export default RecentSearchContent; | ||
|
||
const Box = styled.div` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
gap: 0.3rem; | ||
border-radius: 100px; | ||
padding: 0.5rem 1.2rem; | ||
cursor: pointer; | ||
background: #232323; | ||
`; |
Oops, something went wrong.