-
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 pull request #3 from Konkuk-KUIT/dainn
AddHabit, Myprogress ํ์ด์ง
- Loading branch information
Showing
10 changed files
with
636 additions
and
13 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
//import React, { useEffect } from "react"; | ||
// import { useParams } from "react-router-dom"; | ||
import styled from 'styled-components'; | ||
import arrowImg from "@/assets/period.svg"; | ||
import characterImg from "@/assets/character.svg"; | ||
|
||
const StyledTotal = styled.div` | ||
width: 390px; | ||
height: 844px; | ||
align-items: center; | ||
background-color: #65A55B; | ||
`; | ||
|
||
const StyledInputBox = styled.div` | ||
width: 328px; | ||
height: 44px; | ||
flex-shrink: 0; | ||
background-color: #F8F7F7; | ||
border-radius: 8px; | ||
justify-content: center; | ||
margin-left: 31px | ||
`; | ||
|
||
const StyledBox = styled.div` | ||
width: 124px; | ||
height: 44px; | ||
flex-shrink: 0; | ||
margin-right: 20px; | ||
margin-left: 10px; | ||
background-color: #F8F7F7; | ||
border-radius: 8px; | ||
`; | ||
|
||
const StyledPeriod = styled.div` | ||
display: flex; | ||
justify-content: space-around; | ||
margin-left: 31px | ||
`; | ||
|
||
const StyledMemoBox = styled.div` | ||
width: 328px; | ||
height: 150px; | ||
flex-shrink: 0; | ||
background-color: #F8F7F7; | ||
border-radius: 8px; | ||
margin-left: 31px | ||
`; | ||
|
||
const AddButton = styled.div` | ||
align-content: center; | ||
width: 328px; | ||
height: 48px; | ||
border-radius: 12px; | ||
background: #D5CCEE; | ||
gap: 10px; | ||
margin-left: 31px; | ||
`; | ||
const TextContent = styled.p` | ||
text-align: center; | ||
font-size: 17px; | ||
margin-top: 11px; | ||
align-items: | ||
`; | ||
|
||
const handleClick = () => { | ||
console.log(1); | ||
}; | ||
|
||
// function setHabbitName(){ | ||
// console.log(1); | ||
|
||
// } | ||
|
||
//const [habitName, sethabitName] = useState(""); | ||
|
||
export default function addHabit() { | ||
return ( | ||
<StyledTotal> | ||
<p className="text-left text-[17px] "> | ||
์ต๊ด ์ด๋ฆ | ||
</p> | ||
<StyledInputBox><input type="text"></input></StyledInputBox> | ||
{/* <StyledInputBox type="text" placeholder="์ด๋ฆ์ ์ ๋ ฅํ์ธ์."></StyledInputBox> */} | ||
|
||
<p className="text-left text-[17px]">๊ธฐ๊ฐ</p> | ||
<StyledPeriod> | ||
<StyledBox onClick={handleClick}> | ||
<input type="date"></input> | ||
</StyledBox> | ||
<img src={arrowImg}></img> | ||
<StyledBox> | ||
<input type="date"></input> | ||
</StyledBox> | ||
</StyledPeriod> | ||
|
||
|
||
<p className="text-left text-[17px]">์คํฐ์ปค ์ ํ</p> | ||
<img src={characterImg}></img> | ||
|
||
<p className="text-left text-[17px]">๋ฐฐ๊ฒฝ์ ์ ํ</p> | ||
|
||
<p className="text-left text-[17px]">๋ฉ๋ชจ</p> | ||
<StyledMemoBox><textarea></textarea></StyledMemoBox> | ||
<AddButton onClick={handleClick}><TextContent>์ต๊ด ๋ฑ๋ก</TextContent></AddButton> | ||
</StyledTotal> | ||
|
||
) | ||
} |
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 @@ | ||
// DoughnutChart.tsx | ||
import React from 'react'; | ||
import { PieChart, Pie, Cell, Tooltip, Legend, ResponsiveContainer } from 'recharts'; | ||
|
||
interface DoughnutChartProps { | ||
data: { name: string; value: number; color: string }[]; | ||
} | ||
|
||
const DoughnutChart: React.FC<DoughnutChartProps> = ({ data }) => { | ||
return ( | ||
<ResponsiveContainer width="100%" height={300}> | ||
<PieChart> | ||
<Pie | ||
data={data} | ||
dataKey="value" | ||
nameKey="name" | ||
cx="50%" | ||
cy="50%" | ||
innerRadius={60} | ||
outerRadius={100} | ||
|
||
paddingAngle={5} | ||
label | ||
> | ||
{data.map((entry, index) => ( | ||
<Cell key={`cell-${index}`} fill={entry.color} /> | ||
))} | ||
</Pie> | ||
<Tooltip /> | ||
<Legend /> | ||
</PieChart> | ||
</ResponsiveContainer> | ||
); | ||
}; | ||
|
||
export default DoughnutChart; |
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,6 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
|
||
interface ProgressBarProps { | ||
progress: number; | ||
} |
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,72 @@ | ||
import styled from 'styled-components'; | ||
import React from 'react'; | ||
import { Chart as ChartJS, ArcElement, Tooltip, Legend } from 'chart.js'; | ||
import DoughnutChart from './DoughnutChart'; | ||
|
||
interface DoughnutChartProps { | ||
data: number[]; | ||
labels: string[]; | ||
backgroundColors: string[]; | ||
} | ||
|
||
const StyledTotal= styled.div` | ||
width: 390px; | ||
height: 844px; | ||
align-items: center; | ||
background-color: #65A55B; | ||
`; | ||
|
||
const StyledText1 = styled.div` | ||
display: flex; | ||
width: 328px; | ||
height: 30px; | ||
flex-direction: column; | ||
justify-content: center; | ||
flex-shrink: 0; | ||
`; | ||
|
||
const StyledText2 = styled.div` | ||
display: flex; | ||
width: 328px; | ||
height: 30px; | ||
flex-direction: column; | ||
justify-content: center; | ||
flex-shrink: 0; | ||
`; | ||
|
||
const StyledTprogress = styled.div` | ||
`; | ||
|
||
const Doughnut = styled.div` | ||
width: 100%; | ||
height: 300px; | ||
`; | ||
|
||
export default function myProgress() { | ||
const data = [ | ||
{ name: '๋์ ์ค', value: 10, color: '#782EBF' }, | ||
{ name: '๋์ ์ฑ๊ณต', value: 20, color: '#8E9EE9' }, | ||
{ name: '๋์ ์คํจ', value: 30, color: '#9D80E0' }, | ||
]; | ||
|
||
return ( | ||
<StyledTotal> | ||
<StyledText1>ํ์ฌ 90% ์ฑ๊ณต๋ฅ ๋ก </StyledText1> | ||
<StyledText1>์ต๊ด ํ์ฑ์ค์ด์์!</StyledText1> | ||
<StyledTprogress> | ||
<progress id="progress" value="50" max="100"></progress> | ||
</StyledTprogress> | ||
|
||
|
||
|
||
<StyledText2>์ง๊ธ๊น์ง</StyledText2> | ||
<StyledText2>11๊ฐ์ ์ต๊ด์ ํ์ฑํ์ด์!</StyledText2> | ||
|
||
<Doughnut> | ||
<DoughnutChart data={data} /> | ||
</Doughnut> | ||
|
||
</StyledTotal> | ||
); | ||
} |