Skip to content

Commit

Permalink
add clone repo button
Browse files Browse the repository at this point in the history
  • Loading branch information
d-ivashchuk committed Apr 5, 2024
1 parent d7df681 commit 1dca911
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 28 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"superjson": "^2.2.1",
"tailwind-merge": "^2.2.2",
"tailwindcss-animate": "^1.0.7",
"usehooks-ts": "^3.1.0",
"uvcanvas": "^0.2.1",
"zod": "^3.22.4"
},
Expand Down
62 changes: 37 additions & 25 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions src/app/(landing)/clone-repo-badge.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"use client";
import React from "react";
import { toast } from "sonner";
import { useCopyToClipboard } from "usehooks-ts";
import { Badge } from "~/components/ui/badge";

const CloneRepoBadge = () => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [_, copy] = useCopyToClipboard();
const cloneText = "git clone https://github.com/d-ivashchuk/cascade.git";
return (
<Badge
className="mx-auto mt-4 cursor-pointer px-4 py-2"
style={{
width: "fit-content",
}}
onClick={async () => {
await copy(cloneText);
toast.success("Copied to clipboard");
}}
>
<pre>{cloneText}</pre>
</Badge>
);
};

export default CloneRepoBadge;
12 changes: 9 additions & 3 deletions src/app/(landing)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
SiTailwindcss,
SiTrpc,
} from "@icons-pack/react-simple-icons";
import { useCopyToClipboard } from "usehooks-ts";

import { type Metadata } from "next";

Expand All @@ -21,12 +22,15 @@ import { Alert, AlertTitle, AlertDescription } from "~/components/ui/alert";
import { Separator } from "~/components/ui/separator";
import Image from "next/image";
import VideoComponent from "./video-component";
import { Badge } from "~/components/ui/badge";
import { toast } from "sonner";
import CloneRepoBadge from "./clone-repo-badge";

export const metadata: Metadata = {
title: "Cascade - open-source SaaS boilerplate",
title: "Cascade - free open-source SaaS boilerplate",
description:
"Kickstart your SaaS project with Cascade - open-source SaaS boilerplate. Payments, error tracking, analytics, background jobs, email marketing. All in one package.",
icons: { aslk: 123 },
icons: [{ rel: "icon", url: "/favicon.ico" }],
openGraph: {
url: "https://cascade.stackonfire.com",
title: "Cascade - open-source SaaS boilerplate",
Expand Down Expand Up @@ -91,7 +95,8 @@ export default function Home() {
<div className="mb-4">
<h1 className="mb-2 text-4xl font-bold uppercase">Cascade</h1>
<h2 className="text-xl text-muted-foreground">
Setup production grade SaaS project in minutes instead of days
Free and <b>open-source</b> SaaS boilerplate. <br /> Start writing
your business logic from day 1.
</h2>
</div>
<div className="flex gap-2 self-center align-middle">
Expand All @@ -104,6 +109,7 @@ export default function Home() {
</Button>
</Link>
</div>
<CloneRepoBadge />
</div>
<div className="mx-auto max-w-5xl">
<div className="mx-auto mt-4 inline-flex w-full flex-nowrap overflow-hidden [mask-image:_linear-gradient(to_right,transparent_0,_black_128px,_black_calc(100%-200px),transparent_100%)]">
Expand Down

0 comments on commit 1dca911

Please sign in to comment.