applied various optimisations to UI

This commit is contained in:
SethBurkart123
2024-05-24 15:52:21 +10:00
parent abbb867672
commit 2bd0c00f11
8 changed files with 9 additions and 21 deletions
@@ -2,7 +2,6 @@ import { ChangeEvent, memo, useEffect, useState } from "react";
import { downloadPresetBackground, openDB, readAllData, writeData } from "../hooks/BackgroundDataLoader";
import presetBackgrounds from "../assets/presetBackgrounds";
import "./BackgroundSelector.css";
import browser from "webextension-polyfill";
export interface Background {
id: string;
+2 -2
View File
@@ -14,7 +14,7 @@ type ThemeCoverProps = {
onThemeDelete: (themeId: string) => void;
};
export const ThemeCover: React.FC<ThemeCoverProps> = ({
export const ThemeCover: React.FC<ThemeCoverProps> = React.memo(({
theme,
downloaded,
isSelected,
@@ -96,7 +96,7 @@ export const ThemeCover: React.FC<ThemeCoverProps> = ({
</div>
</button>
);
};
});
const LoadingSpinner = ({ size }: { size: number }) => {
return <div style={{ width: `${size}px`, height: `${size}px` }} className={`animate-spin rounded-full border-2 border-white border-t-2 border-t-transparent`}></div>;