-
-
Notifications
You must be signed in to change notification settings - Fork 25
feat: Minor 3.3.0 #222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
feat: Minor 3.3.0 #222
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
49444de
feat: add ability to hide collections #211 (#213)
XFox111 3e79964
fix: add selected tabs to existing collection adds all tabs in curren…
XFox111 2118219
feat: compact collection view (#214)
XFox111 51e630a
fix(loc): missing "color" translation in edit dialog
XFox111 12cd5f7
feat: add ability to edit saved tabs (#218)
XFox111 984e0be
build(deps): Bump the react group with 2 updates (#221)
dependabot[bot] 55eb280
build(deps): Bump the deps group with 4 updates (#220)
dependabot[bot] 4e86090
chore: Bump version from 3.2.3 to 3.3.0
XFox111 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| import { track } from "@/features/analytics"; | ||
| import { TabItem } from "@/models/CollectionModels"; | ||
| import { Button, DialogActions, DialogBody, DialogContent, DialogSurface, DialogTitle, DialogTrigger, Field, Input, makeStyles, tokens } from "@fluentui/react-components"; | ||
|
|
||
| export default function TabEditDialog({ tab, onSave }: TabEditDialogProps): React.ReactElement | ||
| { | ||
| const cls = useStyles(); | ||
|
|
||
| const [title, setTitle] = useState(tab.title ?? ""); | ||
| const [url, setUrl] = useState(tab.url); | ||
| const isValid = useMemo(() => url.trim().length > 0, [url]); | ||
|
|
||
| const onSubmit = (e: React.FormEvent<HTMLFormElement>) => | ||
| { | ||
| e.preventDefault(); | ||
| track("item_edited", { type: "tab" }); | ||
| onSave({ | ||
| ...tab, | ||
| title: title.trim().length > 0 ? title : undefined, | ||
| url: url.trim() | ||
| }); | ||
| }; | ||
|
|
||
| return ( | ||
| <DialogSurface> | ||
| <form onSubmit={ onSubmit }> | ||
| <DialogBody> | ||
| <DialogTitle>{ i18n.t("dialogs.edit.title.edit_tab") }</DialogTitle> | ||
| <DialogContent className={ cls.content }> | ||
| <Input | ||
| value={ title } onChange={ (_, e) => setTitle(e.value) } | ||
| placeholder={ i18n.t("dialogs.edit.collection_title") } /> | ||
| <Field validationMessage={ isValid ? undefined : i18n.t("dialogs.edit.url_error") }> | ||
| <Input | ||
| value={ url } onChange={ (_, e) => setUrl(e.value) } | ||
| placeholder="URL" /> | ||
| </Field> | ||
| </DialogContent> | ||
|
|
||
| <DialogActions> | ||
| <DialogTrigger disableButtonEnhancement> | ||
| <Button disabled={ !isValid } appearance="primary" as="button" type="submit"> | ||
| { i18n.t("common.actions.save") } | ||
| </Button> | ||
| </DialogTrigger> | ||
| <DialogTrigger disableButtonEnhancement> | ||
| <Button appearance="subtle">{ i18n.t("common.actions.cancel") }</Button> | ||
| </DialogTrigger> | ||
| </DialogActions> | ||
| </DialogBody> | ||
| </form> | ||
| </DialogSurface> | ||
| ); | ||
| } | ||
|
|
||
| const useStyles = makeStyles({ | ||
| content: | ||
| { | ||
| display: "flex", | ||
| flexFlow: "column", | ||
| gap: tokens.spacingVerticalMNudge | ||
| } | ||
| }); | ||
|
|
||
| export type TabEditDialogProps = | ||
| { | ||
| tab: TabItem; | ||
| onSave: (updatedTab: TabItem) => void; | ||
| }; | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| import { useDangerStyles } from "@/hooks/useDangerStyles"; | ||
| import { Button, Menu, MenuItem, MenuList, MenuPopover, MenuTrigger, Tooltip } from "@fluentui/react-components"; | ||
| import { bundleIcon, Delete20Filled, Delete20Regular, Edit20Filled, Edit20Regular, MoreHorizontal20Regular } from "@fluentui/react-icons"; | ||
| import { ButtonHTMLAttributes } from "react"; | ||
|
|
||
| export default function TabMoreButton({ onEdit, onDelete, ...props }: TabMoreButtonProps): React.ReactElement | ||
| { | ||
| const EditIcon = bundleIcon(Edit20Filled, Edit20Regular); | ||
| const DeleteIcon = bundleIcon(Delete20Filled, Delete20Regular); | ||
| const dangerCls = useDangerStyles(); | ||
|
|
||
| return ( | ||
| <Menu> | ||
| <Tooltip relationship="label" content={ i18n.t("common.tooltips.more") }> | ||
| <MenuTrigger> | ||
| <Button | ||
| appearance="subtle" icon={ <MoreHorizontal20Regular /> } | ||
| onClick={ ev => ev.stopPropagation() } | ||
| { ...props } /> | ||
| </MenuTrigger> | ||
| </Tooltip> | ||
|
|
||
| <MenuPopover onClick={ ev => ev.stopPropagation() }> | ||
| <MenuList> | ||
| <MenuItem icon={ <EditIcon /> } onClick={ onEdit }> | ||
| { i18n.t("dialogs.edit.title.edit_tab") } | ||
| </MenuItem> | ||
| <MenuItem icon={ <DeleteIcon /> } className={ dangerCls.menuItem } onClick={ onDelete }> | ||
| { i18n.t("tabs.delete") } | ||
| </MenuItem> | ||
| </MenuList> | ||
| </MenuPopover> | ||
| </Menu> | ||
| ); | ||
| } | ||
|
|
||
| export type TabMoreButtonProps = | ||
| ButtonHTMLAttributes<HTMLButtonElement> & | ||
| { | ||
| onDelete?: () => void; | ||
| onEdit?: () => void; | ||
| }; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.