From 2b8088c5e1d78d73effdbac529c77b15d9444fe9 Mon Sep 17 00:00:00 2001 From: Harshith Mohan Date: Wed, 1 Nov 2023 21:47:59 +0530 Subject: [PATCH] Fix font weights, update actions modal (#669) * Update actions modal * Fix the default font weight --- src/components/Dialogs/ActionsModal.tsx | 71 +++++++++++-------------- src/components/Panels/ModalPanel.tsx | 9 ++-- src/css/common.css | 2 +- tailwind.config.js | 2 +- 4 files changed, 39 insertions(+), 45 deletions(-) diff --git a/src/components/Dialogs/ActionsModal.tsx b/src/components/Dialogs/ActionsModal.tsx index 833081c13..af734fb4f 100644 --- a/src/components/Dialogs/ActionsModal.tsx +++ b/src/components/Dialogs/ActionsModal.tsx @@ -1,6 +1,5 @@ import React, { useMemo, useState } from 'react'; -import AnimateHeight from 'react-animate-height'; -import { mdiInformationOutline, mdiPlayCircleOutline } from '@mdi/js'; +import { mdiPlayCircleOutline } from '@mdi/js'; import { Icon } from '@mdi/react'; import cx from 'classnames'; import { map } from 'lodash'; @@ -17,10 +16,10 @@ const actions = { import: { title: 'Import', data: [ + 'run-import', 'remove-missing-files-mylist', 'remove-missing-files', 'import-new-files', - 'run-import', ], }, anidb: { @@ -89,7 +88,7 @@ type Props = { const Action = ({ actionKey }: { actionKey: string }) => { const [runActionTrigger] = useRunActionMutation(); - const runAction = async (name: string, action) => { + const runAction = async (name: string, action: string) => { try { await runActionTrigger(action); toast.success(`Running action "${name}"`); @@ -100,33 +99,20 @@ const Action = ({ actionKey }: { actionKey: string }) => { } }; - const [showInfo, setShowInfo] = useState(false); - const action = useMemo(() => quickActions[actionKey], [actionKey]); - const { functionName, info, name } = action; + const { functionName, name } = action; return ( - -
+ +
{name} -
- - -
+ +
+
+ {quickActions[actionKey].info}
- -
- {/* Icon size reduces if not put in a div */} -
- -
- {info} -
-
); }; @@ -138,23 +124,28 @@ function ActionsModal({ onClose, show }: Props) { -
-
- {map(actions, (value, key) => ( -
setActiveTab(key)} - > - {value.title} -
- ))} +
+
+
Actions
+
+ {map(actions, (value, key) => ( +
setActiveTab(key)} + > + {value.title} +
+ ))} +
-
- {actions[activeTab].data.map(key => )} +
+
+ {actions[activeTab].data.map((key: string) => )} +
diff --git a/src/components/Panels/ModalPanel.tsx b/src/components/Panels/ModalPanel.tsx index b05f91a29..c985cdf6b 100644 --- a/src/components/Panels/ModalPanel.tsx +++ b/src/components/Panels/ModalPanel.tsx @@ -5,9 +5,10 @@ import cx from 'classnames'; type Props = { children: React.ReactNode; show: boolean; - title: React.ReactNode; + title?: React.ReactNode; size?: 'sm' | 'md' | 'lg'; className?: string; + noPadding?: boolean; onRequestClose?: () => void; onAfterOpen?: () => void; }; @@ -22,6 +23,7 @@ function ModalPanel(props: Props) { const { children, className, + noPadding, onAfterOpen, onRequestClose, show, @@ -44,13 +46,14 @@ function ModalPanel(props: Props) {
e.stopPropagation()} > -
{title}
+ {title &&
{title}
}
{children}
diff --git a/src/css/common.css b/src/css/common.css index d7fe29390..dcc861ed4 100644 --- a/src/css/common.css +++ b/src/css/common.css @@ -83,7 +83,7 @@ input[type='range']:focus::-moz-range-thumb { body { background-color: theme('colors.panel-background-alt'); color: theme('colors.panel-text'); - font-weight: 400; + font-weight: 350; } ::-webkit-scrollbar { diff --git a/tailwind.config.js b/tailwind.config.js index a36aaa5ab..a883d6cba 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -28,7 +28,7 @@ module.exports = { fontWeight: { extralight: 100, light: 200, - normal: 300, + normal: 350, medium: 400, semibold: 500, bold: 600,