From 3207b52a60d5dde42c39302c97ea5f94e817254a Mon Sep 17 00:00:00 2001 From: Chris Griffing Date: Fri, 25 Oct 2024 17:56:05 -0700 Subject: [PATCH 1/2] feat: get saved snippets working --- playgrounds/app/package.json | 1 + playgrounds/app/src/app.tsx | 4 +- playgrounds/app/src/components/Editor.tsx | 88 ++++++++++++++++++- .../app/src/components/SnippetPreview.tsx | 33 +++++++ playgrounds/app/src/lib/middleware.ts | 21 ++--- playgrounds/app/src/lib/utils.ts | 4 +- playgrounds/app/src/routes/api/snippets.ts | 28 +++--- .../src/routes/api/snippets/[snippetId].ts | 46 ++++++++-- playgrounds/app/src/routes/oauth.tsx | 2 - .../app/src/routes/snippets/[snippetId].tsx | 3 +- playgrounds/app/src/routes/snippets/index.tsx | 27 ++++-- pnpm-lock.yaml | 12 +++ 12 files changed, 225 insertions(+), 44 deletions(-) create mode 100644 playgrounds/app/src/components/SnippetPreview.tsx diff --git a/playgrounds/app/package.json b/playgrounds/app/package.json index 4510bf7..409d322 100644 --- a/playgrounds/app/package.json +++ b/playgrounds/app/package.json @@ -37,6 +37,7 @@ "solid-color": "^0.0.4", "solid-icons": "^1.1.0", "solid-js": "^1.9.1", + "solid-sonner": "^0.2.8", "tailwind-merge": "^2.5.3", "tailwindcss": "^3.4.3", "tailwindcss-animate": "^1.0.7", diff --git a/playgrounds/app/src/app.tsx b/playgrounds/app/src/app.tsx index 3b11c8d..0a667b6 100644 --- a/playgrounds/app/src/app.tsx +++ b/playgrounds/app/src/app.tsx @@ -1,6 +1,7 @@ +import { Suspense } from 'solid-js' import { Router } from '@solidjs/router' import { FileRoutes } from '@solidjs/start/router' -import { Suspense } from 'solid-js' +import { Toaster } from 'solid-sonner' import Header from '~/components/Header' import Footer from './components/Footer' import '@fontsource/bungee-inline' @@ -15,6 +16,7 @@ export default function App() {
{props.children}