Removed the previous inputs of settings preference view

This commit is contained in:
Clément Le Bihan
2023-04-10 23:58:49 +02:00
parent 047cd054bd
commit 3aa104a923
2 changed files with 5 additions and 94 deletions
+5 -2
View File
@@ -109,8 +109,11 @@ export const getElementRangeNode = (
) => {
return (
<Slider
value={value}
defaultValue={defaultValue}
// this is a hot fix for now but ideally this input should be managed
// by the value prop and not the defaultValue prop but it requires the
// caller to manage the state of the continuous value which is not ideal
defaultValue={value}
// defaultValue={defaultValue}
minValue={min}
maxValue={max}
step={step}
-92
View File
@@ -34,98 +34,6 @@ const PreferencesView = ({ navigation }) => {
<Heading style={{ textAlign: "center" }}>
<Translate translationKey="prefBtn" />
</Heading>
<View style={{ margin: 20, maxHeight: 100, maxWidth: 500, width: "80%" }}>
<Select
selectedValue={settings.colorScheme}
placeholder={"Theme"}
style={{ alignSelf: "center" }}
onValueChange={(newColorScheme) => {
dispatch(updateSettings({ colorScheme: newColorScheme as any }));
}}
>
<Select.Item label={translate("dark")} value="dark" />
<Select.Item label={translate("light")} value="light" />
<Select.Item label={translate("system")} value="system" />
</Select>
</View>
<View style={{ margin: 20, maxHeight: 100, maxWidth: 500, width: "80%" }}>
<Select
selectedValue={language}
placeholder={translate("langBtn")}
style={{ alignSelf: "center" }}
onValueChange={(itemValue) => {
dispatch(useLanguage(itemValue as AvailableLanguages));
}}
>
<Select.Item label="Français" value="fr" />
<Select.Item label="English" value="en" />
<Select.Item label="Italiano" value="it" />
<Select.Item label="Espanol" value="sp" />
</Select>
</View>
<View style={{ margin: 20, maxHeight: 100, maxWidth: 500, width: "80%" }}>
<Select
selectedValue={settings.preferedLevel}
placeholder={translate("diffBtn")}
style={{ height: 50, width: 150, alignSelf: "center" }}
onValueChange={(itemValue) => {
dispatch(updateSettings({ preferedLevel: itemValue as any }));
}}
>
<Select.Item label={translate("easy")} value="easy" />
<Select.Item label={translate("medium")} value="medium" />
<Select.Item label={translate("hard")} value="hard" />
</Select>
</View>
<View style={{ margin: 20 }}>
<Text style={{ textAlign: "center" }}>Color blind mode</Text>
<Switch
style={{ alignSelf: "center" }}
value={settings.colorBlind}
colorScheme="primary"
onValueChange={(enabled) => {
dispatch(updateSettings({ colorBlind: enabled }));
}}
/>
</View>
<View style={{ margin: 20, maxHeight: 100, maxWidth: 500, width: "80%" }}>
<Text style={{ textAlign: "center" }}>Mic volume</Text>
<Slider
defaultValue={settings.micLevel}
minValue={0}
maxValue={1000}
accessibilityLabel="hello world"
step={10}
onChangeEnd={(value) => {
dispatch(updateSettings({ micLevel: value }));
}}
>
<Slider.Track>
<Slider.FilledTrack />
</Slider.Track>
<Slider.Thumb />
</Slider>
</View>
<View style={{ margin: 20, maxHeight: 100, maxWidth: 500, width: "80%" }}>
<Select
selectedValue={settings.preferedInputName}
placeholder={"Device"}
style={{ height: 50, width: 150, alignSelf: "center" }}
onValueChange={(itemValue: string) => {
dispatch(updateSettings({ preferedInputName: itemValue }));
}}
>
<Select.Item label="Mic_0" value="0" />
<Select.Item label="Mic_1" value="1" />
<Select.Item label="Mic_2" value="2" />
</Select>
</View>
<ElementList
style={{
marginTop: 20,