From 0c6c990c6724f518167763fa96321f49d1da4134 Mon Sep 17 00:00:00 2001 From: Radiquum Date: Fri, 14 Mar 2025 21:00:14 +0500 Subject: [PATCH] refactor: changed settings modal flow --- .../ReleasePlayer/ReleasePlayerCustom.tsx | 9 ++ .../SettingsModal/SettingsModal.tsx | 112 +++++++++++++----- app/store/preferences.ts | 6 + 3 files changed, 97 insertions(+), 30 deletions(-) create mode 100644 app/components/ReleasePlayer/ReleasePlayerCustom.tsx diff --git a/app/components/ReleasePlayer/ReleasePlayerCustom.tsx b/app/components/ReleasePlayer/ReleasePlayerCustom.tsx new file mode 100644 index 0000000..555cf4a --- /dev/null +++ b/app/components/ReleasePlayer/ReleasePlayerCustom.tsx @@ -0,0 +1,9 @@ +import { Card } from "flowbite-react"; + +export const ReleasePlayerCustom = (props: { id: number }) => { + return ( + +

ReleasePlayerCustom

+
+ ); +}; diff --git a/app/components/SettingsModal/SettingsModal.tsx b/app/components/SettingsModal/SettingsModal.tsx index 4509ba6..fc8655e 100644 --- a/app/components/SettingsModal/SettingsModal.tsx +++ b/app/components/SettingsModal/SettingsModal.tsx @@ -41,8 +41,12 @@ export const SettingsModal = (props: { isOpen: boolean; setIsOpen: any }) => { Настройки
+
+ +

Интерфейс

+
-

Тема

+

Тема

-

- Показывать список изменений -

- - preferenceStore.setFlags({ - showChangelog: !preferenceStore.flags.showChangelog, - }) - } - checked={preferenceStore.flags.showChangelog} - /> -
-
-

+

Пропускать страницу выбора категорий на страницах Домашняя и Закладки

@@ -111,10 +92,17 @@ export const SettingsModal = (props: { isOpen: boolean; setIsOpen: any }) => { {preferenceStore.params.skipToCategory.enabled ? ( <>
-

+

Категория домашней страницы

- + {Object.keys(HomeCategory).map((key) => { return ( {
-

+

Категория страницы закладок

- + {Object.keys(BookmarksCategory).map((key) => { return ( { ) : ( "" )} +
+
+ +

Приложение

+
+
+

Показывать список изменений

+ + preferenceStore.setFlags({ + showChangelog: !preferenceStore.flags.showChangelog, + }) + } + checked={preferenceStore.flags.showChangelog} + /> +
-

Отправка аналитики

+

Отправка аналитики

Требуется перезагрузка для применения

@@ -188,6 +209,37 @@ export const SettingsModal = (props: { isOpen: boolean; setIsOpen: any }) => { checked={preferenceStore.flags.enableAnalytics} />
+
+
+ +

Эксперименты

+
+
+
+

Новый плеер

+
+ + preferenceStore.setParams({ + experimental: { + ...preferenceStore.params.experimental, + newPlayer: !preferenceStore.params.experimental.newPlayer, + }, + }) + } + checked={preferenceStore.params.experimental.newPlayer} + /> +

diff --git a/app/store/preferences.ts b/app/store/preferences.ts index f621a6e..d125350 100644 --- a/app/store/preferences.ts +++ b/app/store/preferences.ts @@ -18,6 +18,9 @@ interface preferencesState { enabled: boolean; homeCategory: string; bookmarksCategory: string; + }; + experimental?: { + newPlayer: boolean; } // color: { // primary: string; @@ -47,6 +50,9 @@ export const usePreferencesStore = create()( enabled: false, homeCategory: "last", bookmarksCategory: "watching", + }, + experimental: { + newPlayer: false } }, setHasHydrated: (state) => {