diff --git a/components/dashboard/src/components/AuthorizeGit.tsx b/components/dashboard/src/components/AuthorizeGit.tsx
index cc3669e6401664..d950eb9015c038 100644
--- a/components/dashboard/src/components/AuthorizeGit.tsx
+++ b/components/dashboard/src/components/AuthorizeGit.tsx
@@ -65,9 +65,9 @@ export const AuthorizeGit: FC<{ className?: string }> = ({ className }) => {
{!!org.data?.isOwner ? (
You need to configure at least one Git integration.
-
-
-
+
) : (
<>
diff --git a/components/dashboard/src/components/Button.tsx b/components/dashboard/src/components/Button.tsx
index 3a0bc0f379e1ca..49238f1eeb0495 100644
--- a/components/dashboard/src/components/Button.tsx
+++ b/components/dashboard/src/components/Button.tsx
@@ -7,6 +7,7 @@
import classNames from "classnames";
import { FC, ForwardedRef, ReactNode, forwardRef } from "react";
import { ReactComponent as SpinnerWhite } from "../icons/SpinnerWhite.svg";
+import { Link } from "react-router-dom";
export type ButtonProps = {
type?: "primary" | "secondary" | "danger" | "danger.secondary" | "transparent";
@@ -21,17 +22,19 @@ export type ButtonProps = {
icon?: ReactNode;
children?: ReactNode;
onClick?: ButtonOnClickHandler;
+ href?: string;
};
// Allow w/ or w/o handling event argument
type ButtonOnClickHandler = React.DOMAttributes["onClick"] | (() => void);
-export const Button = forwardRef(
+export const Button = forwardRef(
(
{
type = "primary",
className,
htmlType = "button",
+ href,
disabled = false,
loading = false,
autoFocus = false,
@@ -41,57 +44,62 @@ export const Button = forwardRef(
children,
onClick,
},
- ref: ForwardedRef,
+ ref: ForwardedRef,
) => {
- return (
-
- );
+ const commonProps = {
+ className: classNames(
+ "cursor-pointer my-auto",
+ "text-sm font-medium whitespace-nowrap",
+ "rounded-xl focus:outline-none focus:ring transition ease-in-out",
+ spacing === "compact" ? ["px-1 py-1"] : null,
+ spacing === "default" ? ["px-4 py-2"] : null,
+ type === "primary"
+ ? [
+ "bg-gray-900 hover:bg-gray-800 dark:bg-kumquat-base dark:hover:bg-kumquat-ripe",
+ "text-gray-50 dark:text-gray-900",
+ ]
+ : null,
+ type === "secondary"
+ ? [
+ "bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600",
+ "text-gray-500 dark:text-gray-100 hover:text-gray-600",
+ ]
+ : null,
+ type === "danger" ? ["bg-red-600 hover:bg-red-700", "text-gray-100 dark:text-red-100"] : null,
+ type === "danger.secondary"
+ ? [
+ "bg-red-50 dark:bg-red-300 hover:bg-red-100 dark:hover:bg-red-200",
+ "text-red-600 hover:text-red-700",
+ ]
+ : null,
+ type === "transparent"
+ ? [
+ "bg-transparent hover:bg-gray-600 hover:bg-opacity-10 dark:hover:bg-gray-200 dark:hover:bg-opacity-10",
+ ]
+ : null,
+ {
+ "w-full": size === "block",
+ "cursor-default opacity-50 pointer-events-none": disabled || loading,
+ },
+ className,
+ ),
+ children: {children}
+ };
+
+ if (href) {
+ return } to={href} {...commonProps} />;
+ } else {
+ return (
+