diff --git a/app/soapbox/components/ui/modal/modal.tsx b/app/soapbox/components/ui/modal/modal.tsx index 5ac16ca14..5c01c513a 100644 --- a/app/soapbox/components/ui/modal/modal.tsx +++ b/app/soapbox/components/ui/modal/modal.tsx @@ -10,6 +10,19 @@ const messages = defineMessages({ confirm: { id: 'confirmations.delete.confirm', defaultMessage: 'Delete' }, }); +type Widths = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' + +const widths = { + xs: 'max-w-xs', + sm: 'max-w-sm', + md: 'max-w-base', + lg: 'max-w-lg', + xl: 'max-w-xl', + '2xl': 'max-w-2xl', + '3xl': 'max-w-3xl', + '4xl': 'max-w-4xl', +}; + interface IModal { /** Callback when the modal is cancelled. */ cancelAction?: () => void, @@ -37,6 +50,7 @@ interface IModal { skipFocus?: boolean, /** Title text for the modal. */ title: string | React.ReactNode, + width?: Widths, } /** Displays a modal dialog box. */ @@ -55,6 +69,7 @@ const Modal: React.FC = ({ secondaryText, skipFocus = false, title, + width = 'xl', }) => { const intl = useIntl(); const buttonRef = React.useRef(null); @@ -66,7 +81,7 @@ const Modal: React.FC = ({ }, [skipFocus, buttonRef]); return ( -
+
void, } +const Hotkey: React.FC<{ children: React.ReactNode }> = ({ children }) => ( + + {children} + +); + +const TableCell: React.FC<{ children: React.ReactNode }> = ({ children }) => ( + + {children} + +); + const HotkeysModal: React.FC = ({ onClose }) => { const features = useAppSelector((state) => getFeatures(state.instance)); @@ -16,142 +28,143 @@ const HotkeysModal: React.FC = ({ onClose }) => { } onClose={onClose} + width='4xl' > -
+
- + - - + r + - - + m + - - + p + - - + f + {features.emojiReacts && ( - - + e + )} - - + b + - - + enter, o + - - + a +
r
m
p
f
e
b
enter, o
a
- + {features.spoilers && ( - - + x + )} {features.spoilers && ( - - + h + )} - - + up, k + - - + down, j + - - + n + - - + alt + n + - - + backspace + - - + s + - - + esc +
x
h
up, k
down, j
n
alt + n
backspace
s
esc
- + - - + g + h + - - + g + n + - - + g + f + - - + g + p + - - + g + u + - - + g + b + - - + g + m + - - + g + r + - - + ? +
g + h
g + n
g + f
g + p
g + u
g + b
g + m
g + r
?
diff --git a/app/styles/application.scss b/app/styles/application.scss index dd59d8754..03f8ff65d 100644 --- a/app/styles/application.scss +++ b/app/styles/application.scss @@ -43,7 +43,6 @@ @import 'components/user-panel'; @import 'components/compose-form'; @import 'components/sidebar-menu'; -@import 'components/hotkeys-modal'; @import 'components/emoji-reacts'; @import 'components/status'; @import 'components/reply-indicator'; diff --git a/app/styles/components/hotkeys-modal.scss b/app/styles/components/hotkeys-modal.scss deleted file mode 100644 index b246e115a..000000000 --- a/app/styles/components/hotkeys-modal.scss +++ /dev/null @@ -1,51 +0,0 @@ -.hotkeys-modal { - padding: 8px 0 0; - overflow: hidden; - background-color: var(--background-color); - border-radius: 6px; - flex-direction: column; - - @media screen and (max-width: 960px) { - height: 90vh; - } - - .compose-modal__content { - background-color: var(--background-color); - margin: 5px; - - @media screen and (max-width: 960px) { - flex-direction: column; - overflow: hidden; - overflow-y: scroll; - height: calc(100% - 80px); - -webkit-overflow-scrolling: touch; - } - } - - table { - thead { - display: block; - padding-left: 10px; - margin-bottom: 10px; - color: var(--primary-text-color); - font-size: 16px; - font-weight: 600; - } - - tr { - font-size: 12px; - } - - td { - padding: 0 10px 8px; - } - - kbd { - display: inline-block; - padding: 2px 8px; - background-color: var(--brand-color--med); - border: 1px solid var(--brand-color--med); - border-radius: 4px; - } - } -}