Skip to content

Commit

Permalink
Merge branch 'main-lacra' into dev-01
Browse files Browse the repository at this point in the history
  • Loading branch information
mgunnin authored Aug 6, 2023
2 parents cd46e02 + a74d3d6 commit 4edc91e
Show file tree
Hide file tree
Showing 8 changed files with 171 additions and 165 deletions.
118 changes: 59 additions & 59 deletions ui/app/_components/appbody.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";
import NextLink from "next/link";
import { usePathname } from "next/navigation";
"use client"
import NextLink from "next/link"
import { usePathname } from "next/navigation"
import {
Box,
Button,
Expand All @@ -10,21 +10,21 @@ import {
Tag,
Text,
useColorMode,
} from "@chakra-ui/react";
} from "@chakra-ui/react"
import {
AppShell,
Sidebar,
SidebarToggleButton,
SidebarSection,
NavGroup,
} from '@saas-ui/react'
import { SUPERAGENT_VERSION } from "../../lib/constants";
import { FOOTER_MENU, MAIN_MENU } from "../../lib/sidebar-menu";
import { TbMoon, TbSun } from "react-icons/tb";
} from "@saas-ui/react"
import { LACRALABS_VERSION } from "../../lib/constants"
import { FOOTER_MENU, MAIN_MENU } from "../../lib/sidebar-menu"
import { TbMoon, TbSun } from "react-icons/tb"

function MenuLink({ label, icon, path, ...properties }) {
const pathname = usePathname();
const isActive = pathname == path;
const pathname = usePathname()
const isActive = pathname == path

return (
<Box as={path && NextLink} passHref href={path} width="100%">
Expand All @@ -39,12 +39,12 @@ function MenuLink({ label, icon, path, ...properties }) {
marginY={"0.5"}
size="md"
variant="ghost"
opacity={isActive ? "1": "0.7"}
opacity={isActive ? "1" : "0.7"}
>
{label}
</Button>
</Box>
);
)
}

export default function AppBody({ children, session }) {
Expand All @@ -56,59 +56,59 @@ export default function AppBody({ children, session }) {
maxH="100vh"
overflow="hidden"
sidebar={
session &&
<Sidebar>
<SidebarToggleButton />
<SidebarSection direction="row">
<HStack width="full" justifyContent="space-between" paddingX="2">
<Text as="strong" fontSize="2xl">
Superagent
</Text>
<Spacer />
<Tag size="sm">{SUPERAGENT_VERSION}</Tag>
</HStack>
</SidebarSection>
<SidebarSection flex="1" overflowY="auto" paddingTop={2}>
<NavGroup>
{MAIN_MENU.map(({ icon, id, label, path, ...properties }) => (
<MenuLink
key={id}
label={label}
icon={icon}
path={path}
{...properties}
/>
))}
</NavGroup>

</SidebarSection>
<SidebarSection>
<MenuLink
onClick={(e) => {
e.preventDefault()
toggleColorMode()
}}
icon={colorMode === 'dark' ? TbSun : TbMoon}
label={colorMode === 'dark' ? 'Light mode' : 'Dark mode'}
/>
{FOOTER_MENU.filter(
({ id }) =>
process.env.NEXT_PUBLIC_STRIPE_SECRET_KEY || id !== "billing"
).map(({ icon, id, label, path, ...properties }) => (
session && (
<Sidebar>
<SidebarToggleButton />
<SidebarSection direction="row">
<HStack width="full" justifyContent="space-between" paddingX="2">
<Text as="strong" fontSize="2xl">
Lacra Labs
</Text>
<Spacer />
<Tag size="sm">{LACRALABS_VERSION}</Tag>
</HStack>
</SidebarSection>
<SidebarSection flex="1" overflowY="auto" paddingTop={2}>
<NavGroup>
{MAIN_MENU.map(({ icon, id, label, path, ...properties }) => (
<MenuLink
key={id}
label={label}
icon={icon}
path={path}
{...properties}
/>
))}
</NavGroup>
</SidebarSection>
<SidebarSection>
<MenuLink
onClick={(e) => {
e.preventDefault()
toggleColorMode()
}}
icon={colorMode === "dark" ? TbSun : TbMoon}
label={colorMode === "dark" ? "Light mode" : "Dark mode"}
/>
{FOOTER_MENU.filter(
({ id }) =>
process.env.NEXT_PUBLIC_STRIPE_SECRET_KEY || id !== "billing"
).map(({ icon, id, label, path, ...properties }) => (
<MenuLink
label={label}
icon={icon}
path={path}
{...properties}
/>
))}
</SidebarSection>
</Sidebar>
</SidebarSection>
</Sidebar>
)
}
>
<Box as="main" flex="1" overflowY="auto">
{children}
</Box>
</AppShell>
);
>
<Box as="main" flex="1" overflowY="auto">
{children}
</Box>
</AppShell>
)
}
22 changes: 11 additions & 11 deletions ui/app/_components/main-nav.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"use client";
"use client"
import {
Button,
HStack,
Expand All @@ -7,27 +7,27 @@ import {
Tag,
Text,
useColorModeValue,
} from "@chakra-ui/react";
import NextLink from "next/link";
import { TbArrowRight } from "react-icons/tb";
import { SUPERAGENT_VERSION } from "@/lib/constants";
} from "@chakra-ui/react"
import NextLink from "next/link"
import { TbArrowRight } from "react-icons/tb"
import { LACRALABS_VERSION } from "@/lib/constants"

export default function MainNav() {
const fontColor = useColorModeValue("white", "dark");
const fontColor = useColorModeValue("white", "dark")

return (
<HStack paddingY={6} justifyContent="space-between">
<HStack spacing={4}>
<Text as="strong" color={fontColor} fontSize="lg">
Superagent
Lacra Labs
</Text>
<Tag size="sm">{SUPERAGENT_VERSION}</Tag>
<Tag size="sm">{LACRALABS_VERSION}</Tag>
</HStack>
<HStack spacing={4} display={{ base: "none", md: "flex" }}>
<Link href="https://discord.gg/mhmJUTjW4b" color={fontColor}>
<Link href="https://discord.gg/e1" color={fontColor}>
Discord
</Link>
<Link href="https://github.com/homanp/superagent" color={fontColor}>
<Link href="https://github.com/mgunnin/superagent" color={fontColor}>
Github
</Link>
<Link
Expand All @@ -50,5 +50,5 @@ export default function MainNav() {
</NextLink>
</HStack>
</HStack>
);
)
}
17 changes: 9 additions & 8 deletions ui/app/client-page.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use client";
import NextLink from "next/link";
"use client"
import NextLink from "next/link"
import {
Alert,
Container,
Expand All @@ -10,7 +10,7 @@ import {
Tag,
Text,
useColorModeValue,
} from "@chakra-ui/react";
} from "@chakra-ui/react"

export default function HomeClientPage() {
return (
Expand All @@ -29,15 +29,16 @@ export default function HomeClientPage() {
borderWidth="1px"
borderRadius="md"
>
Superagent is in public beta, expect rapid updates. All feedback
appreciated.
Lacra Labs is reimagining the future of Athletics using AI Agents. We
are in early alpha so expect rapid updates. To get access, join our{" "}
<Link href="https://discord.gg/e1">Discord Server</Link>
</Alert>
<Stack>
<HStack>
<Heading as="h1" fontSize="2xl">
Superagent
Lacra Labs
</Heading>
<Tag size="sm">Beta</Tag>
<Tag size="sm">Alpha</Tag>
</HStack>
<Text>
Superagent is a platform that enables you to create, manage and run
Expand Down Expand Up @@ -81,5 +82,5 @@ export default function HomeClientPage() {
</Text>
</Stack>
</Container>
);
)
}
46 changes: 23 additions & 23 deletions ui/app/login/page.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use client";
import NextLink from "next/link";
"use client"
import NextLink from "next/link"
import {
Button,
Container,
Expand All @@ -16,50 +16,50 @@ import {
Divider,
Box,
AbsoluteCenter,
} from "@chakra-ui/react";
import { signIn } from "next-auth/react";
import { useForm } from "react-hook-form";
import { useSession } from "next-auth/react";
import { SUPERAGENT_VERSION } from "@/lib/constants";
import { FaGithub, FaMicrosoft, FaGoogle } from "react-icons/fa6";
import { analytics } from "@/lib/analytics";
} from "@chakra-ui/react"
import { signIn } from "next-auth/react"
import { useForm } from "react-hook-form"
import { useSession } from "next-auth/react"
import { LACRALABS_VERSION } from "@/lib/constants"
import { FaGithub, FaMicrosoft, FaGoogle } from "react-icons/fa6"
import { analytics } from "@/lib/analytics"

export default function Login() {
const hasOauthOptions =
process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID ||
process.env.NEXT_PUBLIC_GITHUB_CLIENT_ID ||
process.env.NEXT_PUBLIC_AZURE_AD_CLIENT_ID;
const session = useSession();
process.env.NEXT_PUBLIC_AZURE_AD_CLIENT_ID
const session = useSession()
if (session.data) {
window.location.href = "/";
window.location.href = "/"
}
const backgroundColor = useColorModeValue("#fff", "#131416");
const backgroundColor = useColorModeValue("#fff", "#131416")
const {
formState: { isSubmitting, errors },
register,
handleSubmit,
} = useForm();
} = useForm()
const onSubmit = async (data) => {
if (process.env.NEXT_PUBLIC_SEGMENT_WRITE_KEY) {
analytics.track("Signed In");
analytics.track("Signed In")
}

await signIn("credentials", {
...data,
redirect: true,
callbackUrl: "/",
});
};
})
}

const handleOAuth = async (providerId) => {
if (process.env.NEXT_PUBLIC_SEGMENT_WRITE_KEY) {
analytics.track("Signed In");
analytics.track("Signed In")
}
await signIn(providerId, {
redirect: true,
callbackUrl: "/",
});
};
})
}

return (
<Container
Expand All @@ -72,9 +72,9 @@ export default function Login() {
<Stack spacing={8} minHeight="100vh" justifyContent="center">
<HStack spacing={4} justifyContent="center" alignItems="center">
<Text as="strong" fontSize="2xl">
Superagent
Lacra Labs
</Text>
<Tag size="sm">{SUPERAGENT_VERSION}</Tag>
<Tag size="sm">{LACRALABS_VERSION}</Tag>
</HStack>

<Stack>
Expand Down Expand Up @@ -157,5 +157,5 @@ export default function Login() {
</Stack>
</Stack>
</Container>
);
)
}
9 changes: 7 additions & 2 deletions ui/app/page.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
// This code imports the HomeClientPage component from the client-page file.
// This component contains the landing page for the client.
// The metadata object contains the title and description of the landing page.
// The Dashboard component returns the HomeClientPage component.

import HomeClientPage from "./client-page";

export const metadata = {
title: "Home | Superagent",
description: "Build, deploy and manage AI Agents in seconds",
title: "Home | Lacra Labs",
description: "Be the future of AI Athletes.",
};

export default async function Dashboard() {
Expand Down
Loading

0 comments on commit 4edc91e

Please sign in to comment.