Skip to content

Commit

Permalink
feat: display device uuid on general setting item
Browse files Browse the repository at this point in the history
  • Loading branch information
stephane-r committed Jan 12, 2024
1 parent 69d281e commit a4544e9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/pages/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { SponsorBlockSettings } from "../components/SponsorBlockSettings";
import { SwitchPlausibleAnalytics } from "../components/SwitchPlausibleAnalytics";
import { SwitchVideoMode } from "../components/SwitchVideoMode";
import { useStorage } from "../hooks/useStorage";
import { useSettings } from "../providers/Settings";

export const SettingsPage = memo(() => {
const { t } = useTranslation();
Expand Down Expand Up @@ -54,6 +55,8 @@ const GeneralItem = memo(() => {
</Group>
</Accordion.Control>
<Accordion.Panel>
<DeviceUuid />
<Divider mt="md" mb="lg" />
<Text mb="md">{t("invidious.description")}</Text>
<SelectInvidiousInstance />
<Divider mt="md" mb="lg" />
Expand All @@ -68,6 +71,20 @@ const GeneralItem = memo(() => {
);
});

const DeviceUuid = memo(() => {
const settings = useSettings();
const { t } = useTranslation();

return (
<>
<Text>{t("settings.general.device.uuid")}</Text>
<Text>
<strong>{settings.deviceId}</strong>
</Text>
</>
);
});

const AnalyticsItem = memo(() => {
if (process.env.REACT_APP_PLAUSIBLE_ANALYTICS !== "true") {
return null;
Expand Down
1 change: 1 addition & 0 deletions src/translations/en.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"settings.general.title": "General",
"settings.general.description": "Invidious instance, locale and dark mode",
"settings.general.device.uuid": "Device Uuid",
"settings.general.invidious.description": "Edit the Invidious instance settings and add your custom instance",
"settings.general.invidious.domain": "Domain",
"settings.general.invidious.type": "Type",
Expand Down
1 change: 1 addition & 0 deletions src/translations/fr.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"settings.general.title": "General",
"settings.general.description": "Instance Invidious, langage et mode sombre",
"settings.general.device.uuid": "Identifiant de l'appareil (uuid)",
"settings.general.invidious.description": "Modifier les paramètres d'instances Invidious et ajouter des instances personnaliser",
"settings.general.invidious.domain": "Domaine",
"settings.general.invidious.type": "Type",
Expand Down

0 comments on commit a4544e9

Please sign in to comment.