mirror of
https://github.com/10h30/astroplate.git
synced 2026-06-05 15:08:00 +09:00
update Button shortcode
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "astroplate",
|
"name": "astroplate",
|
||||||
"version": "1.2.1",
|
"version": "1.2.2",
|
||||||
"description": "Astro and Tailwindcss boilerplate",
|
"description": "Astro and Tailwindcss boilerplate",
|
||||||
"author": "zeon.studio",
|
"author": "zeon.studio",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ window.addEventListener("load", (e) => {
|
|||||||
|
|
||||||
### Button
|
### Button
|
||||||
|
|
||||||
<Button href="#" style="solid">Button</Button>
|
<Button label="Button" link="#" style="solid"/>
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
const Button = ({
|
const Button = ({
|
||||||
href,
|
label,
|
||||||
|
link,
|
||||||
style,
|
style,
|
||||||
rel,
|
rel,
|
||||||
children,
|
|
||||||
}: {
|
}: {
|
||||||
href: string;
|
label: string;
|
||||||
style: string | null;
|
link: string;
|
||||||
rel: string | null;
|
style?: string;
|
||||||
children: string;
|
rel?: string;
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<a
|
<a
|
||||||
href={href}
|
href={link}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel={`noopener noreferrer ${
|
rel={`noopener noreferrer ${
|
||||||
rel ? (rel === "follow" ? "" : rel) : "nofollow"
|
rel ? (rel === "follow" ? "" : rel) : "nofollow"
|
||||||
@@ -22,7 +22,7 @@ const Button = ({
|
|||||||
style === "outline" ? "btn-outline-primary" : "btn-primary"
|
style === "outline" ? "btn-outline-primary" : "btn-primary"
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
{children}
|
{label}
|
||||||
</a>
|
</a>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user