refactor: format and lint codebase (#971)
This commit is contained in:
14
app/assets/javascripts/Utils/SortThemes.ts
Normal file
14
app/assets/javascripts/Utils/SortThemes.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { ThemeItem } from '@/Components/QuickSettingsMenu/ThemeItem'
|
||||
|
||||
export const sortThemes = (a: ThemeItem, b: ThemeItem) => {
|
||||
const aIsLayerable = a.component?.isLayerable()
|
||||
const bIsLayerable = b.component?.isLayerable()
|
||||
|
||||
if (aIsLayerable && !bIsLayerable) {
|
||||
return 1
|
||||
} else if (!aIsLayerable && bIsLayerable) {
|
||||
return -1
|
||||
} else {
|
||||
return a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user