Skip to content

Commit

Permalink
dev switch is hiding/showing a little bit now
Browse files Browse the repository at this point in the history
  • Loading branch information
K committed Nov 26, 2024
1 parent 2448529 commit ec1eb0b
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions nr-app/app/(tabs)/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,26 @@ import {
} from "react-native";
import Toast from "react-native-root-toast";

const DevSwitch = () => {
const [devMode, setDevMode] = useState(true); // Local state for toggle

const toggleVisibility = (value: boolean | ((prevState: boolean) => boolean)) => {
setDevMode(value); // Update visibility based on switch value
};

return (
<View>
<Switch
value={devMode}
onValueChange={toggleVisibility}
/>
<Text>dev mode</Text>
{devMode && <Text>DEV MODE ON</Text>}
</View>
);
};


export default function TabThreeScreen() {
const [nsec, setNsec] = useState("");
const [mnemonic, setMnemonic] = useState("");
Expand Down Expand Up @@ -153,10 +173,7 @@ export default function TabThreeScreen() {
}}
/>
</ScrollView>
<View>
<Switch value={true} />
<Text>dev mode</Text>
</View>
<DevSwitch />
</SafeAreaView>
);
}
Expand Down

0 comments on commit ec1eb0b

Please sign in to comment.