Skip to content

Commit

Permalink
settings dropdown: hide pwa button if in pwa
Browse files Browse the repository at this point in the history
  • Loading branch information
sehyunc committed Oct 2, 2024
1 parent 0e1338e commit fd4b406
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/trade/[base]/components/settings-dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,15 @@ import {
TooltipTrigger,
} from "@/components/ui/tooltip"

import { useMediaQuery } from "@/hooks/use-media-query"
import { STORAGE_REMEMBER_ME } from "@/lib/constants/storage"
import { cn } from "@/lib/utils"

export function SettingsDropdown({ children }: { children: React.ReactNode }) {
const config = useConfig()
const status = useStatus()
const walletId = useWalletId()
const isPWA = useMediaQuery("(display-mode: standalone)")
const handleRefreshWallet = async () => {
if (status === "in relayer") {
await refreshWallet(config)
Expand Down Expand Up @@ -74,7 +77,7 @@ export function SettingsDropdown({ children }: { children: React.ReactNode }) {
<DropdownMenuSeparator />
<DialogTrigger
asChild
className="lg:hidden"
className={cn("lg:hidden", isPWA && "hidden")}
>
<DropdownMenuItem>Install Mobile App</DropdownMenuItem>
</DialogTrigger>
Expand Down

0 comments on commit fd4b406

Please sign in to comment.