From 9157dc136423bdc20594f3436b46ab7139fef276 Mon Sep 17 00:00:00 2001 From: Aman Harwara Date: Wed, 13 Sep 2023 00:10:32 +0530 Subject: [PATCH] chore: show key option descriptions & improve style --- .../VaultModal/KeyStoragePreference.tsx | 40 ++++++++++------- .../VaultModal/PasswordTypePreference.tsx | 43 +++++++++++-------- .../Components/Radio/StyledRadioInput.tsx | 6 +-- 3 files changed, 51 insertions(+), 38 deletions(-) diff --git a/packages/web/src/javascripts/Components/Preferences/Panes/Vaults/Vaults/VaultModal/KeyStoragePreference.tsx b/packages/web/src/javascripts/Components/Preferences/Panes/Vaults/Vaults/VaultModal/KeyStoragePreference.tsx index b0c191651..fbe9addc5 100644 --- a/packages/web/src/javascripts/Components/Preferences/Panes/Vaults/Vaults/VaultModal/KeyStoragePreference.tsx +++ b/packages/web/src/javascripts/Components/Preferences/Panes/Vaults/Vaults/VaultModal/KeyStoragePreference.tsx @@ -1,4 +1,4 @@ -import { KeySystemRootKeyStorageMode } from '@standardnotes/snjs' +import { KeySystemRootKeyStorageMode, classNames } from '@standardnotes/snjs' import StyledRadioInput from '@/Components/Radio/StyledRadioInput' type KeyStorageOption = { @@ -37,21 +37,29 @@ export const KeyStoragePreference = ({ }) => { return (
-
Vault Key Type
- {options.map((option) => { - return ( - - ) - })} +
Vault Key Storage Mode
+
+ {options.map((option) => { + const isSelected = value === option.value + return ( + + ) + })} +
) } diff --git a/packages/web/src/javascripts/Components/Preferences/Panes/Vaults/Vaults/VaultModal/PasswordTypePreference.tsx b/packages/web/src/javascripts/Components/Preferences/Panes/Vaults/Vaults/VaultModal/PasswordTypePreference.tsx index 62d719aa3..072413914 100644 --- a/packages/web/src/javascripts/Components/Preferences/Panes/Vaults/Vaults/VaultModal/PasswordTypePreference.tsx +++ b/packages/web/src/javascripts/Components/Preferences/Panes/Vaults/Vaults/VaultModal/PasswordTypePreference.tsx @@ -1,4 +1,4 @@ -import { KeySystemPasswordType } from '@standardnotes/snjs' +import { KeySystemPasswordType, classNames } from '@standardnotes/snjs' import StyledRadioInput from '@/Components/Radio/StyledRadioInput' import DecoratedPasswordInput from '@/Components/Input/DecoratedPasswordInput' import { useState } from 'react' @@ -42,25 +42,30 @@ export const PasswordTypePreference = ({ return (
Vault Key Type
- {options.map((option) => { - return ( - - ) - })} - +
+ {options.map((option) => { + const isSelected = value === option.value + return ( + + ) + })} +
{value === KeySystemPasswordType.UserInputted && ( -
-
{options[1].description}
- +
-const StyledRadioInput = (props: Props) => { +const StyledRadioInput = ({ className, ...props }: Props) => { return ( -
- +
+
)