mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-13 07:04:39 +00:00
feat(settings): add custom theme selector
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import React, { useState } from 'react';
|
||||
import { CustomTheme, DownloadedTheme } from '../types/CustomThemes';
|
||||
import { CustomTheme, DownloadedTheme } from '../../types/CustomThemes';
|
||||
import browser from 'webextension-polyfill';
|
||||
import { ArrowUpOnSquareIcon, PencilIcon } from '@heroicons/react/24/outline';
|
||||
import { sendThemeUpdate, setTheme } from '../hooks/ThemeManagment';
|
||||
|
||||
@@ -3,7 +3,7 @@ import { deleteTheme, disableTheme, getDownloadedThemes, listThemes, sendThemeUp
|
||||
import { DeleteDownloadedTheme } from '../pages/Store';
|
||||
import { ThemeCover } from './ThemeCover';
|
||||
import browser from 'webextension-polyfill';
|
||||
import { CustomTheme, DownloadedTheme } from '../types/CustomThemes';
|
||||
import { CustomTheme, DownloadedTheme } from '../../types/CustomThemes';
|
||||
import { useSettingsContext } from '../SettingsContext';
|
||||
import { SettingsState } from '../types/AppProps';
|
||||
import { InstallTheme } from '../../seqta/ui/themes/downloadTheme';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import browser from 'webextension-polyfill'
|
||||
import { CustomTheme, DownloadedTheme, ThemeList } from '../types/CustomThemes';
|
||||
import { CustomTheme, DownloadedTheme, ThemeList } from '../../types/CustomThemes';
|
||||
import localforage from 'localforage';
|
||||
|
||||
export const setTheme = async (themeID: string) => {
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
export type CustomTheme = {
|
||||
id: string;
|
||||
name: string;
|
||||
description: string;
|
||||
defaultColour: string;
|
||||
CanChangeColour: boolean;
|
||||
allowBackgrounds: boolean;
|
||||
CustomCSS: string;
|
||||
CustomImages: CustomImage[];
|
||||
coverImage: Blob | string | null;
|
||||
isEditable: boolean;
|
||||
hideThemeName: boolean;
|
||||
webURL?: string;
|
||||
selectedColor?: string;
|
||||
forceDark?: boolean;
|
||||
}
|
||||
|
||||
export type DownloadedTheme = CustomTheme & {
|
||||
webURL: string;
|
||||
}
|
||||
|
||||
export type CustomImage = {
|
||||
id: string;
|
||||
blob: Blob;
|
||||
variableName: string;
|
||||
}
|
||||
|
||||
export type CustomImageBase64 = {
|
||||
id: string;
|
||||
url: string;
|
||||
variableName: string;
|
||||
}
|
||||
|
||||
export type CustomThemeBase64 = Omit<CustomTheme, 'CustomImages'> & {
|
||||
CustomImages: CustomImageBase64[];
|
||||
coverImage: string | null;
|
||||
}
|
||||
|
||||
export type ThemeList = {
|
||||
themes: Omit<CustomTheme, 'CustomImages'>[];
|
||||
selectedTheme: string;
|
||||
}
|
||||
Reference in New Issue
Block a user