From 88e4b4ebb0ec4ce1a3f419e1338cabb93986f580 Mon Sep 17 00:00:00 2001
From: Henry
Date: Mon, 25 Nov 2024 22:04:39 +0000
Subject: [PATCH] feat: setup landing page
---
next.config.mjs | 19 -----
src/components/AuthForm.tsx | 2 +-
src/components/Button.tsx | 92 +++++++++++++-------
src/components/Dashboard.tsx | 37 +++++---
src/components/PatternedBackground.tsx | 13 +--
src/pages/_app.tsx | 5 +-
src/pages/index.tsx | 5 ++
src/styles/globals.css | 17 ++++
src/views/board/components/Filters.tsx | 2 +-
src/views/home/index.tsx | 113 +++++++++++++++++++++++++
tailwind.config.ts | 29 +++++--
11 files changed, 247 insertions(+), 87 deletions(-)
create mode 100644 src/pages/index.tsx
create mode 100644 src/views/home/index.tsx
diff --git a/next.config.mjs b/next.config.mjs
index 3cb5e494..507dd7c7 100644
--- a/next.config.mjs
+++ b/next.config.mjs
@@ -8,25 +8,6 @@ await import("./src/env.mjs");
/** @type {import("next").NextConfig} */
const config = {
reactStrictMode: false,
- images: {
- remotePatterns: [
- {
- protocol: "https",
- hostname: "storage.googleapis.com",
- port: "",
- pathname: "/**",
- },
- ],
- },
- redirects: async () => {
- return [
- {
- source: "/",
- destination: "/boards",
- permanent: true,
- },
- ];
- },
};
export default config;
diff --git a/src/components/AuthForm.tsx b/src/components/AuthForm.tsx
index e8b7c80f..3fed355b 100644
--- a/src/components/AuthForm.tsx
+++ b/src/components/AuthForm.tsx
@@ -74,7 +74,7 @@ export function Auth({ setIsMagicLinkSent }: AuthProps) {
Please enter a valid email address
)}
- {loginWithEmail.error ?? loginWithOAuth.error ? (
+ {(loginWithEmail.error ?? loginWithOAuth.error) ? (
Something went wrong, please try again later or contact customer
support.
diff --git a/src/components/Button.tsx b/src/components/Button.tsx
index 501b1e92..ff2c1168 100644
--- a/src/components/Button.tsx
+++ b/src/components/Button.tsx
@@ -1,3 +1,4 @@
+import Link from "next/link";
import { twMerge } from "tailwind-merge";
import LoadingSpinner from "./LoadingSpinner";
@@ -5,52 +6,79 @@ interface ButtonProps extends React.ButtonHTMLAttributes {
variant?: "primary" | "secondary" | "danger" | "ghost";
size?: "sm" | "md" | "lg";
isLoading?: boolean;
- icon?: React.ReactNode;
+ iconLeft?: React.ReactNode;
+ iconRight?: React.ReactNode;
+ href?: string;
+ openInNewTab?: boolean;
}
const Button = ({
children,
size = "md",
- icon,
+ iconLeft,
+ iconRight,
isLoading,
variant = "primary",
+ href,
+ openInNewTab,
...props
}: ButtonProps) => {
+ const classes = twMerge(
+ "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-2 text-sm font-semibold text-light-50 shadow-sm focus-visible:outline-none",
+ size === "sm" && "text-xs",
+ size === "lg" && "px-4 py-3 text-lg",
+ variant === "primary" &&
+ "bg-light-1000 dark:bg-dark-1000 dark:text-dark-50",
+ variant === "secondary" &&
+ "border-[1px] border-light-600 bg-light-50 text-light-1000 dark:border-dark-600 dark:bg-dark-300 dark:text-dark-1000",
+ variant === "danger" &&
+ "dark:text-red-1000 border-[1px] border-red-600 bg-red-50 dark:border-red-600 dark:bg-red-500",
+ variant === "ghost" &&
+ "bg-none text-light-1000 shadow-none hover:bg-light-300 dark:text-dark-1000 dark:hover:bg-dark-200",
+ props.disabled && "opacity-50",
+ );
+
+ const content = (
+
+ {isLoading && (
+
+
+
+ )}
+
+ {iconLeft && {iconLeft}}
+ {children}
+ {iconRight && {iconRight}}
+
+
+ );
+
+ if (href) {
+ return (
+ )}
+ >
+ {content}
+
+ );
+ }
+
return (
);
};
diff --git a/src/components/Dashboard.tsx b/src/components/Dashboard.tsx
index f6d4a46e..970e36d4 100644
--- a/src/components/Dashboard.tsx
+++ b/src/components/Dashboard.tsx
@@ -1,3 +1,4 @@
+import Link from "next/link";
import { api } from "~/utils/api";
import SideNavigation from "./SideNavigation";
import FeedbackButton from "./FeedbackButton";
@@ -6,20 +7,30 @@ export default function Dashboard(props: { children: React.ReactNode }) {
const { data, isLoading } = api.auth.getUser.useQuery();
return (
-
-
-
-
- kan.bn
-
-
+ <>
+
+
-
-
-
+ >
);
}
diff --git a/src/components/PatternedBackground.tsx b/src/components/PatternedBackground.tsx
index 346edcd9..6304f95e 100644
--- a/src/components/PatternedBackground.tsx
+++ b/src/components/PatternedBackground.tsx
@@ -1,15 +1,6 @@
const PatternedBackground = () => (
-
-