From 34e109c48d2132afd7fc4c0af68a27f2b549425c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=BCl=C3=B6p=20Kov=C3=A1cs?= Date: Sat, 13 Jan 2024 15:00:05 +0100 Subject: [PATCH] Save the selected framework under the same key both in form and store --- app/routes/form.tsx | 4 +--- app/routes/store.tsx | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app/routes/form.tsx b/app/routes/form.tsx index e8e1a134..8fc201bc 100644 --- a/app/routes/form.tsx +++ b/app/routes/form.tsx @@ -19,8 +19,6 @@ import { FaDiscord, FaGithub } from 'react-icons/fa' import type { AvailableOptions } from '~/components/Select' import { Scarf } from '~/components/Scarf' -const formLocalStorageKey = 'framework-form' - export type FrameworkMenu = { framework: string menuItems: MenuItem[] @@ -120,7 +118,7 @@ export const useReactFormDocsConfig = () => { const version = params.version! const framework = - params.framework || localStorage.getItem(formLocalStorageKey) || 'react' + params.framework || localStorage.getItem('framework') || 'react' const navigate = useNavigate() const config = useMatchesData(`/form/${version}`) as GithubDocsConfig diff --git a/app/routes/store.tsx b/app/routes/store.tsx index eb35072d..9c038623 100644 --- a/app/routes/store.tsx +++ b/app/routes/store.tsx @@ -18,8 +18,6 @@ import angularLogo from '~/images/angular-logo.svg' import { FaDiscord, FaGithub } from 'react-icons/fa' import type { AvailableOptions } from '~/components/Select' -const storeLocalStorageKey = 'framework-store' - export type FrameworkMenu = { framework: string menuItems: MenuItem[] @@ -118,7 +116,7 @@ export const useReactStoreDocsConfig = () => { const params = useParams() const version = params.version! const framework = - params.framework || localStorage.getItem(storeLocalStorageKey) || 'react' + params.framework || localStorage.getItem('framework') || 'react' const navigate = useNavigate() const config = useMatchesData(`/store/${version}`) as GithubDocsConfig