-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d048fd0
commit 77229eb
Showing
21 changed files
with
183 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,6 @@ | |
"nestjs", | ||
"nest.js", | ||
"nest", | ||
"graphql", | ||
"drizzle", | ||
"typescript", | ||
"appollo", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletions
6
packages/frontend/src/views/admin/views/core/settings/email/email-settings-admin-view.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
packages/frontend/src/views/admin/views/core/styles/theme-editor/content.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
'use client'; | ||
|
||
import { SidebarTrigger } from '@/components/ui/sidebar'; | ||
import { SidebarInset } from '@/components/ui/sidebar-server'; | ||
import { cn } from '@/helpers/classnames'; | ||
import { CONFIG } from '@/helpers/config-with-env'; | ||
import React from 'react'; | ||
|
||
import { SidebarThemeEditorStyleAdmin } from './sidebar'; | ||
|
||
export enum ThemeEditorViewEnum { | ||
Desktop = 'desktop', | ||
Mobile = 'mobile', | ||
Tablet = 'tablet', | ||
} | ||
|
||
export const ContentThemeEditorStyleAdmin = () => { | ||
const [activeMode, setActiveMode] = React.useState<ThemeEditorViewEnum>( | ||
ThemeEditorViewEnum.Desktop, | ||
); | ||
|
||
return ( | ||
<> | ||
<div className="fixed right-0 top-0 z-20 flex h-12 items-center gap-2 px-4"> | ||
<SidebarTrigger /> | ||
</div> | ||
<SidebarInset className="flex min-h-full items-center justify-center"> | ||
<iframe | ||
className={cn('bg-card rounded-lg border shadow-md transition-all', { | ||
'h-full w-full': activeMode === ThemeEditorViewEnum.Desktop, | ||
'h-5/6 w-[768px] rounded-md border': | ||
activeMode === ThemeEditorViewEnum.Tablet, | ||
'h-5/6 w-[375px] rounded-md border': | ||
activeMode === ThemeEditorViewEnum.Mobile, | ||
})} | ||
src={CONFIG.frontend_url} | ||
title={CONFIG.frontend_url} | ||
/> | ||
</SidebarInset> | ||
|
||
<SidebarThemeEditorStyleAdmin | ||
activeMode={activeMode} | ||
setActiveMode={setActiveMode} | ||
/> | ||
</> | ||
); | ||
}; |
81 changes: 81 additions & 0 deletions
81
packages/frontend/src/views/admin/views/core/styles/theme-editor/sidebar.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
'use client'; | ||
|
||
import { Button } from '@/components/ui/button'; | ||
import { Sidebar } from '@/components/ui/sidebar'; | ||
import { TooltipWrapper } from '@/components/ui/tooltip'; | ||
import { MonitorIcon, SmartphoneIcon, TabletIcon } from 'lucide-react'; | ||
import { useTranslations } from 'next-intl'; | ||
|
||
import { ThemeEditorViewEnum } from './content'; | ||
|
||
export const SidebarThemeEditorStyleAdmin = ({ | ||
setActiveMode, | ||
activeMode, | ||
}: { | ||
activeMode: ThemeEditorViewEnum; | ||
setActiveMode: React.Dispatch<React.SetStateAction<ThemeEditorViewEnum>>; | ||
}) => { | ||
const t = useTranslations('admin.core.styles.theme-editor'); | ||
|
||
const ButtonWithTooltip = ({ | ||
active, | ||
ariaLabel, | ||
children, | ||
onClick, | ||
}: { | ||
active?: boolean; | ||
ariaLabel: string; | ||
children: React.ReactNode; | ||
onClick: () => void; | ||
}) => { | ||
return ( | ||
<TooltipWrapper content={ariaLabel}> | ||
<Button | ||
ariaLabel={ariaLabel} | ||
className="relative size-9 shrink-0" | ||
onClick={onClick} | ||
size="icon" | ||
variant={active ? 'default' : 'ghost'} | ||
> | ||
{children} | ||
</Button> | ||
</TooltipWrapper> | ||
); | ||
}; | ||
|
||
return ( | ||
<Sidebar className="h-auto" side="right"> | ||
<div className="flex gap-1 p-2"> | ||
<ButtonWithTooltip | ||
active={activeMode === ThemeEditorViewEnum.Desktop} | ||
ariaLabel={t(ThemeEditorViewEnum.Desktop)} | ||
onClick={() => { | ||
setActiveMode(ThemeEditorViewEnum.Desktop); | ||
}} | ||
> | ||
<MonitorIcon /> | ||
</ButtonWithTooltip> | ||
|
||
<ButtonWithTooltip | ||
active={activeMode === ThemeEditorViewEnum.Tablet} | ||
ariaLabel={t(ThemeEditorViewEnum.Tablet)} | ||
onClick={() => { | ||
setActiveMode(ThemeEditorViewEnum.Tablet); | ||
}} | ||
> | ||
<TabletIcon /> | ||
</ButtonWithTooltip> | ||
|
||
<ButtonWithTooltip | ||
active={activeMode === ThemeEditorViewEnum.Mobile} | ||
ariaLabel={t(ThemeEditorViewEnum.Mobile)} | ||
onClick={() => { | ||
setActiveMode(ThemeEditorViewEnum.Mobile); | ||
}} | ||
> | ||
<SmartphoneIcon /> | ||
</ButtonWithTooltip> | ||
</div> | ||
</Sidebar> | ||
); | ||
}; |
15 changes: 15 additions & 0 deletions
15
packages/frontend/src/views/admin/views/core/styles/theme-editor/theme-editor-admin-view.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { TranslationsProvider } from '@/components/translations-provider'; | ||
import { SidebarProvider } from '@/components/ui/sidebar'; | ||
import React from 'react'; | ||
|
||
import { ContentThemeEditorStyleAdmin } from './content'; | ||
|
||
export const ThemeEditorStyleAdminView = () => { | ||
return ( | ||
<TranslationsProvider namespaces="admin.core.styles.theme-editor"> | ||
<SidebarProvider className="min-h-full"> | ||
<ContentThemeEditorStyleAdmin /> | ||
</SidebarProvider> | ||
</TranslationsProvider> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.