-
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.
various improvements, add grammar_details
- Loading branch information
Showing
21 changed files
with
31,515 additions
and
1,662 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
Binary file not shown.
685 changes: 343 additions & 342 deletions
685
.yarn/releases/yarn-4.1.1.cjs → .yarn/releases/yarn-4.3.0.cjs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
nodeLinker: node-modules | ||
|
||
yarnPath: .yarn/releases/yarn-4.1.1.cjs | ||
yarnPath: .yarn/releases/yarn-4.3.0.cjs |
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,66 +1 @@ | ||
import { Input, ScrollView, useMedia, XStack } from "tamagui"; | ||
import { useRouter } from "expo-router"; | ||
|
||
import { ListItem, Text } from "tamagui"; | ||
import { useRoute } from "@react-navigation/native"; | ||
import Details from "../../scripts/data/grammar_details.json"; | ||
import { BookKey, ChevronRight, Search } from "@tamagui/lucide-icons"; | ||
import { FlatList } from "react-native"; | ||
import { useMemo, useState } from "react"; | ||
|
||
const LevelComp = ({ level }: { level: string }) => { | ||
return ( | ||
<XStack gap="$2" ai="center"> | ||
<XStack px="$2" py="$1" br="$4" bg={"$gray4"}> | ||
<Text color="$gray9">{level}</Text> | ||
</XStack> | ||
<ChevronRight /> | ||
</XStack> | ||
); | ||
}; | ||
export default function () { | ||
const r = useRouter(); | ||
const [search, setSearch] = useState(""); | ||
|
||
const results = useMemo( | ||
() => | ||
search === "" | ||
? Details | ||
: Details.filter( | ||
(d) => | ||
d.main_grammar.includes(search) || | ||
d.meaning?.actual?.toLowerCase()?.includes(search) || | ||
d.jlpt_level?.toLowerCase()?.includes(search) | ||
), | ||
[search] | ||
); | ||
return ( | ||
<> | ||
<XStack ai="center" px="$3" gap="$2" py="$2"> | ||
<Search /> | ||
<Input flex={1} onChangeText={(r) => setSearch(r.toLowerCase())} /> | ||
</XStack> | ||
<FlatList | ||
data={results} | ||
getItemLayout={(data, index) => ({ | ||
length: 65, | ||
offset: 65 * index, | ||
index, | ||
})} | ||
renderItem={({ item }) => ( | ||
<ListItem | ||
hoverTheme | ||
pressTheme | ||
title={item.main_grammar} | ||
subTitle={item.meaning.actual} | ||
icon={BookKey} | ||
iconAfter={<LevelComp level={item.jlpt_level} />} | ||
onPress={() => { | ||
r.push(`/grammar/${item.id}`); | ||
}} | ||
/> | ||
)} | ||
/> | ||
</> | ||
); | ||
} | ||
export { default } from "../grammar/list"; |
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
Oops, something went wrong.