Merge pull request #891 from TetrisIQ/moveIconsInComunityRepo
Move icons in comunity repo
This commit is contained in:
commit
d122af9fed
@ -1,25 +1,14 @@
|
||||
<script lang="ts">
|
||||
export let type: string;
|
||||
export let isAbsolute = false;
|
||||
let githubRawIconUrl =
|
||||
'https://raw.githubusercontent.com/coollabsio/coolify-community-templates/main/services/icons';
|
||||
|
||||
let fallback = '/icons/default.png';
|
||||
const handleError = (ev: { target: { src: string } }) => (ev.target.src = fallback);
|
||||
let extension = 'png';
|
||||
let svgs = [
|
||||
'mattermost',
|
||||
'directus',
|
||||
'pocketbase',
|
||||
'gitea',
|
||||
'languagetool',
|
||||
'meilisearch',
|
||||
'n8n',
|
||||
'glitchtip',
|
||||
'searxng',
|
||||
'umami',
|
||||
'uptimekuma',
|
||||
'vaultwarden',
|
||||
'weblate',
|
||||
'wordpress'
|
||||
];
|
||||
|
||||
const handleError = (ev: { target: { src: string } }) => {
|
||||
ev.target.src = fallback;
|
||||
};
|
||||
|
||||
const name: any =
|
||||
type &&
|
||||
@ -29,32 +18,15 @@
|
||||
.split('-')[0]
|
||||
.toLowerCase();
|
||||
|
||||
if (svgs.includes(name)) {
|
||||
extension = 'svg';
|
||||
}
|
||||
|
||||
function generateClass() {
|
||||
switch (name) {
|
||||
case 'n8n':
|
||||
if (isAbsolute) {
|
||||
return 'w-12 h-12 absolute -m-9 -mt-12';
|
||||
}
|
||||
return 'w-12 h-12 -mt-3';
|
||||
case 'weblate':
|
||||
if (isAbsolute) {
|
||||
return 'w-12 h-12 absolute -m-9 -mt-12';
|
||||
}
|
||||
return 'w-12 h-12 -mt-3';
|
||||
default:
|
||||
return isAbsolute ? 'w-10 h-10 absolute -m-4 -mt-9 left-0' : 'w-10 h-10';
|
||||
}
|
||||
return isAbsolute ? 'w-10 h-10 absolute -m-4 -mt-9 left-0' : 'w-10 h-10';
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if name}
|
||||
<img
|
||||
class={generateClass()}
|
||||
src={`/icons/${name}.${extension}`}
|
||||
src={`${githubRawIconUrl}/${name}.png`}
|
||||
on:error={handleError}
|
||||
alt={`Icon of ${name}`}
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user