mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-20 15:36:18 +00:00
WIP preserve local changes before duckie merge
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 427 B |
Binary file not shown.
|
After Width: | Height: | Size: 232 B |
Binary file not shown.
|
After Width: | Height: | Size: 715 B |
Binary file not shown.
|
After Width: | Height: | Size: 904 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 286 B |
@@ -0,0 +1,19 @@
|
||||
const rawNickIcons = import.meta.glob('./*.gif', { eager: true, import: 'default' }) as Record<string, string>;
|
||||
|
||||
export const NICK_ICON_URLS: Record<string, string> = Object.entries(rawNickIcons).reduce((accumulator, [ path, url ]) =>
|
||||
{
|
||||
const filename = path.split('/').pop() || '';
|
||||
const stem = filename.replace(/\.gif$/i, '');
|
||||
|
||||
if(stem) accumulator[stem] = url;
|
||||
if(filename) accumulator[filename] = url;
|
||||
|
||||
return accumulator;
|
||||
}, {} as Record<string, string>);
|
||||
|
||||
export const GetNickIconUrl = (iconKey: string) =>
|
||||
{
|
||||
if(!iconKey) return '';
|
||||
|
||||
return (NICK_ICON_URLS[iconKey] || NICK_ICON_URLS[iconKey.toLowerCase()] || '');
|
||||
};
|
||||
Reference in New Issue
Block a user