Add toggle to hide email

This commit is contained in:
Ategon 2025-02-10 22:30:41 -05:00
parent eb54bd588a
commit a2a1323e01

View file

@ -21,6 +21,7 @@ export default function UserPage() {
const [errors] = useState({}); const [errors] = useState({});
const pathname = usePathname(); const pathname = usePathname();
const [waitingSave, setWaitingSave] = useState(false); const [waitingSave, setWaitingSave] = useState(false);
const [showEmail, setShowEmail] = useState(false);
useEffect(() => { useEffect(() => {
loadUser(); loadUser();
@ -127,15 +128,20 @@ export default function UserPage() {
onValueChange={setName} onValueChange={setName}
/> />
<Input <p>Email</p>
label="Email" {showEmail && (
labelPlacement="outside" <Input
name="email" label="Email"
placeholder="Enter an email" name="email"
type="text" placeholder="Enter an email"
value={email} type="text"
onValueChange={setEmail} value={email}
/> onValueChange={setEmail}
/>
)}
<Button size="sm" onPress={() => setShowEmail(!showEmail)}>
{showEmail ? "Hide Email" : "Show Email"}
</Button>
<p>Bio</p> <p>Bio</p>
<Editor content={bio} setContent={setBio} /> <Editor content={bio} setContent={setBio} />