From 6fa6374cf2a283070977b43b0ac4542d054aee96 Mon Sep 17 00:00:00 2001 From: Aman Harwara Date: Thu, 7 Jul 2022 01:02:59 +0530 Subject: [PATCH] fix(web): update modal styles (#1220) --- .../PasswordWizard/PasswordWizard.tsx | 131 ++++++++---------- .../Account/ChangeEmail/ChangeEmailForm.tsx | 2 +- .../Panes/Security/TwoFactorAuth/Bullet.tsx | 2 +- .../Security/TwoFactorAuth/ScanQRCode.tsx | 4 +- .../SessionsModal/SessionsModal.tsx | 4 +- .../Components/Shared/ModalDialog.tsx | 6 +- .../Components/Shared/ModalDialogButtons.tsx | 3 +- .../Components/Shared/ModalDialogLabel.tsx | 15 +- packages/web/tailwind.config.js | 4 + 9 files changed, 86 insertions(+), 85 deletions(-) diff --git a/packages/web/src/javascripts/Components/PasswordWizard/PasswordWizard.tsx b/packages/web/src/javascripts/Components/PasswordWizard/PasswordWizard.tsx index e68f813ed..afc195b49 100644 --- a/packages/web/src/javascripts/Components/PasswordWizard/PasswordWizard.tsx +++ b/packages/web/src/javascripts/Components/PasswordWizard/PasswordWizard.tsx @@ -3,6 +3,10 @@ import { createRef } from 'react' import { PureComponent } from '@/Components/Abstract/PureComponent' import Button from '@/Components/Button/Button' import DecoratedPasswordInput from '../Input/DecoratedPasswordInput' +import ModalDialog from '../Shared/ModalDialog' +import ModalDialogLabel from '../Shared/ModalDialogLabel' +import ModalDialogDescription from '../Shared/ModalDialogDescription' +import ModalDialogButtons from '../Shared/ModalDialogButtons' interface Props { application: WebApplication @@ -224,84 +228,69 @@ class PasswordWizard extends PureComponent { override render() { return ( -
-
-
-
-
-
-
-
{this.state.title}
- - Close - -
-
- {this.state.step === Steps.PasswordStep && ( -
-
-
-
- +
+ + {this.state.title} + + {this.state.step === Steps.PasswordStep && ( +
+ + - + -
+
- + - -
+ - +
- - -
-
-
- )} - {this.state.step === Steps.FinishStep && ( -
-
Your password has been successfully changed.
-

- Please ensure you are running the latest version of Standard Notes on all platforms to ensure - maximum compatibility. -

-
- )} -
-
- -
+ + + +
-
-
-
+ )} + {this.state.step === Steps.FinishStep && ( +
+
Your password has been successfully changed.
+

+ Please ensure you are running the latest version of Standard Notes on all platforms to ensure maximum + compatibility. +

+
+ )} + + + + +
) } diff --git a/packages/web/src/javascripts/Components/Preferences/Panes/Account/ChangeEmail/ChangeEmailForm.tsx b/packages/web/src/javascripts/Components/Preferences/Panes/Account/ChangeEmail/ChangeEmailForm.tsx index 7009089d0..9b01a1925 100644 --- a/packages/web/src/javascripts/Components/Preferences/Panes/Account/ChangeEmail/ChangeEmailForm.tsx +++ b/packages/web/src/javascripts/Components/Preferences/Panes/Account/ChangeEmail/ChangeEmailForm.tsx @@ -12,7 +12,7 @@ const labelClassName = 'block mb-1' const ChangeEmailForm: FunctionComponent = ({ setNewEmail, setCurrentPassword }) => { return (
-
+
diff --git a/packages/web/src/javascripts/Components/Preferences/Panes/Security/TwoFactorAuth/Bullet.tsx b/packages/web/src/javascripts/Components/Preferences/Panes/Security/TwoFactorAuth/Bullet.tsx index 7eeda5e06..1b85411f7 100644 --- a/packages/web/src/javascripts/Components/Preferences/Panes/Security/TwoFactorAuth/Bullet.tsx +++ b/packages/web/src/javascripts/Components/Preferences/Panes/Security/TwoFactorAuth/Bullet.tsx @@ -5,7 +5,7 @@ type Props = { } const Bullet: FunctionComponent = ({ className = '' }) => ( -
+
) export default Bullet diff --git a/packages/web/src/javascripts/Components/Preferences/Panes/Security/TwoFactorAuth/ScanQRCode.tsx b/packages/web/src/javascripts/Components/Preferences/Panes/Security/TwoFactorAuth/ScanQRCode.tsx index 5a958273a..f87d5e9e4 100644 --- a/packages/web/src/javascripts/Components/Preferences/Panes/Security/TwoFactorAuth/ScanQRCode.tsx +++ b/packages/web/src/javascripts/Components/Preferences/Panes/Security/TwoFactorAuth/ScanQRCode.tsx @@ -25,7 +25,7 @@ const ScanQRCode: FunctionComponent = ({ activation: act }) => {
-
+
@@ -35,7 +35,6 @@ const ScanQRCode: FunctionComponent = ({ activation: act }) => {
-
@@ -43,7 +42,6 @@ const ScanQRCode: FunctionComponent = ({ activation: act }) => { Scan this QR code or add this secret key:
-
+ + } closeDialog={close} > diff --git a/packages/web/src/javascripts/Components/Shared/ModalDialog.tsx b/packages/web/src/javascripts/Components/Shared/ModalDialog.tsx index 9924e0557..e973b6b6a 100644 --- a/packages/web/src/javascripts/Components/Shared/ModalDialog.tsx +++ b/packages/web/src/javascripts/Components/Shared/ModalDialog.tsx @@ -1,5 +1,6 @@ import { useRef, ReactNode } from 'react' import { AlertDialogContent, AlertDialogOverlay } from '@reach/alert-dialog' +import { classNames } from '@/Utils/ConcatenateClassNames' type Props = { children: ReactNode @@ -14,7 +15,10 @@ const ModalDialog = ({ children, onDismiss, className }: Props) => { {children} diff --git a/packages/web/src/javascripts/Components/Shared/ModalDialogButtons.tsx b/packages/web/src/javascripts/Components/Shared/ModalDialogButtons.tsx index 843a6efd0..ad5a4326f 100644 --- a/packages/web/src/javascripts/Components/Shared/ModalDialogButtons.tsx +++ b/packages/web/src/javascripts/Components/Shared/ModalDialogButtons.tsx @@ -1,3 +1,4 @@ +import { classNames } from '@/Utils/ConcatenateClassNames' import { FunctionComponent } from 'react' type Props = { @@ -7,7 +8,7 @@ type Props = { const ModalDialogButtons: FunctionComponent = ({ children, className }) => ( <>
-
+
{children != undefined && Array.isArray(children) ? children.map((child, idx, arr) => ( <> diff --git a/packages/web/src/javascripts/Components/Shared/ModalDialogLabel.tsx b/packages/web/src/javascripts/Components/Shared/ModalDialogLabel.tsx index f4485b1fe..059fc4609 100644 --- a/packages/web/src/javascripts/Components/Shared/ModalDialogLabel.tsx +++ b/packages/web/src/javascripts/Components/Shared/ModalDialogLabel.tsx @@ -1,5 +1,7 @@ import { FunctionComponent, ReactNode } from 'react' import { AlertDialogLabel } from '@reach/alert-dialog' +import Icon from '@/Components/Icon/Icon' +import { classNames } from '@/Utils/ConcatenateClassNames' type Props = { closeDialog: () => void @@ -9,15 +11,18 @@ type Props = { const ModalDialogLabel: FunctionComponent = ({ children, closeDialog, className, headerButtons }) => (
-
{children}
+
{children}
{headerButtons} -
- Close -
+

diff --git a/packages/web/tailwind.config.js b/packages/web/tailwind.config.js index ace2c5102..7014e7b6b 100644 --- a/packages/web/tailwind.config.js +++ b/packages/web/tailwind.config.js @@ -38,6 +38,10 @@ module.exports = { 89: '22.25rem', 125: '31.25rem', }, + minHeight: { + 1: '0.25rem', + 2: '0.5rem', + }, maxHeight: { 110: '27.5rem', },