From a2a1323e01fdf4e0d1312c5ce20bab1bf231fdcf Mon Sep 17 00:00:00 2001 From: Ategon <benjamin@barbeau.net> Date: Mon, 10 Feb 2025 22:30:41 -0500 Subject: [PATCH] Add toggle to hide email --- src/app/settings/page.tsx | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/app/settings/page.tsx b/src/app/settings/page.tsx index 69f88a2..4e82119 100644 --- a/src/app/settings/page.tsx +++ b/src/app/settings/page.tsx @@ -21,6 +21,7 @@ export default function UserPage() { const [errors] = useState({}); const pathname = usePathname(); const [waitingSave, setWaitingSave] = useState(false); + const [showEmail, setShowEmail] = useState(false); useEffect(() => { loadUser(); @@ -127,15 +128,20 @@ export default function UserPage() { onValueChange={setName} /> - <Input - label="Email" - labelPlacement="outside" - name="email" - placeholder="Enter an email" - type="text" - value={email} - onValueChange={setEmail} - /> + <p>Email</p> + {showEmail && ( + <Input + label="Email" + name="email" + placeholder="Enter an email" + type="text" + value={email} + onValueChange={setEmail} + /> + )} + <Button size="sm" onPress={() => setShowEmail(!showEmail)}> + {showEmail ? "Hide Email" : "Show Email"} + </Button> <p>Bio</p> <Editor content={bio} setContent={setBio} />