From e85f5d11931976888940b9f955541cb4405b2d71 Mon Sep 17 00:00:00 2001 From: Tom Lienard Date: Sat, 30 Dec 2023 16:48:12 +0100 Subject: [PATCH] feat: update splash (#30) * feat: update splash * fix: update header gap * fix: remove backdrop blur --- apps/dashboard/src/components/CustomLink.tsx | 7 ++++--- .../src/components/LeftPanel/ExportSection.tsx | 12 +++++++++--- apps/dashboard/src/components/Splash/index.tsx | 16 +++++++++++++--- apps/dashboard/src/components/forms/Button.tsx | 4 ++-- .../src/components/icons/GitHubIcon.tsx | 7 +++++++ 5 files changed, 35 insertions(+), 11 deletions(-) create mode 100644 apps/dashboard/src/components/icons/GitHubIcon.tsx diff --git a/apps/dashboard/src/components/CustomLink.tsx b/apps/dashboard/src/components/CustomLink.tsx index 817c6ff..0ae97fd 100644 --- a/apps/dashboard/src/components/CustomLink.tsx +++ b/apps/dashboard/src/components/CustomLink.tsx @@ -1,16 +1,17 @@ import Link from "next/link" -import type { ReactNode } from "react" +import type { ComponentProps, ReactNode } from "react" interface CustomLinkProps { icon?: ReactNode iconPosition?: 'left' | 'right' href: string + target?: ComponentProps['target'] children: ReactNode } -export function CustomLink({ icon, iconPosition = 'left', href, children }: CustomLinkProps) { +export function CustomLink({ icon, iconPosition = 'left', href, target, children }: CustomLinkProps) { return ( - + {icon && iconPosition === 'left' ? icon : null} {children} {icon && iconPosition === 'right' ? icon : null} diff --git a/apps/dashboard/src/components/LeftPanel/ExportSection.tsx b/apps/dashboard/src/components/LeftPanel/ExportSection.tsx index d90173a..5013ea5 100644 --- a/apps/dashboard/src/components/LeftPanel/ExportSection.tsx +++ b/apps/dashboard/src/components/LeftPanel/ExportSection.tsx @@ -16,7 +16,12 @@ export function ExportSection() { const setSelectedElementId = useElementsStore(state => state.setSelectedElementId) const [isLoading, setIsLoading] = useState(false) + function exportUrl() { + toast.error('Not implemented yet!') + } + async function exportSvg(showProgress = true) { + // Immediately deselect any selected element to remove the outline flushSync(() => { setSelectedElementId(null) }) @@ -94,9 +99,10 @@ export function ExportSection() { return ( <>

Export

-
- - +
+ + +
) diff --git a/apps/dashboard/src/components/Splash/index.tsx b/apps/dashboard/src/components/Splash/index.tsx index 0086e2b..ae48e1c 100644 --- a/apps/dashboard/src/components/Splash/index.tsx +++ b/apps/dashboard/src/components/Splash/index.tsx @@ -3,6 +3,7 @@ import type { ReactNode } from "react"; import { useSearchParams } from "next/navigation"; import { OgEditor } from "../OgEditor"; import { CustomLink } from "../CustomLink"; +import { GitHubIcon } from "../icons/GitHubIcon"; interface OgSplashProps { children: ReactNode @@ -16,14 +17,23 @@ export function Splash({ children }: OgSplashProps) { <> {image ? null : ( -
-
+
+
-

OG Studio

+
+

OG Studio

+ + Early preview + + } target="_blank"> + GitHub + +
} iconPosition="right"> Guest
+

Create static or dynamic Open Graph images with an intuitive, Figma-like visual editor. Browse ready-to-use templates, and export your images to SVG/PNG or to a dynamic URL.

{children}
diff --git a/apps/dashboard/src/components/forms/Button.tsx b/apps/dashboard/src/components/forms/Button.tsx index 511ab29..a686719 100644 --- a/apps/dashboard/src/components/forms/Button.tsx +++ b/apps/dashboard/src/components/forms/Button.tsx @@ -2,7 +2,7 @@ import type { ReactNode } from "react" interface ButtonProps { icon?: ReactNode - variant?: 'danger' + variant?: 'danger' | 'success' onClick: () => void isLoading?: boolean className?: string @@ -11,7 +11,7 @@ interface ButtonProps { export function Button({ icon, variant, onClick, isLoading, className, children }: ButtonProps) { return ( - diff --git a/apps/dashboard/src/components/icons/GitHubIcon.tsx b/apps/dashboard/src/components/icons/GitHubIcon.tsx new file mode 100644 index 0000000..22f3e59 --- /dev/null +++ b/apps/dashboard/src/components/icons/GitHubIcon.tsx @@ -0,0 +1,7 @@ +import type { SVGProps } from "react"; + +export function GitHubIcon(props: SVGProps) { + return ( + + ) +}