-
Notifications
You must be signed in to change notification settings - Fork 8
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 #136 from k-impossible/feat/questions
[FE] 챕터 진행상황, 문제 조회 api 연결 작업
- Loading branch information
Showing
24 changed files
with
476 additions
and
278 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 |
---|---|---|
@@ -1,70 +1,79 @@ | ||
import { Chapter, UserChapter } from '../../interfaces/Chapter.interface'; | ||
// import { | ||
// Chapter, | ||
// UserChapter, | ||
// UserChapterListItem | ||
// } from '../../interfaces/Chapter.interface'; | ||
|
||
export const chapterData: Array<Chapter> = [ | ||
{ | ||
title: '인사 나누기', | ||
chapterId: 1, | ||
wordId: [1, 2, 3] | ||
}, | ||
{ | ||
title: '쇼핑 및 주문하기', | ||
chapterId: 2, | ||
wordId: [4, 5, 6] | ||
}, | ||
{ | ||
title: '활동에 대해 말하기', | ||
chapterId: 3, | ||
wordId: [71, 28, 66] | ||
}, | ||
{ | ||
title: '활동에 대해 말하기', | ||
chapterId: 3, | ||
wordId: [71, 28, 66] | ||
}, | ||
{ | ||
title: '활동에 대해 말하기', | ||
chapterId: 5, | ||
wordId: [71, 28, 66] | ||
}, | ||
{ | ||
title: '활동에 대해 말하기', | ||
chapterId: 3, | ||
wordId: [71, 28, 66] | ||
}, | ||
{ | ||
title: '활동에 대해 말하기', | ||
chapterId: 7, | ||
wordId: [71, 28, 66] | ||
}, | ||
{ | ||
title: '활동에 대해 말하기', | ||
chapterId: 3, | ||
wordId: [71, 28, 66] | ||
}, | ||
{ | ||
title: '활동에 대해 말하기', | ||
chapterId: 3, | ||
wordId: [71, 28, 66] | ||
} | ||
]; | ||
// export const chapterData: Array<Chapter> = [ | ||
// { | ||
// title: '인사 나누기', | ||
// chapterId: 1, | ||
// wordId: [1, 2, 3] | ||
// }, | ||
// { | ||
// title: '쇼핑 및 주문하기', | ||
// chapterId: 2, | ||
// wordId: [4, 5, 6] | ||
// }, | ||
// { | ||
// title: '활동에 대해 말하기', | ||
// chapterId: 3, | ||
// wordId: [71, 28, 66] | ||
// }, | ||
// { | ||
// title: '활동에 대해 말하기', | ||
// chapterId: 3, | ||
// wordId: [71, 28, 66] | ||
// }, | ||
// { | ||
// title: '활동에 대해 말하기', | ||
// chapterId: 5, | ||
// wordId: [71, 28, 66] | ||
// }, | ||
// { | ||
// title: '활동에 대해 말하기', | ||
// chapterId: 3, | ||
// wordId: [71, 28, 66] | ||
// }, | ||
// { | ||
// title: '활동에 대해 말하기', | ||
// chapterId: 7, | ||
// wordId: [71, 28, 66] | ||
// }, | ||
// { | ||
// title: '활동에 대해 말하기', | ||
// chapterId: 3, | ||
// wordId: [71, 28, 66] | ||
// }, | ||
// { | ||
// title: '활동에 대해 말하기', | ||
// chapterId: 3, | ||
// wordId: [71, 28, 66] | ||
// } | ||
// ]; | ||
|
||
export const userChapterAllData: UserChapter = { | ||
chapterList: [ | ||
{ | ||
chapterId: 1, | ||
chapterStatus: true, | ||
progress: [1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1] | ||
}, | ||
{ | ||
chapterId: 2, | ||
chapterStatus: false, | ||
progress: [1, 1, 1, 1, 1, 1, 2, 2, 0, 0, 0, 0] | ||
}, | ||
{ | ||
chapterId: 3, | ||
chapterStatus: false, | ||
progress: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] | ||
} | ||
], | ||
learningChapterId: 3 | ||
}; | ||
// export const userChapterAllData: UserChapter = { | ||
// chapterList: [ | ||
// { | ||
// chapterId: 1, | ||
// chapterStatus: true, | ||
// progress: [1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1] | ||
// }, | ||
// { | ||
// chapterId: 2, | ||
// chapterStatus: false, | ||
// progress: [1, 1, 1, 1, 1, 1, 2, 2, 0, 0, 0, 0] | ||
// }, | ||
// { | ||
// chapterId: 3, | ||
// chapterStatus: false, | ||
// progress: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] | ||
// } | ||
// ] | ||
// }; | ||
|
||
// export const userChapterData: UserChapterListItem = { | ||
// chapterId: 1, | ||
// chapterStatus: false, | ||
// progress: [1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] | ||
// }; |
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,32 @@ | ||
import { ChapterList, UserChapter } from '../../interfaces/Chapter.interface'; | ||
|
||
export function localStorageInit(allChapterList: ChapterList) { | ||
if (localStorageIsNull()) { | ||
const localUserChapter: UserChapter = { | ||
data: [] | ||
}; | ||
const initList = allChapterList.data.map((el, idx) => { | ||
return { | ||
chapterId: idx + 1, | ||
chapterStatus: false, | ||
progress: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] as (0 | 1 | 2)[] | ||
}; | ||
}); | ||
localUserChapter.data = initList; | ||
|
||
localStorageSet(localUserChapter); | ||
} | ||
} | ||
|
||
export function localStorageIsNull() { | ||
return localStorage.getItem('userChapter') == null; | ||
} | ||
|
||
export function localStorageGet(): UserChapter { | ||
const localUserChapter = localStorage.getItem('userChapter'); | ||
return JSON.parse(localUserChapter!); | ||
} | ||
|
||
export function localStorageSet(userChapter: UserChapter) { | ||
localStorage.setItem('userChapter', JSON.stringify(userChapter)); | ||
} |
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
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,3 @@ | ||
interface WordNavItemProps {} | ||
|
||
export default function WordNavItem() {} |
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
Oops, something went wrong.