Skip to content

Commit

Permalink
Merge branch '(#95)chore/editCss' of https://github.com/ITisYourLife-…
Browse files Browse the repository at this point in the history
  • Loading branch information
gilyeon00 committed May 30, 2023
2 parents 615db60 + b3e0a7c commit d7995dd
Show file tree
Hide file tree
Showing 33 changed files with 308 additions and 979 deletions.
Binary file removed public/assets/images/msg-img.png
Binary file not shown.
Binary file removed public/assets/images/slider-level.png
Binary file not shown.
Binary file removed public/assets/images/slider-mission.png
Binary file not shown.
Binary file removed public/assets/images/slider-mission1.png
Binary file not shown.
Binary file removed public/assets/images/slider-money.png
Binary file not shown.
Binary file removed public/assets/images/slider-money1.png
Binary file not shown.
Binary file removed public/assets/images/slider-time.png
Binary file not shown.
31 changes: 14 additions & 17 deletions src/components/MissionBanner/MissionBanner.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ import axios from 'axios';

const DebitBanner = ({setKidUserId, setKidUserName}) => {

const userId = sessionStorage.getItem("userId");
const parent = sessionStorage.getItem("isParent");
const userId = 1;
const [childData, setChildData] = useState([]);
const [kidOptions, setKidOptions] = useState([{ value: '아이 선택하기', label: '아이 선택하기' }]);
const [kidBalance, setKidBalance] = useState([0]);
const [nowKidBalance, setNowKidBalance] = useState(kidBalance[0])
const [kidOptions, setKidOptions] = useState([]);

const kidoptions = [
{ value: '정길연 아이', label: '정길연 아이' },
{ value: '정훈이 아이', label: '정훈이 아이' }
]

useEffect(() => {
const getChildAxios = async () => {
Expand All @@ -29,10 +31,6 @@ const DebitBanner = ({setKidUserId, setKidUserName}) => {
value: child.userId,
label: child.name+" 아이"
}))
const updateBalance = filterData.map(child => (
child.balance
))
setKidBalance(updateBalance)

setKidOptions(updateKidOptions)
// console.log(updateKidOptions)
Expand All @@ -51,7 +49,7 @@ const DebitBanner = ({setKidUserId, setKidUserName}) => {
</div>
<div className='kidBalance'>
<div>아이 현재 잔액:</div>
<div>{nowKidBalance}</div>
<div>찌글이</div>
</div>
<div className='kidSelect'>
<Select
Expand All @@ -69,16 +67,15 @@ const DebitBanner = ({setKidUserId, setKidUserName}) => {
theme={(theme) => ({
...theme,
colors: {
...theme.colors,
primary25: '#E5FAFC',
primary: '#F4C4D2',
...theme.colors,
primary25: '#E5FAFC',
primary: '#F4C4D2',
},
})}
onChange={(e) => {
})}
onChange={(e) => {
setKidUserId(e.value)
setKidUserName(e.label)
setNowKidBalance(kidBalance[kidOptions.indexOf(e)])
}}
}}
/>
</div>
</div>
Expand Down
84 changes: 37 additions & 47 deletions src/components/MissionHistory/MissionHistory.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function publishedDate(publishDateValue) {

const MissionHistory = ({kidUserId, kidUserName}) => {

console.log(kidUserId)
const kidId = 2

const [info, setInfo] = useState([]);
const [currPage, setCurrPage] = useState(1);
Expand Down Expand Up @@ -73,7 +73,7 @@ const MissionHistory = ({kidUserId, kidUserName}) => {
useEffect(() => {
const missionHistoryAxios = () => {
axios
.get(`http://localhost:8080/api/v1/missions/${kidUserId}`)
.get(`http://localhost:8080/api/v1/missions/${kidId}`)
.then((response) => {
if (response.data.businessCode === 'M002') {
// console.log(response.data)
Expand All @@ -85,7 +85,7 @@ const MissionHistory = ({kidUserId, kidUserName}) => {
})
}
missionHistoryAxios()
}, [kidUserId])
}, [kidId])

const getCurrData = () => {
const sidx = (currPage -1) * page;
Expand All @@ -110,54 +110,44 @@ const MissionHistory = ({kidUserId, kidUserName}) => {
);
}



if(kidUserId !== null) {

return (
<div className='mhistoryBox'>
<div className='minnerBox'>
<div className='mhistoryTable'>
<div className='mcol fst'>맵 번호</div>
<div className='mcol'>미션 번호</div>
<div className='tle'>미션 제목</div>
<div className='mcol lst'>수행 일시</div>
</div>
{getCurrData().map((item) => (
<div className={`itmbox ${item.status === 1 ? 'correctbg' : 'wrongbg'}`} key={item.userMissionId}>
<div className='mhistoryRow' key={item.userMissionId}>
<div className='mcol fst'>{item.solvedMission.mapNum}</div>
<div className='mcol'>{item.solvedMission.missionNum}</div>
<div className='tle'>{item.solvedMission.title}</div>
<div className='mcol lst'>{publishedDate(item.createAt)}</div>
</div>
</div>
))}
return (
<div className='mhistoryBox'>
<div className='minnerBox'>
<div className='mhistoryTable'>
<div className='mcol fst'>맵 번호</div>
<div className='mcol'>미션 번호</div>
<div className='tle'>미션 제목</div>
<div className='mcol lst'>수행 일시</div>
</div>
<div className='paginations'>
<div
onClick={() => handlePage(currPage-1)}
className={firstPage ? 'disabled' : 'abled'}
>
<div>&lt;</div>
<div>이전</div>
</div>
<div
onClick={() => handlePage(currPage+1)}
className={lastPage ? 'disabled' : 'abled'}
>
<div>&gt;</div>
<div>다음</div>
{getCurrData().map((item) => (
<div className={`itmbox ${item.status === 1 ? 'correctbg' : 'wrongbg'}`} key={item.userMissionId}>
<div className='mhistoryRow' key={item.userMissionId}>
<div className='mcol fst'>{item.solvedMission.mapNum}</div>
<div className='mcol'>{item.solvedMission.missionNum}</div>
<div className='tle'>{item.solvedMission.title}</div>
<div className='mcol lst'>{publishedDate(item.createAt)}</div>
</div>
</div>
))}
</div>
<div className='paginations'>
<div
onClick={() => handlePage(currPage-1)}
className={firstPage ? 'disabled' : 'abled'}
>
<div>&lt;</div>
<div>이전</div>
</div>
<div
onClick={() => handlePage(currPage+1)}
className={lastPage ? 'disabled' : 'abled'}
>
<div>&gt;</div>
<div>다음</div>
</div>
</div>
);
}
else {
return (
<div className='mhistoryBox'></div>
)
}
</div>
);
};

export default MissionHistory;
Loading

0 comments on commit d7995dd

Please sign in to comment.