mirror of
https://github.com/Aviortheking/next-template.git
synced 2025-06-23 01:29:19 +00:00
Updated to V2
Signed-off-by: Florian Bouillon <florian.bouillon@delta-wings.net>
This commit is contained in:
36
src/client/components/dzeio/Util.ts
Normal file
36
src/client/components/dzeio/Util.ts
Normal file
@ -0,0 +1,36 @@
|
||||
export function buildClassName(...classes: Array<Array<string | boolean | undefined> | string | undefined>): string | undefined {
|
||||
const classesFinal: Array<string> = []
|
||||
root: for (const classe of classes) {
|
||||
if (typeof classe === 'undefined') {
|
||||
continue
|
||||
}
|
||||
if (typeof classe === 'string') {
|
||||
classesFinal.push(classe)
|
||||
continue
|
||||
}
|
||||
const classToPut = classe.shift()
|
||||
if (typeof classToPut === 'undefined') {
|
||||
continue
|
||||
}
|
||||
for (const iterator of classe) {
|
||||
if (!iterator) {
|
||||
continue root
|
||||
}
|
||||
}
|
||||
classesFinal.push(classToPut + '')
|
||||
}
|
||||
if (classesFinal.length === 0) {
|
||||
return undefined
|
||||
}
|
||||
return classesFinal.join(' ')
|
||||
}
|
||||
|
||||
export const colors = {
|
||||
default: '#3949AB', // This color should never appear
|
||||
primary: '#3949AB',
|
||||
secondary: '#FCFCFC',
|
||||
info: '#03A9F4',
|
||||
success: '#2DCE89',
|
||||
danger: '#F5365C',
|
||||
warning: '#FB6340'
|
||||
}
|
Reference in New Issue
Block a user