Fixed: fixed bug scrcpy and shell is disconnect when switch page

This commit is contained in:
Kenta420 2024-02-19 14:24:05 +07:00
parent 9543d4541c
commit 0fe469b5c6
43 changed files with 1378 additions and 1366 deletions

View file

@ -0,0 +1,25 @@
import { Button } from '@/components/ui/button'
import useLocalStorage from '@/hooks/localStorage'
import { Link } from 'react-router-dom'
import { useShallow } from 'zustand/react/shallow'
const SelectCountryPage: React.FC = () => {
const { recipeQuery, setRecipeQuery } = useLocalStorage(
useShallow(state => ({
recipeQuery: state.recipeQuery,
setRecipeQuery: state.setRecipeQuery
}))
)
return (
<div>
<h1>SelectContryPage</h1>
<Button variant={'link'} onClick={() => setRecipeQuery({ countryID: 'tha', filename: 'coffeethai02_635.json' })}>
Thai
</Button>
{recipeQuery && <Link to={`/recipes/${recipeQuery?.countryID}/${recipeQuery?.filename}`}>Recipes</Link>}
</div>
)
}
export default SelectCountryPage