From 98be777d9e598cb00d6529296d562b015cdba4a6 Mon Sep 17 00:00:00 2001 From: Nurfirliana Muzanella Date: Thu, 26 Sep 2024 14:32:21 +0700 Subject: [PATCH 1/5] fix modal dark mode --- .../app/(protected)/content/article/page.tsx | 14 +++-------- libs/ui-components/src/Button.tsx | 2 +- libs/ui-components/src/Modal.tsx | 25 +++++++------------ 3 files changed, 14 insertions(+), 27 deletions(-) diff --git a/apps/cms/src/app/(protected)/content/article/page.tsx b/apps/cms/src/app/(protected)/content/article/page.tsx index ae5b9aa9..99feb9a8 100644 --- a/apps/cms/src/app/(protected)/content/article/page.tsx +++ b/apps/cms/src/app/(protected)/content/article/page.tsx @@ -63,21 +63,15 @@ export default function DocumentTypeDocumentsPage() { const modalActionAudioInput = (
{/* Start button to close the audio input modal */} - + {/* End button to close the audio input modal */} {/* Start button to save changes audio input */} - + {/* End button to save changes audio input */}
); diff --git a/libs/ui-components/src/Button.tsx b/libs/ui-components/src/Button.tsx index af9004cc..0c7e990c 100644 --- a/libs/ui-components/src/Button.tsx +++ b/libs/ui-components/src/Button.tsx @@ -2,7 +2,7 @@ import clsx from "clsx"; import React, {useEffect, useState} from "react"; interface ButtonProps { - title: string; + title?: string; onClick?: () => Promise | void; style?: "normal" | "plain-text" | "rounded" | "outline" | "outline-rounded" | "icon" | "icon-rounded"; color?: "primary" | "meta-3" | "black"; diff --git a/libs/ui-components/src/Modal.tsx b/libs/ui-components/src/Modal.tsx index 7d21e880..270eff3b 100644 --- a/libs/ui-components/src/Modal.tsx +++ b/libs/ui-components/src/Modal.tsx @@ -1,4 +1,5 @@ import React from "react"; +import {Button} from "./Button"; interface ModalProps { isOpen: boolean; @@ -40,24 +41,20 @@ export function Modal({
{/* Start modal content */} -
+
{/* Start modal header */}
-

{title}

- +
{/* End modal header */} {/* Start modal body */} -
{children}
+
{children}
{/* End modal body */} {/* Modal footer */} @@ -65,13 +62,9 @@ export function Modal({ {actions ? ( actions ) : ( - + )}
From 3e450d21c9f1178bb6743804b7eae02ae76e4cc3 Mon Sep 17 00:00:00 2001 From: Nurfirliana Muzanella Date: Thu, 26 Sep 2024 15:01:20 +0700 Subject: [PATCH 2/5] fix dropdown create article dark mode --- apps/cms/src/app/(protected)/content/article/page.tsx | 6 +++--- .../src/DocumentType/DocumentTypeGenericList.tsx | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/cms/src/app/(protected)/content/article/page.tsx b/apps/cms/src/app/(protected)/content/article/page.tsx index 99feb9a8..b66e10b0 100644 --- a/apps/cms/src/app/(protected)/content/article/page.tsx +++ b/apps/cms/src/app/(protected)/content/article/page.tsx @@ -94,7 +94,7 @@ export default function DocumentTypeDocumentsPage() {
); + /** + * Modal header right. + * @constant + * @type {JSX.Element} + */ + const headerRight: JSX.Element = ( + + ); + return ( <> }> @@ -139,6 +150,7 @@ export default function DocumentTypeDocumentsPage() { disableOverlayClose={true} onClose={resetAudioInput} actions={modalActionAudioInput} + headerRight={isRecording ? headerRight : null} title={"Tell your story"} > {status === ProcessingState.Ready ? ( diff --git a/libs/ui-components/src/Modal.tsx b/libs/ui-components/src/Modal.tsx index 270eff3b..9b73b47c 100644 --- a/libs/ui-components/src/Modal.tsx +++ b/libs/ui-components/src/Modal.tsx @@ -8,6 +8,8 @@ interface ModalProps { title: string; children: React.ReactNode; actions?: React.ReactNode; + headerRight?: React.ReactNode; + headerLeft?: React.ReactNode; } /** @@ -21,6 +23,8 @@ export function Modal({ title, children, actions, + headerRight, + headerLeft, onClose, }: ModalProps): JSX.Element | null { // If the modal is not open, don't render anything @@ -44,12 +48,16 @@ export function Modal({
{/* Start modal header */}
-

{title}

+ {headerLeft ? headerLeft :

{title}

} - + {headerRight ? ( + headerRight + ) : ( + + )}
{/* End modal header */} From 5f41879f5c40c8bb8b4d7a0afbccb950a69187d8 Mon Sep 17 00:00:00 2001 From: Nurfirliana Muzanella Date: Thu, 26 Sep 2024 16:55:32 +0700 Subject: [PATCH 5/5] peakjs dark mode --- apps/cms/src/components/VoiceRecorder.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/cms/src/components/VoiceRecorder.tsx b/apps/cms/src/components/VoiceRecorder.tsx index 46af92a1..085c916d 100644 --- a/apps/cms/src/components/VoiceRecorder.tsx +++ b/apps/cms/src/components/VoiceRecorder.tsx @@ -274,7 +274,7 @@ export default function VoiceRecorder(props: VoiceRecorderProps): JSX.Element {

Your Recording:

-
+