Skip to content

Commit

Permalink
chore: revert fiatcurrency screen
Browse files Browse the repository at this point in the history
  • Loading branch information
im-adithya committed Sep 12, 2024
1 parent 74e9186 commit e300284
Showing 1 changed file with 35 additions and 32 deletions.
67 changes: 35 additions & 32 deletions pages/settings/FiatCurrency.tsx
Original file line number Diff line number Diff line change
@@ -1,49 +1,52 @@
import { router } from "expo-router";
import React from "react";
import { View } from "react-native";
import { Keyboard, TouchableWithoutFeedback, View } from "react-native";
import Toast from "react-native-toast-message";
import { Button } from "~/components/ui/button";
import { Input } from "~/components/ui/input";
import { Text } from "~/components/ui/text";
import { useAppStore } from "~/lib/state/appStore";
import Screen from "~/components/Screen";
import DismissableKeyboardView from "~/components/DismissableKeyboardView";

export function FiatCurrency() {
const [fiatCurrency, setFiatCurrency] = React.useState(
useAppStore.getState().fiatCurrency,
);
return (
<DismissableKeyboardView>
<View className="flex-1 p-6">
<Screen title="Units & Currency" />
<View className="flex-1 flex flex-col">
<View className="flex-1">
<Input
autoFocus
className="w-full text-center"
placeholder="USD"
value={fiatCurrency}
onChangeText={setFiatCurrency}
returnKeyType="done"
// aria-errormessage="inputError"
/>
</View>
<Button
size="lg"
onPress={() => {
useAppStore.getState().setFiatCurrency(fiatCurrency);
Toast.show({
type: "success",
text1: "Fiat currency updated",
});
router.back();
}}
>
<Text>Save</Text>
</Button>
<View className="flex-1 flex flex-col p-6 gap-3">
<Screen
title="Units & Currency"
/>
<TouchableWithoutFeedback
onPress={() => {
Keyboard.dismiss();
}}
>
<View className="flex-1">
<Input
autoFocus
className="w-full text-center"
placeholder="USD"
value={fiatCurrency}
onChangeText={setFiatCurrency}
returnKeyType="done"
// aria-errormessage="inputError"
/>
</View>
</View>
</DismissableKeyboardView>
</TouchableWithoutFeedback>
<Button
size="lg"
onPress={() => {
useAppStore.getState().setFiatCurrency(fiatCurrency);
Toast.show({
type: "success",
text1: "Fiat currency updated",
});
router.back();
}}
>
<Text>Save</Text>
</Button>
</View>
);
}

0 comments on commit e300284

Please sign in to comment.