Update icons
This commit is contained in:
@@ -1,2 +1,9 @@
|
||||
export const getAppIcon = (icon: string) =>
|
||||
`https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons@master/png/${icon}.png`;
|
||||
const ICON_SOURCES: Record<string, (icon: string) => string> = {
|
||||
'homelab-svg-assets': (icon) =>
|
||||
`https://raw.githubusercontent.com/loganmarchione/homelab-svg-assets/main/assets/${icon}.svg`,
|
||||
'dashboard-icons': (icon) =>
|
||||
`https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons@master/png/${icon}.png`,
|
||||
};
|
||||
|
||||
export const getAppIcon = (icon: string, source: string = 'homelab-svg-assets') =>
|
||||
ICON_SOURCES[source](icon);
|
||||
|
||||
@@ -5,9 +5,9 @@ import { AppDefinition } from '~/types';
|
||||
|
||||
import style from './App.module.css';
|
||||
|
||||
export type PillProps = AppDefinition;
|
||||
export type AppProps = AppDefinition;
|
||||
|
||||
export function App(props: PillProps) {
|
||||
export function App(props: AppProps) {
|
||||
const { appSettings } = useSettings();
|
||||
|
||||
return (
|
||||
@@ -20,7 +20,7 @@ export function App(props: PillProps) {
|
||||
<span class={style.Url}>{props.location}</span>
|
||||
</Show>
|
||||
</div>
|
||||
<img class={style.Icon} src={getAppIcon(props.icon)} alt={props.name} />
|
||||
<img class={style.Icon} src={getAppIcon(props.icon, props.icon_source)} alt={props.name} />
|
||||
<Show when={props.shortcut}>
|
||||
<span class={style.Index}>{props.shortcut}</span>
|
||||
</Show>
|
||||
|
||||
@@ -9,6 +9,7 @@ export type AppDefinition = {
|
||||
name: string;
|
||||
url: string;
|
||||
icon: string;
|
||||
icon_source?: string;
|
||||
tags: string;
|
||||
location?: string;
|
||||
shortcut?: string;
|
||||
|
||||
Reference in New Issue
Block a user