From 5f806ecdc13cf71749b712335aa4059985d27cef Mon Sep 17 00:00:00 2001 From: Foysal Ahamed Date: Mon, 5 Feb 2024 17:30:49 +0100 Subject: [PATCH] :sparkles: Add theme switcher and dark mode to all places --- app/actions/ModActionPanel/QuickAction.tsx | 7 +- app/communication-template/create/page.tsx | 2 +- app/communication-template/page.tsx | 12 ++-- app/events/page-content.tsx | 2 +- app/layout.tsx | 8 ++- app/reports/page-content.tsx | 2 +- components/SectionHeader.tsx | 6 +- components/common/ActionPanel.tsx | 2 +- components/common/DataField.tsx | 4 +- components/common/Dropdown.tsx | 6 +- components/common/FullScreenActionPanel.tsx | 10 +-- components/common/Json.tsx | 4 +- components/common/LoadMoreButton.tsx | 2 +- components/common/PreviewCard.tsx | 2 +- components/common/RecordCard.tsx | 10 +-- components/common/RichText.tsx | 2 +- components/common/buttons.tsx | 14 ++-- components/common/feeds/EmptyFeed.tsx | 18 ++++- components/common/forms/index.tsx | 14 ++-- components/common/posts/Posts.tsx | 4 +- components/common/posts/PostsFeed.tsx | 34 +++++----- components/common/posts/PostsTable.tsx | 26 +++---- components/common/useColorScheme.tsx | 35 ++++++++++ components/invites/InviteCodesTable.tsx | 38 +++++------ components/mod-event/EventItem.tsx | 12 ++-- components/mod-event/EventList.tsx | 36 ++++++---- components/mod-event/ItemTitle.tsx | 2 +- components/mod-event/SelectorButton.tsx | 2 +- components/mod-event/View.tsx | 18 ++--- components/reports/SubjectOverview.tsx | 4 +- components/repositories/AccountView.tsx | 67 +++++++++++-------- components/repositories/BlobsTable.tsx | 16 ++--- .../InviteCodeGenerationStatus.tsx | 12 ++-- components/repositories/RecordView.tsx | 14 ++-- components/repositories/RepositoriesTable.tsx | 20 +++--- components/shell/CommandPalette/Root.tsx | 4 +- components/shell/LoginModal.tsx | 22 +++--- components/shell/ProfileMenu.tsx | 10 +-- components/shell/Shell.tsx | 12 ++-- components/shell/SidebarNav.tsx | 33 ++++----- components/shell/common.ts | 12 +++- components/subject/ReviewStateMarker.tsx | 16 ++--- components/subject/table.tsx | 34 +++++----- tailwind.config.js | 1 + 44 files changed, 349 insertions(+), 262 deletions(-) create mode 100644 components/common/useColorScheme.tsx diff --git a/app/actions/ModActionPanel/QuickAction.tsx b/app/actions/ModActionPanel/QuickAction.tsx index 053bec2e..23eb5f77 100644 --- a/app/actions/ModActionPanel/QuickAction.tsx +++ b/app/actions/ModActionPanel/QuickAction.tsx @@ -1,7 +1,6 @@ // TODO: This is badly named so that we can rebuild this component without breaking the old one import { useQuery } from '@tanstack/react-query' import { - AtUri, ComAtprotoAdminDefs, ComAtprotoAdminEmitModerationEvent, ComAtprotoModerationDefs, @@ -84,7 +83,7 @@ export function ModActionPanelQuick( return ( + Take moderation action {isMobileView && ( -
+
{title && (
{typeof title !== 'string' && title} diff --git a/components/common/DataField.tsx b/components/common/DataField.tsx index ba4d2846..d441c038 100644 --- a/components/common/DataField.tsx +++ b/components/common/DataField.tsx @@ -18,12 +18,12 @@ export const DataField = ({ shouldTruncateValue, }: DataFieldProps) => { const dataClasses = classNames( - 'mt-1 text-sm text-gray-900', + 'mt-1 text-sm text-gray-900 dark:text-gray-200', shouldTruncateValue ? 'truncate' : 'break-words', ) return (
-
+
{label} {showCopyButton && value && ( {items.map((item) => ( @@ -51,8 +51,8 @@ export const Dropdown = ({ diff --git a/components/common/FullScreenActionPanel.tsx b/components/common/FullScreenActionPanel.tsx index 9f744b27..e7051fb1 100644 --- a/components/common/FullScreenActionPanel.tsx +++ b/components/common/FullScreenActionPanel.tsx @@ -37,29 +37,29 @@ export function FullScreenActionPanel(props: { leaveFrom="opacity-100 scale-100" leaveTo="opacity-0 scale-95" > - +
-
+
{title && (
{typeof title !== 'string' && title} {typeof title === 'string' && ( - + {title} )}
)} -
+
{children}
diff --git a/components/common/Json.tsx b/components/common/Json.tsx index 259625d6..4525ae6b 100644 --- a/components/common/Json.tsx +++ b/components/common/Json.tsx @@ -18,7 +18,7 @@ export function Json({
{open ? ( -
+
{JSON.stringify(value, null, 2)}
) : undefined} diff --git a/components/common/LoadMoreButton.tsx b/components/common/LoadMoreButton.tsx index d15b18ce..46ae4f04 100644 --- a/components/common/LoadMoreButton.tsx +++ b/components/common/LoadMoreButton.tsx @@ -5,7 +5,7 @@ export function LoadMoreButton(props: ButtonHTMLAttributes) { return (