-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
138 changed files
with
2,601 additions
and
1,450 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
"use client"; | ||
|
||
import { GoogleOAuthProvider } from '@react-oauth/google'; | ||
|
||
|
||
export const ClientWrapper = ({ children }: { children: React.ReactNode }) => { | ||
const clientId = process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID; | ||
|
||
if (!clientId) { | ||
return <div>Loading...</div> | ||
} | ||
|
||
return <GoogleOAuthProvider clientId={clientId}> | ||
{children} | ||
</GoogleOAuthProvider> | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
'use client' | ||
|
||
import { Button } from "@/components/ui/button"; | ||
import { Layer } from "@/components/ui/layer"; | ||
import Image from "next/image"; | ||
import Link from "next/link"; | ||
import { AiOutlineArrowRight } from "react-icons/ai"; | ||
import PersonalFinanceIllustration from '../../assets/Personal_Finance_Illustration.svg'; | ||
|
||
|
||
export const SplashScreen = () => { | ||
// const [IsSplashScreenShown, setIsSplashScreenShown] = useGeneralStore((state: GeneralStore) => [state.IsSplashScreenShown, state.setIsSplashScreenShown]) | ||
|
||
// if (IsSplashScreenShown) { | ||
// return <></> | ||
// } | ||
|
||
return <Layer index={10} className="bg-background"> | ||
|
||
<div className="flex flex-col w-screen h-screen items-center z-50 justify-center py-8 "> | ||
|
||
<Image | ||
className='mb-16' | ||
src={PersonalFinanceIllustration} | ||
alt="Personal Finance Illustration" | ||
width={150} | ||
priority | ||
/> | ||
|
||
<h1 className='text-3xl font-bold text-center mb-8'> | ||
{/* subtitle */} | ||
Welcome to {process.env.NEXT_PUBLIC_APP_NAME} | ||
</h1> | ||
|
||
<p className='px-8 mb-8 text-center'> | ||
{process.env.NEXT_PUBLIC_APP_NAME} is the ultimate tool for tracking your personal finances related to your lending and borrowing activities. | ||
Whether you lend money to your friends, borrow money from your family, or use any other form of credit, | ||
our finance app will help you stay on top of your finances. | ||
</p> | ||
|
||
<Link href="/auth/login"> | ||
<Button variant="default" type="button"> | ||
Get Started  <AiOutlineArrowRight /> | ||
</Button> | ||
</Link> | ||
|
||
{/* <Login /> */} | ||
</div> | ||
</Layer> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
export { HeroSection } from './HeroSection' | ||
export { RecentTransactionsSection } from './RecentTransactionsSection' | ||
|
||
export * from './ClientWrapper/ClientWrapper' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
import { GuestLayout } from '@/components/layouts' | ||
|
||
export default function AuthenticationLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode | ||
}) { | ||
let test = 22; | ||
|
||
console.log(test) | ||
{{ | ||
console.log(test) | ||
}} | ||
return ( | ||
<GuestLayout>{children}</GuestLayout> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
import { GuestLayout } from '@/components/layouts'; | ||
import { Login } from '@/modules/auth/components/Login'; | ||
import type { Metadata } from 'next'; | ||
|
||
export const metadata: Metadata = { | ||
title: 'Mint Pulse', | ||
description: | ||
'Mint Pulse is the ultimate tool for tracking your personal finances related to your lending and borrowing activities. You can create records of your transactions, set reminders, view reports, and more. You can also sync your data across multiple devices and access it anytime, anywhere. Whether you lend money to your friends, borrow money from your family, or use any other form of credit, our finance app will help you stay on top of your finances and avoid unnecessary fees or interest. Download our finance app today and see how it can make your life easier and happier!', | ||
} | ||
|
||
export default function Home() { | ||
|
||
return <div className="flex flex-col justify-center items-center h-screen w-screen"> | ||
<Login /> | ||
</div>; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
'use client' | ||
|
||
import { Transaction, useTransactionSheet } from '@/modules/transactions' | ||
import { useEffect, useState } from 'react' | ||
|
||
|
||
export const useHeroSectionState = () => { | ||
|
||
const [isLoading, setIsLoading] = useState(true) | ||
const [error, setError] = useState('') | ||
const [totalCredit, setTotalCredit] = useState(0) | ||
const [totalDebit, setTotalDebit] = useState(0) | ||
const [totalBalance, setTotalBalance] = useState(0) | ||
const { transactionSheet, ...ts } = useTransactionSheet() | ||
// console.log("🚀 ~ useHeroSectionState ~ ts:", ts) | ||
|
||
// google sheet implementation | ||
const getData = async (transactionSheet: any) => { | ||
console.log('🚀 ~ file: hooks.ts ~ line 20 ~ getData ~ transactionSheet', transactionSheet) | ||
const totalCredit = await transactionSheet.getRows()?.reduce((tc: number, txn: Transaction) => { | ||
if (txn.type === 'credit') return tc + txn.amount | ||
return tc | ||
}, 0) | ||
|
||
const totalDebit = await transactionSheet.getRows()?.reduce((tc: number, txn: Transaction) => { | ||
if (txn.type === 'debit') return tc + txn.amount | ||
return tc | ||
}, 0) | ||
|
||
if (!(typeof totalCredit === 'number' && typeof totalDebit === 'number')) { | ||
setError('Something went wrong. Please try again later.') | ||
return | ||
} | ||
const totalBalance = totalCredit - totalDebit | ||
setTotalCredit(totalCredit) | ||
setTotalDebit(totalDebit) | ||
setTotalBalance(totalBalance) | ||
setIsLoading(false) | ||
} | ||
|
||
useEffect(() => { | ||
if (!ts.isLoading && !ts.error && transactionSheet) | ||
getData(transactionSheet) | ||
}, [ts]) | ||
|
||
return { totalCredit, totalDebit, totalBalance, isLoading, error } | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export { HeroSection } from './HeroSection' | ||
export { RecentTransactionsSection } from './RecentTransactionsSection' | ||
|
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
import { AuthLayout } from '@/components/layouts' | ||
|
||
export default function DashboardLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode | ||
}) { | ||
return ( | ||
<AuthLayout>{children}</AuthLayout> | ||
) | ||
} |
Oops, something went wrong.