1
0
mirror of https://github.com/XFox111/TabsAsideExtension.git synced 2026-04-22 07:58:01 +03:00
Files
TabsAsideExtension/entrypoints/sidepanel/layouts/header/MoreButton.tsx
T
xfox111 58d8e864e0 feat: Minor 3.3.0 (#222)
* feat: add ability to hide collections #211 (#213)

* feat: add ability to hide collections #211

* fix: hide/unhide collection label is swapped

* fix: missing useCallback dependency

* fix: add selected tabs to existing collection adds all tabs in current window #215 (#216)

* fix: add selected tabs to existing collection adds all tabs in current window #215

* fix: force selected tabs only for adding tabs to groups

* feat: compact collection view (#214)

* feat: compact collection view #201

* loc: compact view localization

* fix(loc): missing "color" translation in edit dialog

* feat: add ability to edit saved tabs (#218)

* feat: adds option to edit saved tabs #217

* loc: translations for #217

* build(deps): Bump the react group with 2 updates (#221)

Bumps the react group with 2 updates: [react](https://github.com/facebook/react/tree/HEAD/packages/react) and [react-dom](https://github.com/facebook/react/tree/HEAD/packages/react-dom).


Updates `react` from 19.2.1 to 19.2.3
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v19.2.3/packages/react)

Updates `react-dom` from 19.2.1 to 19.2.3
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v19.2.3/packages/react-dom)

---
updated-dependencies:
- dependency-name: react
  dependency-version: 19.2.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: react
- dependency-name: react-dom
  dependency-version: 19.2.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: react
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): Bump the deps group with 4 updates (#220)

Bumps the deps group with 4 updates: [@fluentui/react-components](https://github.com/microsoft/fluentui), [@eslint/js](https://github.com/eslint/eslint/tree/HEAD/packages/js), [eslint](https://github.com/eslint/eslint) and [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint).


Updates `@fluentui/react-components` from 9.72.8 to 9.72.9
- [Release notes](https://github.com/microsoft/fluentui/releases)
- [Commits](https://github.com/microsoft/fluentui/compare/@fluentui/react-components_v9.72.8...@fluentui/react-components_v9.72.9)

Updates `@eslint/js` from 9.39.1 to 9.39.2
- [Release notes](https://github.com/eslint/eslint/releases)
- [Commits](https://github.com/eslint/eslint/commits/v9.39.2/packages/js)

Updates `eslint` from 9.39.1 to 9.39.2
- [Release notes](https://github.com/eslint/eslint/releases)
- [Commits](https://github.com/eslint/eslint/compare/v9.39.1...v9.39.2)

Updates `typescript-eslint` from 8.49.0 to 8.51.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.51.0/packages/typescript-eslint)

---
updated-dependencies:
- dependency-name: "@fluentui/react-components"
  dependency-version: 9.72.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: deps
- dependency-name: "@eslint/js"
  dependency-version: 9.39.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: deps
- dependency-name: eslint
  dependency-version: 9.39.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: deps
- dependency-name: typescript-eslint
  dependency-version: 8.51.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: deps
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: Bump version from 3.2.3 to 3.3.0

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-03 21:13:08 +03:00

104 lines
3.9 KiB
TypeScript

import { BuyMeACoffee20Filled, BuyMeACoffee20Regular } from "@/assets/BuyMeACoffee20";
import { buyMeACoffeeLink, githubLinks, storeLink } from "@/data/links";
import { track } from "@/features/analytics";
import useSettings from "@/hooks/useSettings";
import extLink from "@/utils/extLink";
import sendNotification from "@/utils/sendNotification";
import * as fui from "@fluentui/react-components";
import * as ic from "@fluentui/react-icons";
import { ReactElement } from "react";
export default function MoreButton(): ReactElement
{
const [tilesView, setTilesView] = useSettings("tilesView");
const [compactView, setCompactView] = useSettings("compactView");
const SettingsIcon: ic.FluentIcon = ic.bundleIcon(ic.Settings20Filled, ic.Settings20Regular);
const GridIcon: ic.FluentIcon = ic.bundleIcon(ic.GridKanban20Filled, ic.GridKanban20Regular);
const CompactIcon: ic.FluentIcon = ic.bundleIcon(ic.ArrowMinimizeVerticalFilled, ic.ArrowMinimizeVerticalRegular);
const FeedbackIcon: ic.FluentIcon = ic.bundleIcon(ic.PersonFeedback20Filled, ic.PersonFeedback20Regular);
const LearnIcon: ic.FluentIcon = ic.bundleIcon(ic.QuestionCircle20Filled, ic.QuestionCircle20Regular);
const BmcIcon: ic.FluentIcon = ic.bundleIcon(BuyMeACoffee20Filled, BuyMeACoffee20Regular);
const checkedValues = useMemo(() => ({
view: [
tilesView ? "tiles" : "",
compactView ? "compact" : ""
]
}), [tilesView, compactView]);
const onCheckedValueChange = (_: unknown, e: fui.MenuCheckedValueChangeData) =>
{
setTilesView(e.checkedItems.includes("tiles"));
setCompactView(e.checkedItems.includes("compact"));
};
return (
<fui.Menu
hasIcons hasCheckmarks
checkedValues={ checkedValues } onCheckedValueChange={ onCheckedValueChange }
>
<fui.Tooltip relationship="label" content={ i18n.t("common.tooltips.more") }>
<fui.MenuTrigger disableButtonEnhancement>
<fui.Button appearance="subtle" icon={ <ic.MoreVerticalRegular /> } />
</fui.MenuTrigger>
</fui.Tooltip>
<fui.MenuPopover>
<fui.MenuList>
<fui.MenuItem icon={ <SettingsIcon /> } onClick={ () => browser.runtime.openOptionsPage() }>
{ i18n.t("options_page.title") }
</fui.MenuItem>
<fui.MenuItemCheckbox name="view" value="tiles" icon={ <GridIcon /> }>
{ i18n.t("main.header.menu.tiles_view") }
</fui.MenuItemCheckbox>
<fui.MenuItemCheckbox name="view" value="compact" icon={ <CompactIcon /> }>
{ i18n.t("main.header.menu.compact_view") }
</fui.MenuItemCheckbox>
<fui.MenuDivider />
<fui.MenuItemLink icon={ <BmcIcon /> } { ...extLink(buyMeACoffeeLink) } onClick={ () => track("feedback_clicked") }>
{ i18n.t("common.cta.sponsor") }
</fui.MenuItemLink>
<fui.MenuItemLink icon={ <FeedbackIcon /> } { ...extLink(storeLink) } onClick={ () => track("bmc_clicked") }>
{ i18n.t("common.cta.feedback") }
</fui.MenuItemLink>
<fui.MenuItemLink icon={ <LearnIcon /> } { ...extLink(githubLinks.release) } >
{ i18n.t("main.header.menu.changelog") }
</fui.MenuItemLink>
{ import.meta.env.DEV &&
<fui.MenuGroup>
<fui.MenuGroupHeader>Dev tools</fui.MenuGroupHeader>
<fui.MenuItem
icon={ <ic.ArrowClockwise20Regular /> }
onClick={ () => document.location.reload() }
>
Reload page
</fui.MenuItem>
<fui.MenuItem
icon={ <ic.Open20Regular /> }
onClick={ () => browser.tabs.create({ url: browser.runtime.getURL("/sidepanel.html"), active: true }) }
>
Open in tab
</fui.MenuItem>
<fui.MenuItem
icon={ <ic.Alert20Regular /> }
onClick={ async () => await sendNotification({
icon: "/notification_icons/cloud_error.png",
message: "Notification message",
title: "Notification title"
}) }
>
Show test notification
</fui.MenuItem>
</fui.MenuGroup>
}
</fui.MenuList>
</fui.MenuPopover>
</fui.Menu>
);
}