-
-
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.
* Add Design System Page * Replace All Buttons * Use same Page element everywhere * Strange newline change * Remove Unused Code * Completely Removed Old Button * Tweak Your Charts Page Design * More button cohesion * Unified InfoIconWithTooltip * Remove Reach, Centralize Dialog * Add translations * Layout Tab Fixes * Fix Failing Test * Dark Mode * Convert Tooltip to Popover for Mobile * Translations
- Loading branch information
1 parent
f8555cf
commit f897dcd
Showing
87 changed files
with
3,136 additions
and
4,013 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,41 @@ | ||
import { t, Trans } from "@lingui/macro"; | ||
import { Trans } from "@lingui/macro"; | ||
import * as Dialog from "@radix-ui/react-dialog"; | ||
import { Trash } from "phosphor-react"; | ||
import { useState } from "react"; | ||
|
||
import { Box } from "../slang"; | ||
import styles from "./ClearTextButton.module.css"; | ||
import { Button, Dialog, smallIconSize } from "./Shared"; | ||
import { Content, Overlay } from "../ui/Dialog"; | ||
import { Button2, IconButton2 } from "../ui/Shared"; | ||
import { SectionTitle } from "../ui/Typography"; | ||
|
||
export function ClearTextButton({ handleClear }: { handleClear: () => void }) { | ||
const [dialogOpen, setDialogOpen] = useState(false); | ||
return ( | ||
<> | ||
<Box | ||
as="button" | ||
p={2} | ||
rad={1} | ||
className={styles.ClearTextButton} | ||
onClick={() => setDialogOpen((x) => !x)} | ||
> | ||
<Trash size={smallIconSize} /> | ||
</Box> | ||
<Dialog | ||
innerBoxProps={{ | ||
gap: 3, | ||
flow: "column", | ||
items: "center normal", | ||
template: "auto / minmax(0, 1fr) min-content min-content", | ||
}} | ||
dialogProps={{ | ||
isOpen: dialogOpen, | ||
onDismiss: () => setDialogOpen(false), | ||
"aria-label": t`Clear text?`, | ||
}} | ||
> | ||
<Trans>Clear text?</Trans> | ||
<Button | ||
onClick={() => { | ||
handleClear(); | ||
setDialogOpen(false); | ||
}} | ||
className={styles.Clear} | ||
text={t`Clear`} | ||
/> | ||
<Button onClick={() => setDialogOpen(false)} text={t`Cancel`} /> | ||
</Dialog> | ||
</> | ||
<Dialog.Root open={dialogOpen} onOpenChange={(open) => setDialogOpen(open)}> | ||
<Dialog.Trigger asChild> | ||
<IconButton2 className="!absolute bottom-1 right-1 md:hidden"> | ||
<Trash size={16} /> | ||
</IconButton2> | ||
</Dialog.Trigger> | ||
<Overlay /> | ||
<Content> | ||
<SectionTitle> | ||
<Trans>Clear text?</Trans> | ||
</SectionTitle> | ||
<div className="flex flex-row justify-between items-center"> | ||
<Button2 onClick={() => setDialogOpen(false)}> | ||
<Trans>Cancel</Trans> | ||
</Button2> | ||
<Button2 | ||
onClick={() => { | ||
handleClear(); | ||
setDialogOpen(false); | ||
}} | ||
color="red" | ||
> | ||
<Trans>Clear</Trans> | ||
</Button2> | ||
</div> | ||
</Content> | ||
</Dialog.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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.