diff --git a/apps/admin-x-settings/src/admin-x-ds/global/Breadcrumbs.tsx b/apps/admin-x-settings/src/admin-x-ds/global/Breadcrumbs.tsx index 94fa032549..9f711ffe93 100644 --- a/apps/admin-x-settings/src/admin-x-ds/global/Breadcrumbs.tsx +++ b/apps/admin-x-settings/src/admin-x-ds/global/Breadcrumbs.tsx @@ -1,5 +1,6 @@ import Button from './Button'; import React from 'react'; +import clsx from 'clsx'; export type BreadcrumbItem = { label: React.ReactNode; @@ -10,35 +11,58 @@ interface BreadcrumbsProps { items: BreadcrumbItem[]; backIcon?: boolean; onBack?: () => void; + containerClassName?: string; + itemClassName?: string; + activeItemClassName?: string; + separatorClassName?: string; } const Breadcrumbs: React.FC = ({ items, backIcon = false, - onBack + onBack, + containerClassName, + itemClassName, + activeItemClassName, + separatorClassName }) => { const allItems = items.length; let i = 0; + containerClassName = clsx( + 'flex items-center gap-2 text-sm', + containerClassName + ); + + activeItemClassName = clsx( + 'font-bold', + activeItemClassName + ); + + itemClassName = clsx( + 'text-sm', + itemClassName + ); + return ( -
+
{backIcon && - / + / ); i = i + 1; return bcItem; diff --git a/apps/admin-x-settings/src/admin-x-ds/global/form/TextField.stories.tsx b/apps/admin-x-settings/src/admin-x-ds/global/form/TextField.stories.tsx index 36f6dd28fc..7708a15498 100644 --- a/apps/admin-x-settings/src/admin-x-ds/global/form/TextField.stories.tsx +++ b/apps/admin-x-settings/src/admin-x-ds/global/form/TextField.stories.tsx @@ -30,6 +30,14 @@ export const Default: Story = { } }; +export const Disabled: Story = { + args: { + placeholder: `Here's a disabled field`, + title: 'Disabled', + disabled: true + } +}; + export const ClearBackground: Story = { args: { placeholder: 'Enter something', diff --git a/apps/admin-x-settings/src/admin-x-ds/global/form/TextField.tsx b/apps/admin-x-settings/src/admin-x-ds/global/form/TextField.tsx index 65f841d742..9af94d56dc 100644 --- a/apps/admin-x-settings/src/admin-x-ds/global/form/TextField.tsx +++ b/apps/admin-x-settings/src/admin-x-ds/global/form/TextField.tsx @@ -61,7 +61,7 @@ const TextField: React.FC = ({ clearBg ? 'bg-transparent' : 'bg-grey-75 px-[10px]', error && border ? `border-red` : `${disabled ? disabledBorderClasses : enabledBorderClasses}`, (title && !hideTitle && !clearBg) && `mt-2`, - (disabled ? 'text-grey-700' : ''), + (disabled ? 'cursor-not-allowed text-grey-700' : ''), rightPlaceholder && 'w-0 grow', className ); @@ -106,9 +106,14 @@ const TextField: React.FC = ({ hintClassName ); + containerClassName = clsx( + 'flex flex-col', + containerClassName + ); + if (title || hint) { return ( -
+
{field} {title && {title}} {hint && {hint}} diff --git a/apps/admin-x-settings/src/assets/images/footer-marketplace-bg.png b/apps/admin-x-settings/src/assets/images/footer-marketplace-bg.png new file mode 100644 index 0000000000..fafec0d024 Binary files /dev/null and b/apps/admin-x-settings/src/assets/images/footer-marketplace-bg.png differ diff --git a/apps/admin-x-settings/src/components/settings/site/DesignModal.tsx b/apps/admin-x-settings/src/components/settings/site/DesignModal.tsx index 51cd4518d1..c5a45028ab 100644 --- a/apps/admin-x-settings/src/components/settings/site/DesignModal.tsx +++ b/apps/admin-x-settings/src/components/settings/site/DesignModal.tsx @@ -15,6 +15,7 @@ import {PreviewModalContent} from '../../../admin-x-ds/global/modal/PreviewModal import {Setting, SettingValue, getSettingValues, useEditSettings} from '../../../api/settings'; import {getHomepageUrl} from '../../../api/site'; import {useBrowsePosts} from '../../../api/posts'; +import {useBrowseThemes} from '../../../api/themes'; import {useGlobalData} from '../../providers/GlobalDataProvider'; const Sidebar: React.FC<{ @@ -36,6 +37,9 @@ const Sidebar: React.FC<{ }) => { const {updateRoute} = useRouting(); const [selectedTab, setSelectedTab] = useState('brand'); + const {data: {themes} = {}} = useBrowseThemes(); + + const activeTheme = themes?.find(theme => theme.active); const tabs: Tab[] = [ { @@ -67,7 +71,10 @@ const Sidebar: React.FC<{ modal.remove(); updateRoute('design/edit/themes'); }}> - Change theme +
+
Change theme
+
Current theme: {activeTheme?.name}
+
diff --git a/apps/admin-x-settings/src/components/settings/site/ThemeModal.tsx b/apps/admin-x-settings/src/components/settings/site/ThemeModal.tsx index 067c82e81c..c156aaa128 100644 --- a/apps/admin-x-settings/src/components/settings/site/ThemeModal.tsx +++ b/apps/admin-x-settings/src/components/settings/site/ThemeModal.tsx @@ -114,26 +114,31 @@ const ThemeToolbar: React.FC = ({ const left = ; const right =
- { - setCurrentTab(id); - }} /> +
+ { + setCurrentTab(id); + }} /> +
{uploadConfig && ( uploadConfig.enabled ? @@ -176,7 +181,21 @@ const ThemeToolbar: React.FC = ({
; - return ; + return (<> + +
+ { + setCurrentTab(id); + }} /> +
+ ); }; const ThemeModalContent: React.FC = ({ @@ -272,6 +291,7 @@ const ChangeThemeModal = NiceModal.create(() => { afterClose={() => { updateRoute('design/edit'); }} + animate={false} cancelLabel='' footer={false} padding={false} @@ -307,11 +327,13 @@ const ChangeThemeModal = NiceModal.create(() => { setSelectedTheme={setSelectedTheme} themes={themes} /> - + {!selectedTheme && + + }
diff --git a/apps/admin-x-settings/src/components/settings/site/theme/AdvancedThemeSettings.tsx b/apps/admin-x-settings/src/components/settings/site/theme/AdvancedThemeSettings.tsx index 9213b8ee65..6b8530d51b 100644 --- a/apps/admin-x-settings/src/components/settings/site/theme/AdvancedThemeSettings.tsx +++ b/apps/admin-x-settings/src/components/settings/site/theme/AdvancedThemeSettings.tsx @@ -24,14 +24,14 @@ function getThemeLabel(theme: Theme): React.ReactNode { label += ' (default)'; } else if (theme.package?.name !== theme.name) { label = - <> + {label} ({theme.name}) - ; + ; } if (isActiveTheme(theme)) { label = - + {label} — Active ; } diff --git a/apps/admin-x-settings/src/components/settings/site/theme/OfficialThemes.tsx b/apps/admin-x-settings/src/components/settings/site/theme/OfficialThemes.tsx index dae5f26a60..e529a441b0 100644 --- a/apps/admin-x-settings/src/components/settings/site/theme/OfficialThemes.tsx +++ b/apps/admin-x-settings/src/components/settings/site/theme/OfficialThemes.tsx @@ -1,4 +1,5 @@ import Heading from '../../../../admin-x-ds/global/Heading'; +import MarketplaceBgImage from '../../../../assets/images/footer-marketplace-bg.png'; import ModalPage from '../../../../admin-x-ds/global/modal/ModalPage'; import React from 'react'; import {OfficialTheme, useOfficialThemes} from '../../../providers/ServiceProvider'; @@ -36,6 +37,13 @@ const OfficialThemes: React.FC<{ ); })}
+
+ Find and buy third-party, premium themes from independent developers in the Ghost Marketplace → +
); }; diff --git a/apps/admin-x-settings/src/components/settings/site/theme/ThemePreview.tsx b/apps/admin-x-settings/src/components/settings/site/theme/ThemePreview.tsx index f4df3ddd8d..6520ad6b40 100644 --- a/apps/admin-x-settings/src/components/settings/site/theme/ThemePreview.tsx +++ b/apps/admin-x-settings/src/components/settings/site/theme/ThemePreview.tsx @@ -59,11 +59,14 @@ const ThemePreview: React.FC<{ const left =