feat: add fallback for missing browser icons

This commit is contained in:
Arman committed 2022-08-08 17:42:33 +02:00
1 parent f82b8410f5
commit 39d6b1f045
2 files changed
+38 -14

No files matched your search

@@ -19,6 +19,14 @@
const limit = 5;
$: request = sdkForProject.teams.listLogs($page.params.team, limit, offset);
let browsers = {
firefox: 'firefox',
chrome: 'chrome',
safari: 'safari',
opera: 'opera',
edge: 'edge'
};
</script>
<Container>
@@ -40,13 +48,17 @@
<TableCellText title="Client">
<div class="u-flex u-cross-center u-gap-12">
<div class="avatar is-small">
<img
height="20"
width="20"
src={`/icons/${
$app.themeInUse
}/color/${log?.clientName.toLocaleLowerCase()}.svg`}
alt={log.clientName} />
{#if browsers[log.clientName.toLocaleLowerCase()]}
<img
height="20"
width="20"
src={`/icons/${
$app.themeInUse
}/color/${log?.clientName.toLocaleLowerCase()}.svg`}
alt={log.clientName} />
{:else}
<span class="icon-globe-alt" />
{/if}
</div>
<p class="text u-trim">
{log.clientName}
@@ -19,6 +19,14 @@
const limit = 25;
$: request = sdkForProject.users.getLogs($page.params.user, limit, offset);
let browsers = {
firefox: 'firefox',
chrome: 'chrome',
safari: 'safari',
opera: 'opera',
edge: 'edge'
};
</script>
<Container>
@@ -40,13 +48,17 @@
<TableCellText title="Client">
<div class="u-flex u-cross-center u-gap-12">
<div class="avatar is-small">
<img
height="20"
width="20"
src={`/icons/${
$app.themeInUse
}/color/${log?.clientName.toLocaleLowerCase()}.svg`}
alt={log.clientName} />
{#if browsers[log.clientName.toLocaleLowerCase()]}
<img
height="20"
width="20"
src={`/icons/${
$app.themeInUse
}/color/${log?.clientName.toLocaleLowerCase()}.svg`}
alt={log.clientName} />
{:else}
<span class="icon-globe-alt" />
{/if}
</div>
<p class="text u-trim">
{log.clientName}