File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { ThemeName } from "@monkeytype/schemas/configs" ;
2- import { hexToHSL } from "../utils/colors" ;
32import { z } from "zod" ;
43
54const hexColorSchema = z
@@ -2335,11 +2334,3 @@ export const ThemesList: ThemeWithName[] = Object.keys(themes)
23352334 name : it as ThemeName ,
23362335 } ) as Theme & { name : ThemeName } ,
23372336 ) ;
2338-
2339- export const ThemesListSorted : ThemeWithName [ ] = [
2340- ...ThemesList . sort ( ( a , b ) => {
2341- const b1 = hexToHSL ( a . bg ) ;
2342- const b2 = hexToHSL ( b . bg ) ;
2343- return b2 . lgt - b1 . lgt ;
2344- } ) ,
2345- ] ;
Original file line number Diff line number Diff line change @@ -14,10 +14,18 @@ import { isAuthenticated } from "../../firebase";
1414import { getActivePage } from "../../signals/core" ;
1515import { ThemeName } from "@monkeytype/schemas/configs" ;
1616import { captureException } from "../../sentry" ;
17- import { ColorName , ThemesListSorted } from "../../constants/themes" ;
17+ import { ColorName , ThemesList , ThemeWithName } from "../../constants/themes" ;
1818import { qs , qsa , qsr } from "../../utils/dom" ;
1919import { getTheme , updateThemeColor } from "../../signals/theme" ;
2020
21+ export const sortedThemes : ThemeWithName [ ] = [
22+ ...ThemesList . sort ( ( a , b ) => {
23+ const b1 = Colors . hexToHSL ( a . bg ) ;
24+ const b2 = Colors . hexToHSL ( b . bg ) ;
25+ return b2 . lgt - b1 . lgt ;
26+ } ) ,
27+ ] ;
28+
2129function updateActiveButton ( ) : void {
2230 let activeThemeName : string = Config . theme ;
2331 if (
@@ -85,7 +93,7 @@ export async function fillPresetButtons(): Promise<void> {
8593 activeThemeName = ThemeController . randomTheme ;
8694 }
8795
88- const themes = ThemesListSorted ;
96+ const themes = sortedThemes ;
8997
9098 //first show favourites
9199 if ( Config . favThemes . length > 0 ) {
Original file line number Diff line number Diff line change @@ -266,6 +266,9 @@ function getBuildOptions({
266266 if ( id . includes ( "monkeytype/packages" ) ) {
267267 return "monkeytype-packages" ;
268268 }
269+ if ( id . includes ( "src/ts/constants" ) ) {
270+ return "monkeytype-constants" ;
271+ }
269272 if ( id . includes ( "node_modules" ) ) {
270273 return "vendor" ;
271274 }
You can’t perform that action at this time.
0 commit comments