Skip to content

Commit

Permalink
Save the selected framework under the same key both in form and store
Browse files Browse the repository at this point in the history
  • Loading branch information
fulopkovacs committed Jan 13, 2024
1 parent 5212f0d commit 34e109c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions app/routes/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand Down Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions app/routes/store.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 34e109c

Please sign in to comment.