Skip to content

Commit

Permalink
Migrate custom pumpkin icon to astro-icon
Browse files Browse the repository at this point in the history
  • Loading branch information
Southpaw1496 committed Aug 13, 2024
1 parent 361f1a8 commit 02bb51d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/components/parts/timeline/Item.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import PumpkinIcon from '../../assets/icon/solid/pumpkin.svg?raw';
import {Icon} from "astro-icon/components"
export interface Props {
id: string;
Expand All @@ -9,14 +9,11 @@ export interface Props {
const { id, title, icon } = Astro.props as Props;
const customIcons: Record<string, string> = {
'pumpkin': PumpkinIcon,
}
---

<div class="timeline-item">
<div class="timeline-marker is-icon is-dark">
{icon.startsWith('custom:') ? (<div style="min-width: 1.25em; padding-top: 0.4em; display:inline-block;"><Fragment set:html={customIcons[icon.substring('custom:'.length)]} /></div>) : (<i class={icon} />)}
{icon.startsWith('custom:') ? (<div style="min-width: 1.25em; padding-top: 0.4em; display:inline-block;"><Icon name="pumpkin" /></div>) : (<i class={icon} />)}
</div>

<div class="timeline-content">
Expand Down

0 comments on commit 02bb51d

Please sign in to comment.