From d2d68599196524aa0ae940f2a9f67e3fb03d9392 Mon Sep 17 00:00:00 2001 From: an-lee Date: Sat, 7 Dec 2024 13:44:24 +0800 Subject: [PATCH] refactor UI --- .../src/renderer/components/layouts/layout.tsx | 5 ++++- .../components/medias/media-loading-modal.tsx | 3 --- ...ronunciation-assessment-fulltext-result.tsx | 6 ++++-- .../pronunciation-assessment-word-result.tsx | 2 +- .../components/recordings/recording-detail.tsx | 3 ++- .../renderer/components/ui/alert-dialog.tsx | 14 +++++++++----- enjoy/src/renderer/components/ui/dialog.tsx | 14 +++++++++----- enjoy/src/renderer/components/ui/sheet.tsx | 18 ++++++++++++++---- 8 files changed, 43 insertions(+), 22 deletions(-) diff --git a/enjoy/src/renderer/components/layouts/layout.tsx b/enjoy/src/renderer/components/layouts/layout.tsx index 9d624542..b223763c 100644 --- a/enjoy/src/renderer/components/layouts/layout.tsx +++ b/enjoy/src/renderer/components/layouts/layout.tsx @@ -27,7 +27,10 @@ export const Layout = () => {
-
+
diff --git a/enjoy/src/renderer/components/medias/media-loading-modal.tsx b/enjoy/src/renderer/components/medias/media-loading-modal.tsx index b3a972d3..0bf454dd 100644 --- a/enjoy/src/renderer/components/medias/media-loading-modal.tsx +++ b/enjoy/src/renderer/components/medias/media-loading-modal.tsx @@ -7,7 +7,6 @@ import { AlertDialogTitle, AlertDialogContent, AlertDialogFooter, - AlertDialogOverlay, Button, Tabs, TabsContent, @@ -16,7 +15,6 @@ import { } from "@renderer/components/ui"; import { CircleAlertIcon, LoaderIcon } from "lucide-react"; import { t } from "i18next"; -import { useNavigate } from "react-router-dom"; import { TranscriptionCreateForm, TranscriptionsList } from "../transcriptions"; import { SttEngineOptionEnum } from "@/types/enums"; @@ -25,7 +23,6 @@ export const MediaLoadingModal = () => { return ( - {t("preparingAudio")} diff --git a/enjoy/src/renderer/components/pronunciation-assessments/pronunciation-assessment-fulltext-result.tsx b/enjoy/src/renderer/components/pronunciation-assessments/pronunciation-assessment-fulltext-result.tsx index 857963b1..aaa4bbed 100644 --- a/enjoy/src/renderer/components/pronunciation-assessments/pronunciation-assessment-fulltext-result.tsx +++ b/enjoy/src/renderer/components/pronunciation-assessments/pronunciation-assessment-fulltext-result.tsx @@ -3,14 +3,16 @@ import { useState, useEffect } from "react"; import { PronunciationAssessmentWordResult } from "@renderer/components"; import { Switch, ScrollArea } from "@renderer/components/ui"; import { InfoIcon } from "lucide-react"; +import { cn } from "@renderer/lib/utils"; export const PronunciationAssessmentFulltextResult = (props: { words: PronunciationAssessmentWordResultType[]; currentTime?: number; src?: string; onPlayOrigin?: (word: string, index: number) => void; + className?: string; }) => { - const { words, currentTime, src, onPlayOrigin } = props; + const { words, currentTime, src, onPlayOrigin, className } = props; const [errorStats, setErrorStats] = useState({ mispronunciation: 0, omission: 0, @@ -56,7 +58,7 @@ export const PronunciationAssessmentFulltextResult = (props: { }, []); return ( - +
{words.map((result, index: number) => ( diff --git a/enjoy/src/renderer/components/pronunciation-assessments/pronunciation-assessment-word-result.tsx b/enjoy/src/renderer/components/pronunciation-assessments/pronunciation-assessment-word-result.tsx index 905726c1..1ebc8754 100644 --- a/enjoy/src/renderer/components/pronunciation-assessments/pronunciation-assessment-word-result.tsx +++ b/enjoy/src/renderer/components/pronunciation-assessments/pronunciation-assessment-word-result.tsx @@ -140,7 +140,7 @@ export const PronunciationAssessmentWordResult = (props: {
- +
{t("score")}: diff --git a/enjoy/src/renderer/components/recordings/recording-detail.tsx b/enjoy/src/renderer/components/recordings/recording-detail.tsx index 84bf54cf..6c581a68 100644 --- a/enjoy/src/renderer/components/recordings/recording-detail.tsx +++ b/enjoy/src/renderer/components/recordings/recording-detail.tsx @@ -62,7 +62,7 @@ export const RecordingDetail = (props: { return (
-
+
, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - - + React.ComponentPropsWithoutRef & { + container?: HTMLElement; + } +>(({ className, container, ...props }, ref) => ( + + , - React.ComponentPropsWithoutRef ->(({ className, children, ...props }, ref) => ( - + React.ComponentPropsWithoutRef & { + container?: HTMLElement; + } +>(({ className, children, container, ...props }, ref) => ( + , VariantProps { displayClose?: boolean; + container?: HTMLElement; } const SheetContent = React.forwardRef< @@ -60,14 +61,23 @@ const SheetContent = React.forwardRef< SheetContentProps >( ( - { side = "right", displayClose = true, className, children, ...props }, + { + side = "right", + displayClose = true, + className, + children, + container, + ...props + }, ref ) => ( - - + + {children}