-
-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert Tooltip to Popover for Mobile
- Loading branch information
1 parent
18e988d
commit 26e59a6
Showing
8 changed files
with
85 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
import { Trans } from "@lingui/macro"; | ||
import * as Tooltip from "@radix-ui/react-tooltip"; | ||
import * as Popover from "@radix-ui/react-popover"; | ||
import { Translate } from "phosphor-react"; | ||
|
||
import { IconOutlineButton, tooltipContentProps } from "../ui/Shared"; | ||
import { IconButton2, popoverContentProps } from "../ui/Shared"; | ||
|
||
/** | ||
* A warning message that a particular page is only available in English. | ||
*/ | ||
export function OnlyInEnglish() { | ||
return ( | ||
<Tooltip.Root> | ||
<Tooltip.TooltipTrigger asChild> | ||
<IconOutlineButton> | ||
<Translate size={20} /> | ||
</IconOutlineButton> | ||
</Tooltip.TooltipTrigger> | ||
<Tooltip.TooltipPortal> | ||
<Tooltip.TooltipContent {...tooltipContentProps}> | ||
<Popover.Root> | ||
<Popover.Trigger asChild> | ||
<IconButton2> | ||
<Translate size={16} /> | ||
</IconButton2> | ||
</Popover.Trigger> | ||
<Popover.Portal> | ||
<Popover.Content {...popoverContentProps}> | ||
<Trans>Sorry! This page is only available in English.</Trans> | ||
</Tooltip.TooltipContent> | ||
</Tooltip.TooltipPortal> | ||
</Tooltip.Root> | ||
</Popover.Content> | ||
</Popover.Portal> | ||
</Popover.Root> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters