diff --git a/frontend/src/icons.ts b/frontend/src/icons.ts index c5eb0b5..92c0a2d 100644 --- a/frontend/src/icons.ts +++ b/frontend/src/icons.ts @@ -29,13 +29,14 @@ const singleViewButton = ( document.getElementById("single-view-button") ) +const extraSVGAttrs = { + width: "1em", + height: "1em", + fill: "currentColor", +} function renderIcon(elem: HTMLButtonElement, icon: IconDefinition) { elem.innerHTML += renderIconDefinitionToSVGElement(icon, { - extraSVGAttrs: { - width: "1em", - height: "1em", - fill: "currentColor", - }, + extraSVGAttrs: extraSVGAttrs, }) } @@ -91,11 +92,11 @@ tippy("#copy-button", { tippy("#github-button", { content: `GitHub
${renderIconDefinitionToSVGElement(StarOutlined, { - extraSVGAttrs: { fill: "currentColor" }, + extraSVGAttrs: extraSVGAttrs, })} ${renderIconDefinitionToSVGElement(ForkOutlined, { - extraSVGAttrs: { fill: "currentColor" }, + extraSVGAttrs: extraSVGAttrs, })} ${renderIconDefinitionToSVGElement(HeartOutlined, { - extraSVGAttrs: { fill: "currentColor" }, + extraSVGAttrs: extraSVGAttrs, })}`, placement: "bottom", animation: "scale", @@ -137,20 +138,12 @@ export function toggleHiddenIcon(hidden: boolean) { hideButton.innerHTML = renderIconDefinitionToSVGElement( EyeInvisibleOutlined, { - extraSVGAttrs: { - width: "1em", - height: "1em", - fill: "currentColor", - }, + extraSVGAttrs: extraSVGAttrs, } ) } else { hideButton.innerHTML = renderIconDefinitionToSVGElement(EyeOutlined, { - extraSVGAttrs: { - width: "1em", - height: "1em", - fill: "currentColor", - }, + extraSVGAttrs: extraSVGAttrs, }) } }