-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
59 additions
and
20 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
import Icon, {type Props as IconProps} from "./Icon.astro"; | ||
type Props = Pick<IconProps, "iconClasses" >; | ||
const {iconClasses} = Astro.props; | ||
--- | ||
|
||
<Icon pack="mdi" name="github" iconClasses={iconClasses}/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
import { Icon as AstroIcon } from "astro-icon"; | ||
export type Props = { | ||
pack: string; | ||
name: string; | ||
iconClasses?: string[]; | ||
}; | ||
const { pack, name, iconClasses } = Astro.props; | ||
const classes = ["w-10"] | ||
if (iconClasses !== undefined) | ||
classes.push(...iconClasses) | ||
--- | ||
|
||
<AstroIcon class={classes.join(" ")} pack={pack} name={name} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
import Icon, { type Props as IconProps } from "./Icon.astro"; | ||
type Props = Pick<IconProps, "iconClasses">; | ||
const { iconClasses } = Astro.props; | ||
--- | ||
|
||
<Icon pack="mdi" name="laravel" iconClasses={iconClasses} />``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
--- | ||
import { Icon as AstroIcon } from "astro-icon"; | ||
import Github from "./Github.astro"; | ||
import Laravel from "./Laravel.astro"; | ||
import type { Props as IconProps } from "./Icon.astro"; | ||
export type Props = { | ||
pack: string; | ||
name: string; | ||
iconClasses?: string[]; | ||
const icons = { | ||
github: Github, | ||
laravel: Laravel, | ||
}; | ||
const { pack, name, iconClasses } = Astro.props; | ||
const classes = ["w-10"] | ||
type Props = { | ||
name: keyof typeof icons; | ||
iconClasses: IconProps["iconClasses"]; | ||
}; | ||
if (iconClasses !== undefined) | ||
classes.push(...iconClasses) | ||
const { name, iconClasses } = Astro.props; | ||
const Tag = icons[name]; | ||
--- | ||
|
||
<AstroIcon class={classes.join(" ")} pack={pack} name={name} /> | ||
<Tag iconClasses={iconClasses} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters