Skip to content

Commit

Permalink
memberDB svg icon for deleted entries
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavo-salazar committed May 6, 2022
1 parent 0a737f4 commit 6cdced4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/components/Entry/MemberSymbol/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ const classNames = new Map([
['TIGRFAMS', f('md-ti')],
['NEW', f('md-new')],
['ALL', f('md-all')],
['REMOVED', f('md-removed')],
]);

const MemberSymbol = (
Expand All @@ -155,12 +156,15 @@ const MemberSymbol = (
const [png, setPng] = useState(null);
const [avif, setAvif] = useState(null);
if (!svg) {
images[type][0].then((src) => setAvif(src.default));
images[type][1].then((src) => setPng(src.default));
images?.[type]?.[0].then((src) => setAvif(src.default));
images?.[type]?.[1].then((src) => setPng(src.default));
}
return (
<span data-testid="entry-member-db-icon">
{svg ? (
<span
data-testid="entry-member-db-icon"
className={f('entry-member-db-icon')}
>
{svg || (!png && !avif) ? (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 200 200"
Expand Down
7 changes: 7 additions & 0 deletions src/components/Entry/MemberSymbol/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
.md-all .md-color {
fill: var(--colors-all);
}
.md-removed .md-color {
fill: var(--colors-dark);
}

.md-color,
.md-server {
Expand All @@ -64,6 +67,10 @@
:root {
--aspect-ratio: 1 / 1;
}
.entry-member-db-icon svg {
width: 80px;
}

.memberdb-logo {
min-height: 80px;
display: flex;
Expand Down

0 comments on commit 6cdced4

Please sign in to comment.