diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json index 8f3031a..5f3bbad 100644 --- a/.vs/VSWorkspaceState.json +++ b/.vs/VSWorkspaceState.json @@ -1,9 +1,12 @@ { "ExpandedNodes": [ "", + "\\assets", "\\components", - "\\pages" + "\\model", + "\\redux", + "\\redux\\reducers" ], - "SelectedNode": "\\pages\\Playground.tsx", + "SelectedNode": "\\app.json", "PreviewInSolutionExplorer": false } \ No newline at end of file diff --git a/.vs/iut-expo-starter/FileContentIndex/0c39b26e-7504-4519-80ab-85d57005ca60.vsidx b/.vs/iut-expo-starter/FileContentIndex/0c39b26e-7504-4519-80ab-85d57005ca60.vsidx deleted file mode 100644 index 46fcd2e..0000000 Binary files a/.vs/iut-expo-starter/FileContentIndex/0c39b26e-7504-4519-80ab-85d57005ca60.vsidx and /dev/null differ diff --git a/.vs/iut-expo-starter/FileContentIndex/191a09ed-8197-4b82-8c17-172be12a37b5.vsidx b/.vs/iut-expo-starter/FileContentIndex/191a09ed-8197-4b82-8c17-172be12a37b5.vsidx deleted file mode 100644 index 9267cf8..0000000 Binary files a/.vs/iut-expo-starter/FileContentIndex/191a09ed-8197-4b82-8c17-172be12a37b5.vsidx and /dev/null differ diff --git a/.vs/iut-expo-starter/FileContentIndex/b55ca5bb-cc34-4338-926a-3d67824b010f.vsidx b/.vs/iut-expo-starter/FileContentIndex/b55ca5bb-cc34-4338-926a-3d67824b010f.vsidx new file mode 100644 index 0000000..980a1df Binary files /dev/null and b/.vs/iut-expo-starter/FileContentIndex/b55ca5bb-cc34-4338-926a-3d67824b010f.vsidx differ diff --git a/.vs/iut-expo-starter/FileContentIndex/bcf709fe-9005-4036-9403-134ef8f674a7.vsidx b/.vs/iut-expo-starter/FileContentIndex/bcf709fe-9005-4036-9403-134ef8f674a7.vsidx new file mode 100644 index 0000000..e8d9e3d Binary files /dev/null and b/.vs/iut-expo-starter/FileContentIndex/bcf709fe-9005-4036-9403-134ef8f674a7.vsidx differ diff --git a/.vs/iut-expo-starter/FileContentIndex/ab9ac88f-0ede-4229-9198-026149e48485.vsidx b/.vs/iut-expo-starter/FileContentIndex/cf58862c-0b8b-4e98-837c-b2dedc65295e.vsidx similarity index 52% rename from .vs/iut-expo-starter/FileContentIndex/ab9ac88f-0ede-4229-9198-026149e48485.vsidx rename to .vs/iut-expo-starter/FileContentIndex/cf58862c-0b8b-4e98-837c-b2dedc65295e.vsidx index 6da0b4c..2366db3 100644 Binary files a/.vs/iut-expo-starter/FileContentIndex/ab9ac88f-0ede-4229-9198-026149e48485.vsidx and b/.vs/iut-expo-starter/FileContentIndex/cf58862c-0b8b-4e98-837c-b2dedc65295e.vsidx differ diff --git a/.vs/iut-expo-starter/FileContentIndex/d5c824f1-44a0-4ba7-bfc4-7875314daeff.vsidx b/.vs/iut-expo-starter/FileContentIndex/d5c824f1-44a0-4ba7-bfc4-7875314daeff.vsidx deleted file mode 100644 index 10a48ca..0000000 Binary files a/.vs/iut-expo-starter/FileContentIndex/d5c824f1-44a0-4ba7-bfc4-7875314daeff.vsidx and /dev/null differ diff --git a/.vs/iut-expo-starter/v17/.wsuo b/.vs/iut-expo-starter/v17/.wsuo index 00b6de0..3523fd4 100644 Binary files a/.vs/iut-expo-starter/v17/.wsuo and b/.vs/iut-expo-starter/v17/.wsuo differ diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite index f5eeb34..77b70f3 100644 Binary files a/.vs/slnx.sqlite and b/.vs/slnx.sqlite differ diff --git a/App.tsx b/App.tsx index 42de500..07ec5d1 100644 --- a/App.tsx +++ b/App.tsx @@ -1,5 +1,8 @@ import React from 'react'; +import store from "./redux/store"; +import { Provider } from 'react-redux'; + import { StatusBar } from 'expo-status-bar'; import { Keyboard, SafeAreaView, StyleSheet, TouchableWithoutFeedback } from 'react-native'; @@ -9,13 +12,15 @@ import TabBar from './components/TabBar'; export default function App() { return ( - { Keyboard.dismiss(); }}> - -
- - - - + + { Keyboard.dismiss(); }}> + +
+ + + + + ); } diff --git a/app.json b/app.json index 7a48109..d7be4f6 100644 --- a/app.json +++ b/app.json @@ -4,10 +4,10 @@ "slug": "expo-init", "version": "1.0.0", "orientation": "portrait", - "icon": "./assets/icon.png", + "icon": "./src/assets/icon.png", "userInterfaceStyle": "light", "splash": { - "image": "./assets/splash.png", + "image": "./src/assets/splash.png", "resizeMode": "contain", "backgroundColor": "#ffffff" }, @@ -22,12 +22,12 @@ }, "android": { "adaptiveIcon": { - "foregroundImage": "./assets/adaptive-icon.png", + "foregroundImage": "./src/assets/adaptive-icon.png", "backgroundColor": "#FFFFFF" } }, "web": { - "favicon": "./assets/favicon.png" + "favicon": "./src/assets/favicon.png" } } } diff --git a/components/DrawingCanva.tsx b/components/DrawingCanva.tsx index 572d4bc..b50661b 100644 --- a/components/DrawingCanva.tsx +++ b/components/DrawingCanva.tsx @@ -1,27 +1,41 @@ -import React, {useRef, useState } from 'react'; +import React, {useEffect, useRef, useState } from 'react'; import { SketchCanvas, SketchCanvasRef } from 'rn-perfect-sketch-canvas'; -import { StyleSheet, Button, View } from 'react-native'; +import { StyleSheet, Button, View, Text } from 'react-native'; import { SvgUri } from 'react-native-svg'; import Slider from '@react-native-community/slider' +import { useSelector } from 'react-redux'; +import { Kanji, KanjiMapper } from '../model/kanji'; + type DrawingCanvaProps = { backgroundImage: string; -} +} const DrawingCanva = (props: DrawingCanvaProps) => { const canvasRef = useRef(null); const [strokeWidth, setStroke] = useState(5); + const [isCanvasReady, setIsCanvasReady] = useState(false); + + const selectedKanji = KanjiMapper.SerializedObjectToKanji(useSelector(state => state.kanjiReducer.selectedKanji)); + + + useEffect(() => { + if (canvasRef.current) { + setIsCanvasReady(true); + } + }, [canvasRef.current]); + return ( - + />)} { maximumValue={10} minimumTrackTintColor={"#FF5C5C"} /> - + {isCanvasReady && (