Skip to content

Commit

Permalink
Correctly structured into molecules and organisms components
Browse files Browse the repository at this point in the history
  • Loading branch information
anoopkarnik committed Jun 24, 2024
1 parent b219feb commit 636b9c1
Show file tree
Hide file tree
Showing 68 changed files with 261 additions and 113 deletions.
9 changes: 9 additions & 0 deletions apps/dashboard-app/app/dashboard/financial/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react'

const page = () => {
return (
<div>Financial</div>
)
}

export default page
9 changes: 9 additions & 0 deletions apps/dashboard-app/app/dashboard/knowledge-base/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react'

const page = () => {
return (
<div>Knowledge Base</div>
)
}

export default page
12 changes: 7 additions & 5 deletions apps/dashboard-app/app/dashboard/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import NavbarClient from "../../components/NavbarClient";
export default async function Layout({children}:{children: React.ReactNode}){

return (
<div className="w-full overflow-hidden">
<NavbarClient />
<div className="flex flex-col">
<LeftSidebarClient/>
{children}
<div className="overflow-hidden flex">
<LeftSidebarClient/>
<div className="flex flex-col w-full ">
<NavbarClient />
<div className="flex justify-center">
{children}
</div>
</div>
</div>
)
Expand Down
9 changes: 9 additions & 0 deletions apps/dashboard-app/app/dashboard/planner/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react'

const page = () => {
return (
<div>Planner</div>
)
}

export default page
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

const page = () => {
return (
<div>Practise Apps</div>
<div>Projects</div>
)
}

Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard-app/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "@repo/ui/styles/shadcn-rose"
import { ThemeProvider } from "../components/theme-provider"
import { SessionProviders } from "../components/session-provider";
import { ThemeProvider } from "./theme-provider"
import { SessionProviders } from "./session-provider";


const inter = Inter({
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard-app/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ export default async function Home() {
if (!session){
redirect('/auth/login')
}else{
redirect('/dashboard/practise-apps')
redirect('/dashboard')
}
}
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion apps/dashboard-app/components/ErrorClient.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client"

import ErrorCard from '@repo/ui/components/ErrorCard';
import ErrorCard from '@repo/ui/organisms/common/ErrorCard';
import { useRouter } from 'next/navigation';


Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard-app/components/ForgotPasswordClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { useState } from 'react';
import { useRouter } from 'next/navigation';
import ForgotPasswordCard from '@repo/ui/components/ForgotPasswordCard';
import ForgotPasswordCard from '@repo/ui/organisms/common/ForgotPasswordCard';
import { ForgotPassword } from '../ actions/forgot-password';


Expand Down
39 changes: 34 additions & 5 deletions apps/dashboard-app/components/LeftSidebarClient.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,45 @@
'use client'

import LeftSidebar from "@repo/ui/components/LeftSidebar";
import LeftSidebar from "@repo/ui/organisms/common/LeftSidebar";
import { BadgeCentIcon, Briefcase, BriefcaseIcon, Library, LibraryIcon, Notebook, NotebookIcon } from "lucide-react";
import { useRouter } from "next/navigation";



const sidebarItems = [
{
title: "Financial",
icon: BadgeCentIcon,
href: "/dashboard/financial"
},
{
title: "Projects",
icon: BriefcaseIcon,
href: "/dashboard/projects"
},
{
title: "Planner",
icon: NotebookIcon,
href: "/dashboard/planner"
},
{
title: "Knowledge Base",
icon: LibraryIcon,
href: "/dashboard/knowledge-base"
}
]

const LeftSidebarClient = () => {

const router = useRouter();

const redirect = (href: string) => {
router.push(href);
}

return (
<>
<LeftSidebar children={
<div></div>
}/>

<LeftSidebar sidebarItems={sidebarItems} redirect={redirect}/>
</>
)
}
Expand Down
4 changes: 1 addition & 3 deletions apps/dashboard-app/components/LoadingClient.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
"use client"

import LoadingCard from '@repo/ui/components/LoadingCard';
import { useRouter } from 'next/navigation';
import LoadingCard from '@repo/ui/organisms/common/LoadingCard';


export default function LoadingClient() {
const router = useRouter();

return (
<LoadingCard
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard-app/components/LoginClient.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use client"
import LoginCard from '@repo/ui/components/LoginCard';
import LoginCard from '@repo/ui/organisms/common/LoginCard';
import { signIn} from 'next-auth/react';
import { useRouter, useSearchParams } from 'next/navigation';
import { login } from '../ actions/login';
Expand Down
3 changes: 1 addition & 2 deletions apps/dashboard-app/components/NavbarClient.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
'use client'

import { Navbar } from "@repo/ui/components/Navbar"
import { Navbar } from "@repo/ui/organisms/common/Navbar"
import { useTheme } from "next-themes"
import { useRouter } from "next/navigation";
import { logout } from "../ actions/logout";
import { useCurrentUser } from "../hooks/useCurrentUser";
import { resetPasswordSettings } from "../ actions/reset-password-settings";
import { signOut } from "next-auth/react";
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard-app/components/QuoteClient.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Quote from "@repo/ui/components/Quote"
import Quote from "@repo/ui/organisms/common/Quote"

export default function QuoteClient() {
return (
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard-app/components/RegisterClient.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use client"
import RegisterCard from '@repo/ui/components/RegisterCard';
import RegisterCard from '@repo/ui/organisms/common/RegisterCard';
import { useRouter } from 'next/navigation';
import { register } from '../ actions/register';
import { signIn,useSession } from 'next-auth/react';
Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard-app/components/ResetPasswordClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import { useRouter, useSearchParams } from 'next/navigation';
import { useEffect, useState } from 'react';
import ResetPasswordCard from '@repo/ui/components/ResetPasswordCard';
import ResetPasswordCard from '@repo/ui/organisms/common/ResetPasswordCard';
import { resetPassword} from '../ actions/reset-password';
import { verifyResetToken } from '../ actions/verify-reset-token';
import ErrorCard from '@repo/ui/components/ErrorCard';
import ErrorCard from '@repo/ui/organisms/common/ErrorCard';


export default function ResetPasswordClient() {
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard-app/components/VerificationClient.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client"


import VerificationCard from '@repo/ui/components/VerificationCard';
import VerificationCard from '@repo/ui/organisms/common/VerificationCard';
import { useRouter, useSearchParams } from 'next/navigation';
import { useCallback, useEffect, useState } from 'react';
import { newVerification } from '../ actions/new-verification';
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard-app/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "@repo/ui/tailwind.config";
export * from "@repo/ui/configs/base.config";
14 changes: 14 additions & 0 deletions apps/scheduler-app/actions/verify-reset-token.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use server'
import { getResetTokenByToken } from "@repo/prisma-db/repo/forgot-password";

export const verifyResetToken = async(token: string)=>{
const existingToken = await getResetTokenByToken(token);
if (!existingToken){
return {error: "Token doesn't exist!"}
}
const hasExpired = new Date() > new Date(existingToken.expires);
if (hasExpired){
return {error: "Token already expired!"}
}
return {success: "Token verified!"}
}
12 changes: 12 additions & 0 deletions apps/scheduler-app/app/dashboard/connections/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use client'
import React from 'react'

const Page = () => {
return (
<div >
Connections
</div>
)
}

export default Page
12 changes: 7 additions & 5 deletions apps/scheduler-app/app/dashboard/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import NavbarClient from "../../components/NavbarClient";
export default async function Layout({children}:{children: React.ReactNode}){

return (
<div className="w-full overflow-hidden">
<NavbarClient />
<div className="flex flex-col">
<LeftSidebarClient/>
{children}
<div className="overflow-hidden flex">
<LeftSidebarClient/>
<div className="flex flex-col w-full ">
<NavbarClient />
<div className="flex justify-center">
{children}
</div>
</div>
</div>
)
Expand Down
5 changes: 2 additions & 3 deletions apps/scheduler-app/app/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import React from 'react'

const Page = () => {
return (
<div className='flex '>
<div>1</div>
<div>2</div>
<div>

</div>
)
}
Expand Down
12 changes: 12 additions & 0 deletions apps/scheduler-app/app/dashboard/workflows/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use client'
import React from 'react'

const Page = () => {
return (
<div>
Workflows
</div>
)
}

export default Page
4 changes: 2 additions & 2 deletions apps/scheduler-app/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "@repo/ui/styles/shadcn-rose"
import { ThemeProvider } from "../components/theme-provider"
import { SessionProviders } from "../components/session-provider";
import { ThemeProvider } from "./theme-provider"
import { SessionProviders } from "./session-provider";


const inter = Inter({
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion apps/scheduler-app/components/ErrorClient.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client"

import ErrorCard from '@repo/ui/components/ErrorCard';
import ErrorCard from '@repo/ui/organisms/common/ErrorCard';
import { useRouter } from 'next/navigation';


Expand Down
2 changes: 1 addition & 1 deletion apps/scheduler-app/components/ForgotPasswordClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { useState } from 'react';
import { useRouter } from 'next/navigation';
import ForgotPasswordCard from '@repo/ui/components/ForgotPasswordCard';
import ForgotPasswordCard from '@repo/ui/organisms/common/ForgotPasswordCard';
import { ForgotPassword } from '../actions/forgot-password';


Expand Down
42 changes: 29 additions & 13 deletions apps/scheduler-app/components/LeftSidebarClient.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,34 @@
'use client'

import LeftSidebar from "@repo/ui/components/LeftSidebar";

import LeftSidebar from "@repo/ui/organisms/common/LeftSidebar"
import { BluetoothConnectedIcon, WorkflowIcon } from "lucide-react";
import { useRouter } from "next/navigation";

const sidebarItems = [
{
title: "Workflows",
icon: WorkflowIcon,
href: "/dashboard/workflows"
},
{
title: "Connections",
icon: BluetoothConnectedIcon,
href: "/dashboard/connections"
}
]
const LeftSidebarClient = () => {

return (
<>
<LeftSidebar children={
<div></div>
}/>

</>
)
}

export default LeftSidebarClient;
const router = useRouter();

const redirect = (href: string) => {
router.push(href);
}

return (
<>
<LeftSidebar sidebarItems={sidebarItems} redirect={redirect}/>
</>
)
}

export default LeftSidebarClient;
2 changes: 1 addition & 1 deletion apps/scheduler-app/components/LoadingClient.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client"

import LoadingCard from '@repo/ui/components/LoadingCard';
import LoadingCard from '@repo/ui/organisms/common/LoadingCard';
import { useRouter } from 'next/navigation';


Expand Down
2 changes: 1 addition & 1 deletion apps/scheduler-app/components/LoginClient.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use client"
import LoginCard from '@repo/ui/components/LoginCard';
import LoginCard from '@repo/ui/organisms/common/LoginCard';
import { signIn} from 'next-auth/react';
import { useRouter, useSearchParams } from 'next/navigation';
import { login } from '../actions/login';
Expand Down
2 changes: 1 addition & 1 deletion apps/scheduler-app/components/NavbarClient.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import { Navbar } from "@repo/ui/components/Navbar"
import { Navbar } from "@repo/ui/organisms/common/Navbar"
import { useTheme } from "next-themes"
import { useRouter } from "next/navigation";
import { logout } from "../actions/logout";
Expand Down
Loading

0 comments on commit 636b9c1

Please sign in to comment.