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 ( + - + View Usage → + diff --git a/components/dashboard/src/projects/Projects.tsx b/components/dashboard/src/projects/Projects.tsx index 6e5924a3108ee5..a03ba1f02702de 100644 --- a/components/dashboard/src/projects/Projects.tsx +++ b/components/dashboard/src/projects/Projects.tsx @@ -20,6 +20,7 @@ import projectsEmpty from "../images/projects-empty.svg"; import { ThemeContext } from "../theme-context"; import { ProjectListItem } from "./ProjectListItem"; import { projectsPathNew } from "./projects.routes"; +import { Button } from "../components/Button"; export default function ProjectsPage() { const history = useHistory(); @@ -82,13 +83,11 @@ export default function ProjectsPage() {

- - - + {team && ( - - - + )}
@@ -113,9 +112,9 @@ export default function ProjectsPage() {
{team && ( - - - + )}
- {tokens.length > 0 && ( - - - - )} + {tokens.length > 0 && } {errorMsg.length > 0 && ( @@ -233,9 +229,7 @@ function ListAccessTokensView() { Generate an access token for applications that need access to the Gitpod API.{" "} - - - + ) : ( <> diff --git a/components/dashboard/src/workspaces/EmptyWorkspacesContent.tsx b/components/dashboard/src/workspaces/EmptyWorkspacesContent.tsx index 0b81eb15c0cc77..144ca57efc4c5f 100644 --- a/components/dashboard/src/workspaces/EmptyWorkspacesContent.tsx +++ b/components/dashboard/src/workspaces/EmptyWorkspacesContent.tsx @@ -4,7 +4,6 @@ * See License.AGPL.txt in the project root for license information. */ -import { Link } from "react-router-dom"; import { Heading2 } from "../components/typography/headings"; import { StartWorkspaceModalKeyBinding } from "../App"; import { Button } from "../components/Button"; @@ -30,12 +29,10 @@ export const EmptyWorkspacesContent = () => { - - - + diff --git a/components/dashboard/src/workspaces/WorkspacesSearchBar.tsx b/components/dashboard/src/workspaces/WorkspacesSearchBar.tsx index 9ac0431e5fdccf..2437de868f5b81 100644 --- a/components/dashboard/src/workspaces/WorkspacesSearchBar.tsx +++ b/components/dashboard/src/workspaces/WorkspacesSearchBar.tsx @@ -5,7 +5,6 @@ */ import { FunctionComponent } from "react"; -import { Link } from "react-router-dom"; import { StartWorkspaceModalKeyBinding } from "../App"; import DropDown from "../components/DropDown"; import search from "../icons/search.svg"; @@ -67,11 +66,9 @@ export const WorkspacesSearchBar: FunctionComponent = ]} /> - - - + ); };