Replace home page with logged calls page
This commit is contained in:
2
app/@types/nextjs-routes.d.ts
vendored
2
app/@types/nextjs-routes.d.ts
vendored
@@ -22,8 +22,8 @@ declare module "nextjs-routes" {
|
|||||||
| StaticRoute<"/data">
|
| StaticRoute<"/data">
|
||||||
| DynamicRoute<"/experiments/[id]", { "id": string }>
|
| DynamicRoute<"/experiments/[id]", { "id": string }>
|
||||||
| StaticRoute<"/experiments">
|
| StaticRoute<"/experiments">
|
||||||
| StaticRoute<"/home">
|
|
||||||
| StaticRoute<"/">
|
| StaticRoute<"/">
|
||||||
|
| StaticRoute<"/logged-calls">
|
||||||
| StaticRoute<"/project/settings">
|
| StaticRoute<"/project/settings">
|
||||||
| StaticRoute<"/sentry-example-page">
|
| StaticRoute<"/sentry-example-page">
|
||||||
| StaticRoute<"/world-champs">
|
| StaticRoute<"/world-champs">
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import {
|
|||||||
import Head from "next/head";
|
import Head from "next/head";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { BsGearFill, BsGithub, BsPersonCircle } from "react-icons/bs";
|
import { BsGearFill, BsGithub, BsPersonCircle } from "react-icons/bs";
|
||||||
|
import { IoStatsChartOutline } from "react-icons/io5";
|
||||||
import { RiDatabase2Line, RiFlaskLine } from "react-icons/ri";
|
import { RiDatabase2Line, RiFlaskLine } from "react-icons/ri";
|
||||||
import { signIn, useSession } from "next-auth/react";
|
import { signIn, useSession } from "next-auth/react";
|
||||||
import UserMenu from "./UserMenu";
|
import UserMenu from "./UserMenu";
|
||||||
@@ -51,6 +52,7 @@ const NavSidebar = () => {
|
|||||||
<>
|
<>
|
||||||
<ProjectMenu />
|
<ProjectMenu />
|
||||||
<Divider />
|
<Divider />
|
||||||
|
<IconLink icon={IoStatsChartOutline} label="Logged Calls" href="/logged-calls" />
|
||||||
<IconLink icon={RiFlaskLine} label="Experiments" href="/experiments" />
|
<IconLink icon={RiFlaskLine} label="Experiments" href="/experiments" />
|
||||||
{env.NEXT_PUBLIC_SHOW_DATA && (
|
{env.NEXT_PUBLIC_SHOW_DATA && (
|
||||||
<IconLink icon={RiDatabase2Line} label="Data" href="/data" />
|
<IconLink icon={RiDatabase2Line} label="Data" href="/data" />
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { HStack, Flex, Text } from "@chakra-ui/react";
|
import { HStack, Flex, Text } from "@chakra-ui/react";
|
||||||
import Link from "next/link";
|
|
||||||
import { useSelectedOrg } from "~/utils/hooks";
|
import { useSelectedOrg } from "~/utils/hooks";
|
||||||
|
|
||||||
// Have to export only contents here instead of full BreadcrumbItem because Chakra doesn't
|
// Have to export only contents here instead of full BreadcrumbItem because Chakra doesn't
|
||||||
@@ -10,22 +9,20 @@ export default function ProjectBreadcrumbContents({ orgName = "" }: { orgName?:
|
|||||||
orgName = orgName || selectedOrg?.name || "";
|
orgName = orgName || selectedOrg?.name || "";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Link href="/home">
|
<HStack w="full">
|
||||||
<HStack w="full">
|
<Flex
|
||||||
<Flex
|
p={1}
|
||||||
p={1}
|
borderRadius={4}
|
||||||
borderRadius={4}
|
backgroundColor="orange.100"
|
||||||
backgroundColor="orange.100"
|
boxSize={6}
|
||||||
boxSize={6}
|
alignItems="center"
|
||||||
alignItems="center"
|
justifyContent="center"
|
||||||
justifyContent="center"
|
>
|
||||||
>
|
<Text>{orgName[0]?.toUpperCase()}</Text>
|
||||||
<Text>{orgName[0]?.toUpperCase()}</Text>
|
</Flex>
|
||||||
</Flex>
|
<Text display={{ base: "none", md: "block" }} py={1}>
|
||||||
<Text display={{ base: "none", md: "block" }} py={1}>
|
{orgName}
|
||||||
{orgName}
|
</Text>
|
||||||
</Text>
|
</HStack>
|
||||||
</HStack>
|
|
||||||
</Link>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ export default function ProjectMenu() {
|
|||||||
PROJECT
|
PROJECT
|
||||||
</Text>
|
</Text>
|
||||||
<NavSidebarOption activeHrefPattern="/home" disableHoverEffect={expandButtonHovered}>
|
<NavSidebarOption activeHrefPattern="/home" disableHoverEffect={expandButtonHovered}>
|
||||||
<Link href="/home">
|
<Link href="/logged-calls">
|
||||||
<HStack w="full" justifyContent="space-between">
|
<HStack w="full" justifyContent="space-between">
|
||||||
<HStack>
|
<HStack>
|
||||||
<Flex
|
<Flex
|
||||||
@@ -180,7 +180,7 @@ const ProjectOption = ({
|
|||||||
return (
|
return (
|
||||||
<HStack
|
<HStack
|
||||||
as={Link}
|
as={Link}
|
||||||
href="/home"
|
href="/logged-calls"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setSelectedOrgId(org.id);
|
setSelectedOrgId(org.id);
|
||||||
onClose();
|
onClose();
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export const DeleteProjectDialog = ({
|
|||||||
if (!selectedOrg.data?.id) return;
|
if (!selectedOrg.data?.id) return;
|
||||||
await deleteMutation.mutateAsync({ id: selectedOrg.data.id });
|
await deleteMutation.mutateAsync({ id: selectedOrg.data.id });
|
||||||
await utils.organizations.list.invalidate();
|
await utils.organizations.list.invalidate();
|
||||||
await router.push({ pathname: "/home" });
|
await router.push({ pathname: "/logged-calls" });
|
||||||
onClose();
|
onClose();
|
||||||
}, [deleteMutation, selectedOrg, router]);
|
}, [deleteMutation, selectedOrg, router]);
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { type GetServerSideProps } from "next";
|
|||||||
export const getServerSideProps: GetServerSideProps = async () => {
|
export const getServerSideProps: GetServerSideProps = async () => {
|
||||||
return {
|
return {
|
||||||
redirect: {
|
redirect: {
|
||||||
destination: "/home",
|
destination: "/logged-calls",
|
||||||
permanent: false,
|
permanent: false,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ import dayjs from "~/utils/dayjs";
|
|||||||
import { api } from "~/utils/api";
|
import { api } from "~/utils/api";
|
||||||
import LoggedCallTable from "~/components/dashboard/LoggedCallTable";
|
import LoggedCallTable from "~/components/dashboard/LoggedCallTable";
|
||||||
|
|
||||||
export default function HomePage() {
|
export default function LoggedCalls() {
|
||||||
const { data: selectedOrg } = useSelectedOrg();
|
const { data: selectedOrg } = useSelectedOrg();
|
||||||
|
|
||||||
const stats = api.dashboard.stats.useQuery(
|
const stats = api.dashboard.stats.useQuery(
|
||||||
@@ -65,7 +65,7 @@ export default function HomePage() {
|
|||||||
<ProjectBreadcrumbContents />
|
<ProjectBreadcrumbContents />
|
||||||
</BreadcrumbItem>
|
</BreadcrumbItem>
|
||||||
<BreadcrumbItem isCurrentPage>
|
<BreadcrumbItem isCurrentPage>
|
||||||
<Text>Homepage</Text>
|
<Text>Logged Calls</Text>
|
||||||
</BreadcrumbItem>
|
</BreadcrumbItem>
|
||||||
</Breadcrumb>
|
</Breadcrumb>
|
||||||
</PageHeaderContainer>
|
</PageHeaderContainer>
|
||||||
Reference in New Issue
Block a user