-
Notifications
You must be signed in to change notification settings - Fork 0
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 #76 from delicious-algorithme/dev
fix: 가게 상세페이지 레이아웃 수정
- Loading branch information
Showing
20 changed files
with
1,030 additions
and
548 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
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,34 @@ | ||
import styled from 'styled-components'; | ||
import { White, Orange } from '../../../color'; | ||
import { ReactComponent as Path } from '../../../assets/Icon/detail/Path.svg'; | ||
|
||
const LocationButton = ({ pathClickHandler }) => { | ||
return ( | ||
<StyledButton onClick={pathClickHandler}> | ||
<Path /> | ||
길찾기 | ||
</StyledButton> | ||
); | ||
}; | ||
|
||
export default LocationButton; | ||
|
||
const StyledButton = styled.button` | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
color: ${Orange}; | ||
gap: 5px; | ||
width: 100px; | ||
height: 35px; | ||
font-size: 16px; | ||
font-weight: 600; | ||
border-radius: 10px; | ||
border: 1px solid ${Orange}; | ||
background-color: ${White}; | ||
& > svg { | ||
width: 17px; | ||
} | ||
cursor: pointer; | ||
`; |
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,51 @@ | ||
import styled from 'styled-components'; | ||
import { DarkGreen, Orange } from '../../../color'; | ||
|
||
const Keyword = ({ keyword, type }) => { | ||
if (!keyword) { | ||
return <p>로딩 중...</p>; | ||
} | ||
const keywordItem = keyword.split(', '); | ||
|
||
return ( | ||
<KeywordBox> | ||
{keywordItem.map((item) => { | ||
return ( | ||
<KeywordTag type={type} key={type}> | ||
<p>#{item}</p> | ||
</KeywordTag> | ||
); | ||
})} | ||
</KeywordBox> | ||
); | ||
}; | ||
|
||
export default Keyword; | ||
|
||
const KeywordBox = styled.div` | ||
width: 100%; | ||
display: flex; | ||
gap: 10px; | ||
flex-direction: row; | ||
align-items: center; | ||
`; | ||
|
||
const KeywordTag = styled.div` | ||
width: fit-content; | ||
padding: 10px; | ||
height: 40px; | ||
display: flex; | ||
border-radius: 50px; | ||
align-items: center; | ||
justify-content: center; | ||
font-weight: 700; | ||
font-size: 15px; | ||
border: 1px solid ${(props) => (props.type === 'positive' ? `${Orange}` : `${DarkGreen}`)}; | ||
color: ${(props) => (props.type === 'positive' ? `${Orange}` : `${DarkGreen}`)}; | ||
@media screen and (max-width: 768px) { | ||
font-size: 13px; | ||
padding: 5px; | ||
} | ||
`; |
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,57 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import { DarkGrey, Orange, White } from '../../color'; | ||
|
||
const DetailBox = ({ label, content, type }) => { | ||
return ( | ||
<DetailBoxContainer type={type}> | ||
<Label> | ||
<span>{label}</span> | ||
</Label> | ||
{type !== 'time' && type !== 'address' && <p>{content}</p>} | ||
{type === 'address' && <button>{content}</button>} | ||
{type === 'time' && ( | ||
<Time>{Array.isArray(content) && content.map((item, idx) => <p key={idx}>{item}</p>)}</Time> | ||
)} | ||
</DetailBoxContainer> | ||
); | ||
}; | ||
|
||
export default DetailBox; | ||
|
||
const DetailBoxContainer = styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
gap: 20px; | ||
font-size: 15px; | ||
& > svg { | ||
width: 16px; | ||
height: 16px; | ||
color: ${DarkGrey}; | ||
} | ||
& > button { | ||
background-color: ${White}; | ||
font-size: 16px; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
&:hover { | ||
cursor: pointer; | ||
} | ||
color: ${(props) => (props.type === 'address' ? `${Orange}` : `${DarkGrey}`)}; | ||
} | ||
`; | ||
|
||
const Time = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 10px; | ||
`; | ||
|
||
const Label = styled.div` | ||
width: 70px; | ||
font-size: 16px; | ||
font-weight: 600; | ||
`; |
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 { DarkGrey, Orange } from '../../color'; | ||
import styled from 'styled-components'; | ||
|
||
const PieChart = ({ positiveRatio, neutralRatio, negativeRatio }) => { | ||
const total = positiveRatio + neutralRatio + negativeRatio; | ||
|
||
const positive = (positiveRatio / total) * 100; | ||
const neutral = (neutralRatio / total) * 100; | ||
const negative = (negativeRatio / total) * 100; | ||
|
||
const piechart = [neutral, neutral + negative, 100]; | ||
return ( | ||
<PieChartBox> | ||
<PieChartStyle piechart={piechart} /> | ||
<p> | ||
긍정 {positive.toFixed(1)}% | 중립 {neutral.toFixed(1)}% | 부정 {negative.toFixed(1)}% | ||
</p> | ||
<Legend> | ||
<LegendItem color={Orange}> | ||
<span /> | ||
긍정 | ||
</LegendItem> | ||
<LegendItem color="#fff1e1"> | ||
<span /> | ||
중립 | ||
</LegendItem> | ||
<LegendItem color="#ff9a62"> | ||
<span /> | ||
부정 | ||
</LegendItem> | ||
</Legend> | ||
</PieChartBox> | ||
); | ||
}; | ||
|
||
export default PieChart; | ||
|
||
const PieChartBox = styled.div` | ||
border-radius: 20px; | ||
display: flex; | ||
flex-direction: column; | ||
padding: 20px; | ||
gap: 20px; | ||
& > p { | ||
font-size: 14px; | ||
color: ${DarkGrey}; | ||
font-weight: 600; | ||
} | ||
border-radius: 20px; | ||
`; | ||
|
||
const Legend = styled.div` | ||
display: flex; | ||
gap: 20px; | ||
`; | ||
|
||
const LegendItem = styled.div` | ||
display: flex; | ||
align-items: center; | ||
gap: 8px; | ||
font-size: 13px; | ||
font-weight: 500; | ||
color: ${DarkGrey}; | ||
& > span { | ||
width: 15px; | ||
height: 15px; | ||
border-radius: 50%; | ||
background-color: ${(props) => props.color}; | ||
} | ||
`; | ||
|
||
const PieChartStyle = styled.div` | ||
display: inline-block; | ||
position: relative; | ||
width: 120px; | ||
height: 120px; | ||
background: ${(props) => `conic-gradient( | ||
#fff1e1 0% ${props.piechart[0]}%, | ||
#ff9a62 ${props.piechart[0]}% ${props.piechart[0] + props.piechart[1]}%, | ||
${Orange} ${props.piechart[0] + props.piechart[1]}% 100% | ||
)`}; | ||
border-radius: 50%; | ||
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); | ||
`; |
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,68 @@ | ||
import { useState } from 'react'; | ||
import styled from 'styled-components'; | ||
import { Orange, White, LightGrey, DarkGrey, Grey } from '../../color'; | ||
|
||
const PopOver = ({ text, label }) => { | ||
const [isHovered, setIsHovered] = useState(); | ||
|
||
return ( | ||
<PopOverContainer onMouseEnter={() => setIsHovered(true)} onMouseLeave={() => setIsHovered(false)}> | ||
<Button> ? </Button> | ||
{isHovered && ( | ||
<PopoverText> | ||
<Label>{label}</Label> | ||
<p>{text}</p> | ||
</PopoverText> | ||
)} | ||
</PopOverContainer> | ||
); | ||
}; | ||
|
||
export default PopOver; | ||
|
||
const PopOverContainer = styled.div` | ||
display: flex; | ||
align-items: center; | ||
position: relative; | ||
`; | ||
|
||
const Label = styled.label` | ||
font-weight: bold; | ||
color: ${DarkGrey}; | ||
`; | ||
|
||
const Button = styled.button` | ||
width: 15px; | ||
height: 15px; | ||
border-radius: 100px; | ||
display: flex; | ||
background: ${White}; | ||
text-align: center; | ||
align-items: center; | ||
justify-content: center; | ||
border: 1px solid ${Orange}; | ||
color: ${Orange}; | ||
font-size: 10px; | ||
font-weight: 600; | ||
`; | ||
|
||
const PopoverText = styled.div` | ||
width: fit-content; | ||
min-width: 400px; | ||
position: absolute; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
gap: 10px; | ||
background-color: ${LightGrey}; | ||
z-index: 10; | ||
padding: 30px; | ||
margin: 50px; | ||
height: 70px; | ||
box-shadow: 2px 2px 2px 2px ${Grey}; | ||
border-radius: 20px; | ||
border: 1px solid ${Grey}; | ||
font-size: 14px; | ||
`; |
Oops, something went wrong.