Skip to content

Commit

Permalink
chore: security screen
Browse files Browse the repository at this point in the history
  • Loading branch information
sandipndev committed Apr 1, 2024
1 parent 3b38589 commit 2b6225c
Showing 1 changed file with 33 additions and 39 deletions.
72 changes: 33 additions & 39 deletions app/screens/settings-screen/security-screen.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import * as React from "react"
import { useState } from "react"
import { Switch, View } from "react-native"
import { View } from "react-native"

import { useApolloClient } from "@apollo/client"
import { GaloyTertiaryButton } from "@app/components/atomic/galoy-tertiary-button"
import { useHideBalanceQuery } from "@app/graphql/generated"
import { useI18nContext } from "@app/i18n/i18n-react"
import { RouteProp, useFocusEffect } from "@react-navigation/native"
import { StackNavigationProp } from "@react-navigation/stack"
import { Text, makeStyles } from "@rneui/themed"
import { Text, makeStyles, Switch } from "@rneui/themed"

import { Screen } from "../../components/screen"
import {
Expand All @@ -21,35 +21,6 @@ import { PinScreenPurpose } from "../../utils/enum"
import KeyStoreWrapper from "../../utils/storage/secureStorage"
import { toastShow } from "../../utils/toast"

const useStyles = makeStyles(() => ({
container: {
minHeight: "100%",
paddingLeft: 24,
paddingRight: 24,
},

description: {
fontSize: 14,
marginTop: 2,
},

settingContainer: {
flexDirection: "row",
},

switch: {
bottom: 18,
position: "absolute",
right: 0,
},

textContainer: {
marginBottom: 12,
marginRight: 60,
marginTop: 32,
},
}))

type Props = {
navigation: StackNavigationProp<RootStackParamList, "security">
route: RouteProp<RootStackParamList, "security">
Expand Down Expand Up @@ -158,21 +129,19 @@ export const SecurityScreen: React.FC<Props> = ({ route, navigation }) => {
<View style={styles.textContainer}>
<Text type="h1">{LL.SecurityScreen.pinTitle()}</Text>
<Text type="p2">{LL.SecurityScreen.pinDescription()}</Text>
<GaloyTertiaryButton
title={LL.SecurityScreen.setPin()}
onPress={() =>
navigation.navigate("pin", { screenPurpose: PinScreenPurpose.SetPin })
}
/>
</View>
<Switch
style={styles.switch}
value={isPinEnabled}
onValueChange={onPinValueChanged}
/>
</View>
<View style={styles.settingContainer}>
<GaloyTertiaryButton
title={LL.SecurityScreen.setPin()}
onPress={() =>
navigation.navigate("pin", { screenPurpose: PinScreenPurpose.SetPin })
}
/>
</View>
<View style={styles.settingContainer}>
<View style={styles.textContainer}>
<Text type="h1">{LL.SecurityScreen.hideBalanceTitle()}</Text>
Expand All @@ -187,3 +156,28 @@ export const SecurityScreen: React.FC<Props> = ({ route, navigation }) => {
</Screen>
)
}

const useStyles = makeStyles(() => ({
container: {
margin: 24,
display: "flex",
flexDirection: "column",
rowGap: 20,
},

settingContainer: {
flexDirection: "row",
justifyContent: "space-between",
},

switch: {
position: "absolute",
right: 0,
},

textContainer: {
display: "flex",
flexDirection: "column",
rowGap: 8,
},
}))

0 comments on commit 2b6225c

Please sign in to comment.