diff --git a/src/components/study-queue/StudyQueueModal.tsx b/src/components/study-queue/StudyQueueModal.tsx index e554184..ef3e8f4 100644 --- a/src/components/study-queue/StudyQueueModal.tsx +++ b/src/components/study-queue/StudyQueueModal.tsx @@ -3,7 +3,7 @@ // Full details: https://github.com/Lemmmy/KanjiSchool/blob/master/LICENSE import { useCallback, useMemo, useState } from "react"; -import { Modal, Tooltip, Checkbox } from "antd"; +import { Tooltip, Checkbox } from "antd"; import { CheckboxChangeEvent } from "antd/es/checkbox"; import { CloseOutlined, DownOutlined, QuestionCircleOutlined, UpOutlined } from "@ant-design/icons"; import classNames from "classnames"; @@ -49,82 +49,64 @@ export function StudyQueueModal(): JSX.Element | null { if (!hasAssignments) return null; const classes = classNames( - "mt-auto mr-lg mb-lg ml-auto pb-0 absolute top-[unset] left-[unset] right-0 bottom-0 pointer-events-auto", - - // Center the close buttons a little better - "[&_.ant-modal-close]:top-[20px]", - - "[&_.ant-modal-body]:h-full [&_.ant-modal-body]:max-h-study-modal", - "[&_.ant-modal-body]:p-0 [&_.ant-modal-body]:overflow-y-hidden", - "[&_.ant-modal-body]:transition-[max-height,margin-bottom]", - - "[&_.ant-modal-footer]:h-full [&_.ant-modal-footer]:max-h-study-modal [&_.ant-modal-footer]:overflow-y-hidden", - "[&_.ant-modal-footer]:transition-[max-height,margin-top]", - "[&_.ant-modal-footer]:items-center [&_.ant-modal-footer]:text-left", - - { - // Collapsed state - "[&_.ant-modal-header]:!mb-0": collapsed, - "[&_.ant-modal-body]:!max-h-0": collapsed, - "[&_.ant-modal-footer]:!max-h-0 [&_.ant-modal-footer]:!mt-0": collapsed, - } + "mt-auto mr-lg mb-lg ml-auto absolute top-[unset] left-[unset] right-0 bottom-0 pointer-events-auto", + "w-[420px] bg-[#1f1f1f] light:bg-container px-lg py-[20px] rounded-xl shadow-xl" ); - return <> - + {/* Inner dialog */} +
+ {/* Header */} + } - - // Don't show the close icon, it's rendered in the title instead - closable={false} - closeIcon={null} - - open={(items?.length || 0) > 0} - mask={false} - maskClosable={false} - - // Footer - footer={} - > - {/* Subjects */} -
setInnerContainerRef(r)} - > - + /> + + {/* Collapsible portion */} +
+ {/* Subjects */} +
setInnerContainerRef(r)} + > + +
+ + {/* Footer */} +
- +
- ; +
; } interface ModalHeaderProps { @@ -141,39 +123,44 @@ function ModalHeader({ ? "Show self-study-queue" : "Hide self-study-queue"; - return <> - + const buttonClasses = classNames( + "flex items-center justify-center w-[32px] h-[32px] rounded text-desc text-lg leading-none cursor-pointer", + "border-0 outline-none bg-transparent hover:bg-white/10 light:hover:bg-black/10 transition-colors" + ); + + return
+ Self-study queue ({pluralN(count, "subject")}) - {/* Collapse button */} - {collapseTitle} (Shift+Q)}> - - - - {/* Fake close button */} - - - - ; + + + + {/* Fake close button */} + + + +
+ ; } interface FooterProps { @@ -194,7 +181,7 @@ function ModalFooter({ items }: FooterProps): JSX.Element { gotoSession(navigate, startSession("self_study", items, withLessons, opts)); }, [navigate, items, withLessons]); - return
+ return
{/* "With lessons" checkbox */} = { "radical": GridItemRadical, diff --git a/src/global/InnerAppServices.tsx b/src/global/InnerAppServices.tsx index 43b772b..3709c89 100644 --- a/src/global/InnerAppServices.tsx +++ b/src/global/InnerAppServices.tsx @@ -5,7 +5,6 @@ import { SyncHandlers } from "./sync"; import { LastResultsSave } from "./LastResultsSave"; import { HotkeyServices } from "./hotkeys"; -import { StudyQueueModal } from "@comp/study-queue/StudyQueueModal"; import { AdvanceTip } from "@pages/dashboard/tips/TipsCard"; export function InnerAppServices(): JSX.Element { @@ -13,7 +12,6 @@ export function InnerAppServices(): JSX.Element { - ; } diff --git a/src/layout/AppLayout.tsx b/src/layout/AppLayout.tsx index ff96d80..ec2148a 100644 --- a/src/layout/AppLayout.tsx +++ b/src/layout/AppLayout.tsx @@ -5,11 +5,13 @@ import React from "react"; import { Layout } from "antd"; +import { Outlet } from "react-router-dom"; + import { AppHeader } from "./nav/AppHeader"; import { TopMenuProvider } from "./nav/TopMenu"; import { KeywordSearchProvider } from "@api/search/KeywordSearch"; import { ScrollToAnchor } from "@utils/hooks/useScrollToAnchor"; -import { Outlet } from "react-router-dom"; +import { StudyQueueModal } from "@comp/study-queue/StudyQueueModal.tsx"; export function AppLayout(): JSX.Element { return @@ -25,6 +27,8 @@ export function AppLayout(): JSX.Element {
+ + ; diff --git a/tailwind.config.js b/tailwind.config.js index 3a04500..58c5a68 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -39,7 +39,8 @@ const generateConfig = () => ({ "header" : "64px", "toc" : "180px", "toc-right" : "-204px", // -toc - lg - "study-modal" : "182px", // 150px + md * 2 + "study-modal" : "150px", + "study-modal-outer" : "206px", "text" : "0.3em", "preset-editor-height" : "400px", "preset-editor-sidebar": "260px",