-
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 #34 from DDD-Community/feat/analysis_v2
Feat/analysis v2
- Loading branch information
Showing
41 changed files
with
1,858 additions
and
252 deletions.
There are no files selected for viewing
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
'use client'; | ||
|
||
import AmountAnalysisWrapper from '@/_components/analysis/amount/AmountAnalysisWrapper'; | ||
|
||
const AmountAnalysis = () => { | ||
return <p>금액별</p>; | ||
return <AmountAnalysisWrapper />; | ||
}; | ||
|
||
export default AmountAnalysis; |
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,9 @@ | ||
'use client'; | ||
|
||
import PeriodicDateFilterWrapper from '@/_components/analysis/period/filter/PeriodicDateFilterWrapper'; | ||
|
||
const PeriodAnalysis = () => { | ||
return <PeriodicDateFilterWrapper />; | ||
}; | ||
|
||
export default PeriodAnalysis; |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
'use client'; | ||
|
||
import RoundsAnalysisWrapper from '@/_components/analysis/rounds/RoundsAnalysisWrapper'; | ||
|
||
const RoundsAnalysis = () => { | ||
return <p>회차별</p>; | ||
return <RoundsAnalysisWrapper />; | ||
}; | ||
|
||
export default RoundsAnalysis; |
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,56 @@ | ||
import instance from '@/_apis/core'; | ||
import { LatestNumberResponseType } from '@/_types/analysis'; | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
|
||
type RoundSelectorProps = { | ||
lastestRound: number; | ||
setIsOpenScrapBottomSheet: React.Dispatch<React.SetStateAction<boolean>>; | ||
setSelectNumbers: React.Dispatch<React.SetStateAction<LatestNumberResponseType | undefined>>; | ||
}; | ||
|
||
const RoundSelector: React.FC<RoundSelectorProps> = ({ | ||
lastestRound, | ||
setIsOpenScrapBottomSheet, | ||
setSelectNumbers, | ||
}) => { | ||
const selectOptions = Array.from({ length: lastestRound }, (_, index) => lastestRound - index); | ||
|
||
const onSelect = async (drwtNo: number) => { | ||
try { | ||
const data = await instance.get<undefined, LatestNumberResponseType>(`/api/number`, { | ||
params: { | ||
drwtNo, | ||
}, | ||
}); | ||
|
||
setSelectNumbers(data); | ||
} catch (err) { | ||
console.log('err', err); | ||
} | ||
setIsOpenScrapBottomSheet(false); | ||
}; | ||
|
||
return ( | ||
<RoundSelectorBlock> | ||
{selectOptions.map(round => ( | ||
<Item key={round} onClick={() => onSelect(round)}> | ||
{round} | ||
</Item> | ||
))} | ||
</RoundSelectorBlock> | ||
); | ||
}; | ||
|
||
const RoundSelectorBlock = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 26px; | ||
`; | ||
|
||
const Item = styled.button` | ||
text-align: center; | ||
font-size: 20px; | ||
`; | ||
|
||
export default RoundSelector; |
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,45 @@ | ||
import NavTabs from '@/_components/common/NavTabs'; | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import PrizeAmountList from './PrizeAmountList'; | ||
import { useSearchParams } from 'next/navigation'; | ||
import PrizeRankAnalysisWrapper from './PrizeRankAnalysisWrapper'; | ||
import { SortOption } from '@/_types/analysis'; | ||
|
||
type AmountAnalysisWrapperProps = {}; | ||
|
||
const AmountAnalysisWrapper: React.FC<AmountAnalysisWrapperProps> = () => { | ||
const searchParams = useSearchParams(); | ||
|
||
const tabOptions = [ | ||
{ | ||
label: '당첨금액 높은 순', | ||
queryParams: 'type', | ||
value: 'desc', | ||
}, | ||
{ | ||
label: '당첨금액 낮은 순', | ||
queryParams: 'type', | ||
value: 'asc', | ||
}, | ||
]; | ||
|
||
return ( | ||
<AmountAnalysisWrapperBlock> | ||
<NavTabs tabOptions={tabOptions} /> | ||
<PrizeAmountList /> | ||
<Line /> | ||
<PrizeRankAnalysisWrapper /> | ||
</AmountAnalysisWrapperBlock> | ||
); | ||
}; | ||
|
||
const AmountAnalysisWrapperBlock = styled.div``; | ||
|
||
const Line = styled.div` | ||
width: 100%; | ||
background-color: #eff3f8; | ||
height: 10px; | ||
`; | ||
|
||
export default AmountAnalysisWrapper; |
Oops, something went wrong.