diff --git a/frontend/src/components/utilities/cryptography/crypto.ts b/frontend/src/components/utilities/cryptography/crypto.ts index 961dee83f..75b69a109 100644 --- a/frontend/src/components/utilities/cryptography/crypto.ts +++ b/frontend/src/components/utilities/cryptography/crypto.ts @@ -20,7 +20,7 @@ type EncryptAsymmetricProps = { * @param {Number} obj.time - number of iterations * @param {Number} obj.parallelism - desired parallelism * @param {Number} obj.hashLen - desired hash length (i.e. byte-length of derived key) - * @returns + * @returns */ const deriveArgonKey = async ({ password, @@ -39,8 +39,8 @@ const deriveArgonKey = async ({ }) => { let derivedKey; try { - derivedKey = await argon2.hash({ - pass: password, + derivedKey = await argon2.hash({ + pass: password, salt, type: argon2.ArgonType.Argon2id, mem, @@ -53,7 +53,7 @@ const deriveArgonKey = async ({ } return derivedKey; -} +}; /** * Return assymmetrically encrypted [plaintext] using [publicKey] where @@ -173,6 +173,7 @@ type DecryptSymmetricProps = { * */ const decryptSymmetric = ({ ciphertext, iv, tag, key }: DecryptSymmetricProps): string => { + if (!ciphertext) return ''; let plaintext; try { plaintext = aes.decrypt({ ciphertext, iv, tag, secret: key }); @@ -184,10 +185,10 @@ const decryptSymmetric = ({ ciphertext, iv, tag, key }: DecryptSymmetricProps): return plaintext; }; -export { - decryptAssymmetric, - decryptSymmetric, +export { + decryptAssymmetric, + decryptSymmetric, deriveArgonKey, - encryptAssymmetric, - encryptSymmetric + encryptAssymmetric, + encryptSymmetric }; diff --git a/frontend/src/components/v2/Button/Button.tsx b/frontend/src/components/v2/Button/Button.tsx index 8c6bf91b2..00663ad69 100644 --- a/frontend/src/components/v2/Button/Button.tsx +++ b/frontend/src/components/v2/Button/Button.tsx @@ -36,7 +36,7 @@ const buttonVariants = cva( star: 'text-bunker-200 bg-mineshaft-500' }, isDisabled: { - true: 'bg-mineshaft opacity-40 cursor-not-allowed', + true: 'bg-mineshaft text-white opacity-50 cursor-not-allowed', false: '' }, isFullWidth: { @@ -155,26 +155,26 @@ export const Button = forwardRef( className="absolute rounded-xl" /> )} - {leftIcon} - - {children} - + {children} +
{rightIcon} - +
); } diff --git a/frontend/src/components/v2/Drawer/Drawer.stories.tsx b/frontend/src/components/v2/Drawer/Drawer.stories.tsx new file mode 100644 index 000000000..9925d8cae --- /dev/null +++ b/frontend/src/components/v2/Drawer/Drawer.stories.tsx @@ -0,0 +1,32 @@ +import type { Meta, StoryObj } from '@storybook/react'; + +import { Button } from '../Button'; +import { Drawer, DrawerContent, DrawerContentProps, DrawerTrigger } from './Drawer'; + +const meta: Meta = { + title: 'Components/Drawer', + component: Drawer, + tags: ['v2'], + argTypes: {} +}; + +export default meta; +type Story = StoryObj; + +const Template = (args: DrawerContentProps) => ( + + + + + Hello world + +); + +export const Basic: Story = { + render: (args) =>