diff --git a/.gitignore b/.gitignore index 4787398..6f7a9d7 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,4 @@ web-build/ node_modules/ # macOS .DS_Store -./src/test/coverage \ No newline at end of file +./src/test/coverage/lcov-report/ \ No newline at end of file diff --git a/.vs/LEARNIHON/FileContentIndex/0f878c47-903d-4fad-b719-610adbc68dca.vsidx b/.vs/LEARNIHON/FileContentIndex/0f878c47-903d-4fad-b719-610adbc68dca.vsidx deleted file mode 100644 index 66fa459..0000000 Binary files a/.vs/LEARNIHON/FileContentIndex/0f878c47-903d-4fad-b719-610adbc68dca.vsidx and /dev/null differ diff --git a/.vs/LEARNIHON/FileContentIndex/8ec4f1ae-5fb5-494b-973a-01c56c64abba.vsidx b/.vs/LEARNIHON/FileContentIndex/8ec4f1ae-5fb5-494b-973a-01c56c64abba.vsidx new file mode 100644 index 0000000..d762387 Binary files /dev/null and b/.vs/LEARNIHON/FileContentIndex/8ec4f1ae-5fb5-494b-973a-01c56c64abba.vsidx differ diff --git a/.vs/LEARNIHON/FileContentIndex/e889bf7f-6743-4551-89dd-36f44feef046.vsidx b/.vs/LEARNIHON/FileContentIndex/e889bf7f-6743-4551-89dd-36f44feef046.vsidx deleted file mode 100644 index 0349556..0000000 Binary files a/.vs/LEARNIHON/FileContentIndex/e889bf7f-6743-4551-89dd-36f44feef046.vsidx and /dev/null differ diff --git a/.vs/LEARNIHON/v17/.wsuo b/.vs/LEARNIHON/v17/.wsuo index efb93ff..4052777 100644 Binary files a/.vs/LEARNIHON/v17/.wsuo and b/.vs/LEARNIHON/v17/.wsuo differ diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite index 60fbdb5..f495137 100644 Binary files a/.vs/slnx.sqlite and b/.vs/slnx.sqlite differ diff --git a/src/components/DetailExamples.tsx b/src/components/DetailExamples.tsx index c430e97..78a477f 100644 --- a/src/components/DetailExamples.tsx +++ b/src/components/DetailExamples.tsx @@ -3,11 +3,11 @@ import { FlatList, StyleSheet, Text, useColorScheme, View } from 'react-native'; -interface detailExamplesProps { +interface DetailExamplesProps { data: { japanese: string, english: string }[] } -const DetailExamples = (props: detailExamplesProps) => { +const DetailExamples = (props: DetailExamplesProps) => { const detailExamplesStyle = useColorScheme() == 'light' ? detailExamplesStyle_light : detailExamplesStyle_dark; diff --git a/src/components/DetailRadical.tsx b/src/components/DetailRadical.tsx index 73de649..ecf1aba 100644 --- a/src/components/DetailRadical.tsx +++ b/src/components/DetailRadical.tsx @@ -5,12 +5,12 @@ import { learnihonColors } from '../assets/colors'; -interface detailRadicalProps { +interface DetailRadicalProps { character: string, icon: string } -const DetailRadical = (props: detailRadicalProps) => { +const DetailRadical = (props: DetailRadicalProps) => { const detailRadicalStyle = useColorScheme() == 'light' ? detailRadicalStyle_light : detailRadicalStyle_dark; return ( diff --git a/src/components/GradeChip.tsx b/src/components/GradeChip.tsx index b2583b7..76893d9 100644 --- a/src/components/GradeChip.tsx +++ b/src/components/GradeChip.tsx @@ -3,12 +3,12 @@ import { StyleSheet, Text, TouchableOpacity } from 'react-native'; import { Check } from "react-native-feather"; import { learnihonColors } from '../assets/colors'; -interface gradeChipProps { +interface GradeChipProps { grade: number; onSelect: (item: string, isSelected: boolean) => void; } -const GradeChip = (props: gradeChipProps) => { +const GradeChip = (props: GradeChipProps) => { const [chipStyle, setChipStyle] = useState(style); diff --git a/src/components/GradeChipList.tsx b/src/components/GradeChipList.tsx index efc7ffa..3335732 100644 --- a/src/components/GradeChipList.tsx +++ b/src/components/GradeChipList.tsx @@ -2,11 +2,11 @@ import React from "react"; import { FlatList, StyleSheet, View } from "react-native"; import GradeChip from './GradeChip'; -interface kanjiListSeachPanelProps { +interface KanjiListSeachPanelProps { onSelect: (item: string, isSelected: boolean) => void; } -const GradeChipList = (props: kanjiListSeachPanelProps) => { +const GradeChipList = (props: KanjiListSeachPanelProps) => { return ( diff --git a/src/components/KanjiAnswerField.tsx b/src/components/KanjiAnswerField.tsx index 0b3ff2a..89648be 100644 --- a/src/components/KanjiAnswerField.tsx +++ b/src/components/KanjiAnswerField.tsx @@ -1,12 +1,12 @@ import React from 'react'; import { StyleSheet, TextInput, View } from 'react-native'; -interface kanjiAnswerFieldProps { +interface KanjiAnswerFieldProps { answer: string, setAnswer: React.Dispatch> } -const KanjiAnswerField = (props: kanjiAnswerFieldProps) => { +const KanjiAnswerField = (props: KanjiAnswerFieldProps) => { return ( diff --git a/src/components/KanjiCard.tsx b/src/components/KanjiCard.tsx index 054b284..35eb850 100644 --- a/src/components/KanjiCard.tsx +++ b/src/components/KanjiCard.tsx @@ -22,7 +22,7 @@ const KanjiCard = () => { }) const [loadingSvg, setLoadingSvg] = useState(false); const [selectedItems, setSelectedItems] = useState<{ title: string, data: Kanji[] }[]>([]); - const updateSelectedItems = (item: string, isSelected: Boolean) => { + const updateSelectedItems = (item: string, isSelected: boolean) => { if (!isSelected) { setSelectedItems([...selectedItems, { title: item, @@ -53,7 +53,7 @@ const KanjiCard = () => { const fetchXml = async () => { if (kanji) { setLoadingSvg(true); - const xml = await (await fetch(kanji?.image!)).text(); + const xml = await (await fetch(kanji?.image)).text(); setImgXml(xml); setLoadingSvg(false); } diff --git a/src/components/KanjiList.tsx b/src/components/KanjiList.tsx index da29e3c..20cbd19 100644 --- a/src/components/KanjiList.tsx +++ b/src/components/KanjiList.tsx @@ -1,6 +1,6 @@ -import React, { useEffect, useState } from 'react'; +import React, { useState } from 'react'; import { SectionList, StyleSheet, Text, useColorScheme, View } from 'react-native'; -import { useDispatch, useSelector } from 'react-redux'; +import { useSelector } from 'react-redux'; import { learnihonColors } from '../assets/colors'; import { Kanji } from '../model/kanji'; import { KanjiListByGrade } from '../model/kanjiListByGrades'; diff --git a/src/components/KanjiListCell.tsx b/src/components/KanjiListCell.tsx index 0ab281b..ad057a2 100644 --- a/src/components/KanjiListCell.tsx +++ b/src/components/KanjiListCell.tsx @@ -6,11 +6,11 @@ import { Kanji } from '../model/kanji'; import { calcCorrectGuessesRatio, getColorByRatio } from '../model/kanjiGuess'; import { retrieveGuess } from '../storage/storage'; -interface kanjiListCellProps { +interface KanjiListCellProps { kanji: Kanji; } -const KanjiListCell = React.memo((props: kanjiListCellProps) => { +const KanjiListCell = React.memo((props: KanjiListCellProps) => { const cellStyle = useColorScheme() == 'light' ? cellStyle_light : cellStyle_dark; @@ -30,7 +30,7 @@ const KanjiListCell = React.memo((props: kanjiListCellProps) => { useMemo(async () => { const guess = await retrieveGuess(props.kanji.character); - const ratio = guess ? await calcCorrectGuessesRatio(guess) : -1; + const ratio = guess ? calcCorrectGuessesRatio(guess) : -1; setRatio(ratio); }, []); diff --git a/src/navigation/Startup.tsx b/src/navigation/Startup.tsx index dcacf81..21fe199 100644 --- a/src/navigation/Startup.tsx +++ b/src/navigation/Startup.tsx @@ -42,7 +42,6 @@ export default function Startup() { const init = async () => { await (await fetchKanjis())(dispatch); - //await new Promise(resolve => setTimeout(resolve, 5000)); navigator.replace("Main"); } diff --git a/src/storage/storage.ts b/src/storage/storage.ts index 8d8422c..6b8cab2 100644 --- a/src/storage/storage.ts +++ b/src/storage/storage.ts @@ -7,7 +7,7 @@ export const retrieveGuess = async (kanji: string) => { if (value === null) { return null; } - const guess: KanjiGuess = await JSON.parse(value!) + const guess: KanjiGuess = await JSON.parse(value) return guess; } catch (error) { console.log(error)