From a905f24d0ed71101b2051b61f5f6798401b5d3af Mon Sep 17 00:00:00 2001 From: Mckay Wrigley Date: Sun, 21 Jan 2024 12:29:08 -0700 Subject: [PATCH] Revert "first commit" This reverts commit 5f973b28bf5dd8923e79e003e4644018de4911f0. --- README.md | 1 - app/[locale]/help/page.tsx | 2 +- app/[locale]/loading.tsx | 4 +- app/[locale]/login/page.tsx | 16 +- app/[locale]/page.tsx | 194 ++---------------- components/chat/chat-files-display.tsx | 4 +- components/chat/chat-help.tsx | 2 +- components/messages/message-replies.tsx | 2 +- components/sidebar/sidebar-create-buttons.tsx | 2 +- components/ui/accordion.tsx | 2 +- components/ui/avatar.tsx | 6 +- components/ui/button.tsx | 2 +- components/ui/calendar.tsx | 8 +- components/ui/checkbox.tsx | 4 +- components/ui/command.tsx | 6 +- components/ui/context-menu.tsx | 10 +- components/ui/dashboard.tsx | 4 +- components/ui/dropdown-menu.tsx | 10 +- components/ui/menubar.tsx | 10 +- components/ui/navigation-menu.tsx | 4 +- components/ui/progress.tsx | 2 +- components/ui/radio-group.tsx | 4 +- components/ui/screen-loader.tsx | 4 +- components/ui/scroll-area.tsx | 2 +- components/ui/select.tsx | 10 +- components/ui/slider.tsx | 2 +- components/ui/switch.tsx | 2 +- components/ui/toast.tsx | 2 +- components/utility/alerts.tsx | 2 +- components/utility/workspace-switcher.tsx | 2 +- lib/export.ts | 21 -- package.json | 4 +- supabase/config.toml | 2 +- 33 files changed, 78 insertions(+), 274 deletions(-) delete mode 100644 lib/export.ts diff --git a/README.md b/README.md index 5052261305..ea1e1edda8 100644 --- a/README.md +++ b/README.md @@ -256,4 +256,3 @@ We are working on a guide for contributing. ## Contact Message Mckay on [Twitter/X](https://twitter.com/mckaywrigley) -# chatbot-ui diff --git a/app/[locale]/help/page.tsx b/app/[locale]/help/page.tsx index c1753f460b..26a283e7b3 100644 --- a/app/[locale]/help/page.tsx +++ b/app/[locale]/help/page.tsx @@ -1,6 +1,6 @@ export default function HelpPage() { return ( -
+
Help under construction.
) diff --git a/app/[locale]/loading.tsx b/app/[locale]/loading.tsx index 4cfc63fdec..e88ca3e47c 100644 --- a/app/[locale]/loading.tsx +++ b/app/[locale]/loading.tsx @@ -2,8 +2,8 @@ import { IconLoader2 } from "@tabler/icons-react" export default function Loading() { return ( -
- +
+
) } diff --git a/app/[locale]/login/page.tsx b/app/[locale]/login/page.tsx index 5571994655..2ee092aac2 100644 --- a/app/[locale]/login/page.tsx +++ b/app/[locale]/login/page.tsx @@ -62,22 +62,18 @@ export default async function Login({ const email = formData.get("email") as string const password = formData.get("password") as string - const emailDomainWhitelist = - process.env.EMAIL_DOMAIN_WHITELIST?.split(",") ?? [] - if ( - emailDomainWhitelist.length > 0 && - !emailDomainWhitelist.includes(email.split("@")[1]) - ) { + const emailDomainWhitelist = process.env.EMAIL_DOMAIN_WHITELIST?.split(",") ?? [] + if (emailDomainWhitelist.length > 0 && !emailDomainWhitelist.includes(email.split("@")[1])) { return redirect( - `/login?message=Email ${email} is not allowed to sign up.` + `/login?message=Email ${email} is not allowed to sign up.` ) } const emailWhitelist = process.env.EMAIL_WHITELIST?.split(",") ?? [] if (emailWhitelist.length > 0 && !emailWhitelist.includes(email)) { - return redirect( - `/login?message=Email ${email} is not allowed to sign up.` - ) + return redirect( + `/login?message=Email ${email} is not allowed to sign up.` + ) } const cookieStore = cookies() diff --git a/app/[locale]/page.tsx b/app/[locale]/page.tsx index 8abe5a9aff..2aee8e483e 100644 --- a/app/[locale]/page.tsx +++ b/app/[locale]/page.tsx @@ -1,198 +1,28 @@ "use client" import { ChatbotUISVG } from "@/components/icons/chatbotui-svg" -import { ThemeSwitcher } from "@/components/utility/theme-switcher" -import { exportLocalStorageAsJSON } from "@/lib/export" -import { - IconBrandGithub, - IconBrandX, - IconFileDownload, - IconStarFilled, - IconVideo -} from "@tabler/icons-react" +import { IconArrowRight } from "@tabler/icons-react" import { useTheme } from "next-themes" import Link from "next/link" -import { useEffect, useState } from "react" export default function HomePage() { const { theme } = useTheme() - const [stars, setStars] = useState(19000) - - useEffect(() => { - getGitHubRepoStars() - }, []) - - const getGitHubRepoStars = async () => { - const url = `https://api.github.com/repos/mckaywrigley/chatbot-ui` - - try { - const response = await fetch(url, { - headers: { - Accept: "application/vnd.github.v3+json" - } - }) - - if (!response.ok) { - throw new Error(`Error: ${response.status}`) - } - - const data = await response.json() - setStars(data.stargazers_count) - } catch (error) { - console.error("Failed to fetch GitHub stars:", error) - return 0 - } - } - return ( -
-
-
-
- -
- -
- Chatbot UI -
-
- -
-
- - About - - - {/* - Updates - - - - Docs - */} - - - Contact - -
- -
- - Demo - - - - {/* - Login - */} -
-
+
+
+
-
-
-
The
-
open-source
-
AI chat app
-
for everyone.
-
- -
- - - -
{stars.toLocaleString()} GitHub
- - - {/* - Start Chatting - - */} -
-
+
Chatbot UI
-
-
- - - -
- -
- Built by - - Takeoff AI - -
- -
- - - - - - - -
-
+ + Start Chatting + +
) } diff --git a/components/chat/chat-files-display.tsx b/components/chat/chat-files-display.tsx index 52e95bffd7..36fbea259e 100644 --- a/components/chat/chat-files-display.tsx +++ b/components/chat/chat-files-display.tsx @@ -141,7 +141,7 @@ export const ChatFilesDisplay: FC = ({}) => { /> { e.stopPropagation() setNewMessageImages( @@ -208,7 +208,7 @@ export const ChatFilesDisplay: FC = ({}) => {
{ e.stopPropagation() setNewMessageFiles( diff --git a/components/chat/chat-help.tsx b/components/chat/chat-help.tsx index fc578ee18d..f99e7a5c6f 100644 --- a/components/chat/chat-help.tsx +++ b/components/chat/chat-help.tsx @@ -27,7 +27,7 @@ export const ChatHelp: FC = ({}) => { return ( - + diff --git a/components/messages/message-replies.tsx b/components/messages/message-replies.tsx index e9dd75b67d..7daf2a6b1a 100644 --- a/components/messages/message-replies.tsx +++ b/components/messages/message-replies.tsx @@ -29,7 +29,7 @@ export const MessageReplies: FC = ({}) => { onClick={() => setIsOpen(true)} > -
+
{1}
diff --git a/components/sidebar/sidebar-create-buttons.tsx b/components/sidebar/sidebar-create-buttons.tsx index 9fc871bcdd..acc2cdfdbe 100644 --- a/components/sidebar/sidebar-create-buttons.tsx +++ b/components/sidebar/sidebar-create-buttons.tsx @@ -98,7 +98,7 @@ export const SidebarCreateButtons: FC = ({ {hasData && ( - )} diff --git a/components/ui/accordion.tsx b/components/ui/accordion.tsx index 791ca2c78c..d360b22470 100644 --- a/components/ui/accordion.tsx +++ b/components/ui/accordion.tsx @@ -34,7 +34,7 @@ const AccordionTrigger = React.forwardRef< {...props} > {children} - + )) diff --git a/components/ui/avatar.tsx b/components/ui/avatar.tsx index 1cf1283528..e6a93ce078 100644 --- a/components/ui/avatar.tsx +++ b/components/ui/avatar.tsx @@ -12,7 +12,7 @@ const Avatar = React.forwardRef< (({ className, ...props }, ref) => ( )) @@ -39,7 +39,7 @@ const AvatarFallback = React.forwardRef< , - IconRight: ({ ...props }) => + IconLeft: ({ ...props }) => , + IconRight: ({ ...props }) => }} {...props} /> diff --git a/components/ui/checkbox.tsx b/components/ui/checkbox.tsx index 6abd7f87e7..ff148f2d23 100644 --- a/components/ui/checkbox.tsx +++ b/components/ui/checkbox.tsx @@ -13,7 +13,7 @@ const Checkbox = React.forwardRef< - + )) diff --git a/components/ui/command.tsx b/components/ui/command.tsx index bf47537f5c..ea9f817bca 100644 --- a/components/ui/command.tsx +++ b/components/ui/command.tsx @@ -15,7 +15,7 @@ const Command = React.forwardRef< { return ( - + {children} @@ -42,7 +42,7 @@ const CommandInput = React.forwardRef< React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => (
- + {children} - + )) ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName @@ -102,9 +102,9 @@ const ContextMenuCheckboxItem = React.forwardRef< checked={checked} {...props} > - + - + {children} @@ -125,9 +125,9 @@ const ContextMenuRadioItem = React.forwardRef< )} {...props} > - + - + {children} diff --git a/components/ui/dashboard.tsx b/components/ui/dashboard.tsx index 7774c269de..faf2d8aea8 100644 --- a/components/ui/dashboard.tsx +++ b/components/ui/dashboard.tsx @@ -68,12 +68,12 @@ export const Dashboard: FC = ({ children }) => { } return ( -
+