update Button shortcode

This commit is contained in:
somrat sorkar
2023-05-29 11:59:38 +06:00
parent a945dbff77
commit 2be55dbca4
3 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -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",
+1 -1
View File
@@ -134,7 +134,7 @@ window.addEventListener("load", (e) => {
### Button ### Button
<Button href="#" style="solid">Button</Button> <Button label="Button" link="#" style="solid"/>
--- ---
+8 -8
View File
@@ -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>
); );
}; };