From eb85f7eb3048275de3c0ca8d78118180c2f12084 Mon Sep 17 00:00:00 2001 From: Avoo Date: Sat, 17 Jun 2023 20:04:40 +0200 Subject: [PATCH] formatting --- .../src/modules/editor/StepDescription.tsx | 2 +- .../modules/editor/StepToolbarContainer.tsx | 2 +- .../src/modules/export/AddToSetButton.tsx | 2 +- .../src/modules/export/generateTgs.ts | 6 +++- packages/frontend/src/pages/_app.tsx | 33 ++++--------------- 5 files changed, 15 insertions(+), 30 deletions(-) diff --git a/packages/frontend/src/modules/editor/StepDescription.tsx b/packages/frontend/src/modules/editor/StepDescription.tsx index 2537a6b..af34b2a 100644 --- a/packages/frontend/src/modules/editor/StepDescription.tsx +++ b/packages/frontend/src/modules/editor/StepDescription.tsx @@ -1,7 +1,7 @@ import { Well } from "@react-spectrum/well"; import { FC, PropsWithChildren } from "react"; -interface Props extends PropsWithChildren {} +type Props = PropsWithChildren; const StepDescription: FC = (props) => { return {props.children}; diff --git a/packages/frontend/src/modules/editor/StepToolbarContainer.tsx b/packages/frontend/src/modules/editor/StepToolbarContainer.tsx index ad21012..4a0daef 100644 --- a/packages/frontend/src/modules/editor/StepToolbarContainer.tsx +++ b/packages/frontend/src/modules/editor/StepToolbarContainer.tsx @@ -1,7 +1,7 @@ import { View } from "@adobe/react-spectrum"; import { FC, PropsWithChildren } from "react"; -interface Props extends PropsWithChildren {} +type Props = PropsWithChildren; const StepToolbarContainer: FC = (props) => { return ( diff --git a/packages/frontend/src/modules/export/AddToSetButton.tsx b/packages/frontend/src/modules/export/AddToSetButton.tsx index 27ac646..43aac1f 100644 --- a/packages/frontend/src/modules/export/AddToSetButton.tsx +++ b/packages/frontend/src/modules/export/AddToSetButton.tsx @@ -51,7 +51,7 @@ const AddToSetButton: FC = (props) => { action: props.action, }); if (props.action === "save" || props.action === "saveAndAdd") { - router.push(router.asPath.replace(/step\/\d/, "step/4")); + router.push(router.asPath.replace(/step\/\d/, "step/4")); } console.log("response", response); } catch (error: any) { diff --git a/packages/frontend/src/modules/export/generateTgs.ts b/packages/frontend/src/modules/export/generateTgs.ts index ec796ce..1261e32 100644 --- a/packages/frontend/src/modules/export/generateTgs.ts +++ b/packages/frontend/src/modules/export/generateTgs.ts @@ -11,5 +11,9 @@ export const generateTgs = async (props: Props) => { console.log("size in KiB", blob.size / (1 << 10)); - download(blob, `${props.lottie.name || "sticker"}.tgs`, "application/octet-stream"); + download( + blob, + `${props.lottie.name || "sticker"}.tgs`, + "application/octet-stream", + ); }; diff --git a/packages/frontend/src/pages/_app.tsx b/packages/frontend/src/pages/_app.tsx index d200c24..04a438c 100644 --- a/packages/frontend/src/pages/_app.tsx +++ b/packages/frontend/src/pages/_app.tsx @@ -1,3 +1,4 @@ +import MainLayout from "@/layouts/MainLayout"; import { useUpdateAuthData } from "@/modules/export/auth"; import { themeAtom } from "@/modules/misc/theme"; import ThemeProvider from "@/modules/misc/ThemeProvider"; @@ -19,6 +20,11 @@ export default function MyApp({ Component, pageProps }: AppProps) { const { updateAuthData } = useUpdateAuthData(); const router = useRouter(); + // Use the layout defined at the page level, if available + const getLayout = + (Component as any).getLayout || + ((page: any) => {page}); + useEffect(() => { if (!router.query.hash) return; const data = JSON.stringify( @@ -49,32 +55,7 @@ export default function MyApp({ Component, pageProps }: AppProps) { - - - - sauce - {" "} - •{" "} - - code license - {" "} - •{" "} - - template license - - + {getLayout()}