Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
fix: button to allow props like target (#272)
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno-keiko authored Oct 4, 2024
1 parent dde830e commit b592035
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/Button.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import Link from "next/link";
import classNames from "@/utils/classNames";

export default function Button({ url, type = "primary", children }) {
export default function Button({ url, type = "primary", children, ...props }) {
return (
<Link
href={url}
{...props}
className={classNames(
"inline-flex items-center gap-x-2 rounded-md px-3.5 py-2.5 text-sm font-semibold shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2",
type === "primary" &&
Expand Down
2 changes: 1 addition & 1 deletion src/components/Heading.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function Heading({ title, actions = [], extras = [] }) {
<div className="mt-5 flex lg:ml-4 lg:mt-0">
{actions.map((action) => (
<span className="sm:ml-3" key={action.icon}>
<Button url={action.url}>
<Button url={action.url} target="_blank">
<action.icon
aria-hidden="true"
className="-ml-0.5 mr-1.5 h-5 w-5"
Expand Down

0 comments on commit b592035

Please sign in to comment.