Skip to content

Commit

Permalink
feat: use react document metadata instead of react-helmet-async
Browse files Browse the repository at this point in the history
  • Loading branch information
Pkcarreno committed Dec 29, 2024
1 parent 5e7226a commit 6c2c3fc
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 60 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
"quickjs-emscripten-sync": "^1.5.2",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-helmet-async": "^2.0.5",
"react-hook-form": "^7.54.1",
"react-hotkeys-hook": "^4.6.1",
"react-resizable-panels": "^2.1.7",
Expand Down
40 changes: 0 additions & 40 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 6 additions & 10 deletions src/app.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
import { HelmetProvider } from 'react-helmet-async';

import { Toaster } from '@/components/ui/sonner';
import { ThemeProvider } from '@/providers/theme-provider';
import Router from '@/routes';

import { PromptProvider } from './providers/prompt-provider';

const App = () => (
<HelmetProvider>
<ThemeProvider storageKey="theme">
<PromptProvider>
<Router />
</PromptProvider>
<Toaster />
</ThemeProvider>
</HelmetProvider>
<ThemeProvider storageKey="theme">
<PromptProvider>
<Router />
</PromptProvider>
<Toaster />
</ThemeProvider>
);

export default App;
6 changes: 1 addition & 5 deletions src/features/editor/providers/meta-provider.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Helmet } from 'react-helmet-async';

import { useCodeStore } from '../stores/editor';

interface Props {
Expand All @@ -11,9 +9,7 @@ export const MetatagsProvider: React.FC<Props> = ({ children }) => {

return (
<>
<Helmet>
<title>JSoD - {title ? title : 'Script'}</title>
</Helmet>
<title>{`JSoD - ${title ? title : 'Script'}`}</title>
{children}
</>
);
Expand Down
5 changes: 1 addition & 4 deletions src/features/not-found/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import { Helmet } from 'react-helmet-async';
import { Link } from 'wouter';

import { Button } from '@/components/ui/button';

export default function NotFound() {
return (
<>
<Helmet>
<title>JSoD - Not Found</title>
</Helmet>
<title>JSoD - Not Found</title>
<div className="flex h-screen w-screen flex-col items-center justify-center gap-4 px-2 py-3">
<h2 className="text-2xl font-semibold">
Are you searching for a JS editor?
Expand Down

0 comments on commit 6c2c3fc

Please sign in to comment.