1
0
mirror of https://github.com/XFox111/TabsAsideExtension.git synced 2026-04-22 07:58:01 +03:00
Files
TabsAsideExtension/entrypoints/options/main.tsx
T
xfox111 e21022d985 feat: Minor 3.1.0 (#150)
* Some features are now optional (#148)

* fix(dev): yarn.lock tree fix

* feat: bookmarks moved to optional permissions

* fix: analytics not working in firefox

* feat!: ability to turn off analytics (uses permissions on firefox)

* feat: analytics tracker for bookmark export

* feat: add privacy policy link in about section

* docs: privacy policy update

* feat: ability to chain multiple dialogs

* fix(loc): analytics option translation

* feat: settings review dialog

* fix: background script fails to load because of frontend code

* chore: use analytics permission as storage value

* fix: inverted analytics value

* feat!: option to disable thumbnail capture

* fix(ci): sed typo

* fix: minor fixes

* fix(firefox): web-ext lint error fix

* chore(ci): switch web-ext action

* chore(lint): fix eslint warnings

* chore(deps): monthly dependency bump (September 2025) (#149)

* chore: 3.1.0 version bump

* chore: minor cleanup

* fix: allow analytics checkbox stays inactive after denying permission on firefox

* fix(deps): yarn.lock rebuild

* fix: type assertion for userId

* fix: settings review dialog not showing if welcome dialog is not required

* fix: analytics and thumbnail capture toggles react incorrectly if permission is denied
2025-09-09 12:24:01 +03:00

49 lines
1.6 KiB
TypeScript

import App from "@/App.tsx";
import "@/assets/global.css";
import { trackPage } from "@/features/analytics";
import { Tab, TabList } from "@fluentui/react-components";
import ReactDOM from "react-dom/client";
import { useOptionsStyles } from "./hooks/useOptionsStyles.ts";
import AboutSection from "./layouts/AboutSection.tsx";
import ActionsSection from "./layouts/ActionsSection.tsx";
import GeneralSection from "./layouts/GeneralSection.tsx";
import StorageSection from "./layouts/StorageSection.tsx";
ReactDOM.createRoot(document.getElementById("root")!).render(
<App>
<OptionsPage />
</App>
);
trackPage("options_page");
function OptionsPage(): React.ReactElement
{
const [selection, setSelection] = useState<SelectionType>("general");
const cls = useOptionsStyles();
return (
<main className={ cls.main }>
<TabList
className={ cls.tabList }
selectedValue={ selection }
onTabSelect={ (_, data) => setSelection(data.value as SelectionType) }
>
<Tab value="general">{ i18n.t("options_page.general.title") }</Tab>
<Tab value="actions">{ i18n.t("options_page.actions.title") }</Tab>
<Tab value="storage">{ i18n.t("options_page.storage.title") }</Tab>
<Tab value="about">{ i18n.t("options_page.about.title") }</Tab>
</TabList>
<article className={ cls.article }>
{ selection === "general" && <GeneralSection /> }
{ selection === "actions" && <ActionsSection /> }
{ selection === "storage" && <StorageSection /> }
{ selection === "about" && <AboutSection /> }
</article>
</main>
);
}
type SelectionType = "general" | "actions" | "storage" | "about";