mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-14 21:22:29 +08:00
client-ts: Port widgets/icon_list
This commit is contained in:
parent
8cc271a192
commit
05116b3b0d
@ -1,6 +1,20 @@
|
|||||||
// taken from the HTML source of https://boxicons.com/
|
// taken from the HTML source of https://boxicons.com/
|
||||||
|
|
||||||
const categories = [
|
interface Category {
|
||||||
|
name: string;
|
||||||
|
id: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Icon {
|
||||||
|
name: string;
|
||||||
|
slug: string;
|
||||||
|
category_id: number;
|
||||||
|
type_of_icon: "REGULAR" | "SOLID" | "LOGO";
|
||||||
|
term?: string[];
|
||||||
|
className?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const categories: Category[] = [
|
||||||
{"name": "All categories", "id": 0},
|
{"name": "All categories", "id": 0},
|
||||||
{
|
{
|
||||||
"name": "Accessibility",
|
"name": "Accessibility",
|
||||||
@ -132,7 +146,7 @@ const categories = [
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
const icons = [
|
const icons: Icon[] = [
|
||||||
{
|
{
|
||||||
"name": "child",
|
"name": "child",
|
||||||
"slug": "child-regular",
|
"slug": "child-regular",
|
||||||
@ -11175,7 +11189,7 @@ const icons = [
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
function getIconClass(icon) {
|
function getIconClass(icon: Icon) {
|
||||||
if (icon.type_of_icon === 'LOGO') {
|
if (icon.type_of_icon === 'LOGO') {
|
||||||
return `bxl-${icon.name}`;
|
return `bxl-${icon.name}`;
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user