Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monthly stats page new function #127

Merged
merged 24 commits into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
75ac2f8
Add a text section for the monthly total task
JasonRenBang Nov 7, 2024
92b1220
Add the Monthly Summary button at the header and link to monthly page
JasonRenBang Nov 8, 2024
5379a64
create the monthly stats page
JasonRenBang Nov 8, 2024
008a64b
add countup component
JasonRenBang Nov 8, 2024
ccf1411
#196 change to the new home page
JasonRenBang Nov 14, 2024
895b0a4
#223 Monthly stats page
JasonRenBang Nov 14, 2024
42b9fc0
#221 Add profile picutre
JasonRenBang Nov 14, 2024
8f15375
Remove yarn.lock and remove packageManager in package.json
JasonRenBang Nov 15, 2024
e4abfe7
remove that useless import
JasonRenBang Nov 15, 2024
0b4c42d
add 'use client'
JasonRenBang Nov 15, 2024
f37a6d3
correct page.tsx page
JasonRenBang Nov 15, 2024
5f44bc0
recover day view page
JasonRenBang Nov 15, 2024
a5f503d
fix home page css
Ben0189 Nov 16, 2024
6710615
use text color variable
Ben0189 Nov 16, 2024
90201ab
add use Image tag from Next
Ben0189 Nov 16, 2024
83c6096
update lock file
Ben0189 Nov 16, 2024
00bfd45
fix css for monthly page
Ben0189 Nov 16, 2024
fe19fe2
remove unused navbar
Ben0189 Nov 16, 2024
a78f280
Merge branch 'main' into Monthly-Stats-Page-New-Function
JasonRenBang Nov 16, 2024
e9ceece
Update page.tsx
JasonRenBang Nov 16, 2024
216ef2f
before recover I need fix conflix
JasonRenBang Nov 16, 2024
75f74f1
Merge branch 'Monthly-Stats-Page-New-Function' of https://github.com/…
JasonRenBang Nov 16, 2024
3ed12e2
recover deleted code
JasonRenBang Nov 16, 2024
d34b6da
recover the code
JasonRenBang Nov 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion blotztask-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"next-auth": "^4.24.10",
"next-themes": "^0.3.0",
"react": "^18.3.1",
"react-countup": "^6.5.3",
"react-day-picker": "^8.7.1",
"react-dom": "^18.3.1",
"react-hook-form": "^7.44.3",
Expand All @@ -76,5 +77,6 @@
"prettier": "^3.3.3",
"tailwindcss": "^3.4.6",
"typescript": "^5"
}
},
"packageManager": "yarn@1.22.19+sha1.4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447"
JasonRenBang marked this conversation as resolved.
Show resolved Hide resolved
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions blotztask-ui/src/app/monthly-stats/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
'use client';

import { H1, H5, P } from '@/components/ui/heading-with-anchor';
import { mock } from 'node:test';
import CountUp from 'react-countup';
export default function Monthlystats() {
const mockTasks = [
{
id: 1,
title: 'Complete project report',
description: 'Finalize the project report and submit it to the manager.',
isDone: false,
createdAt: '2024-07-20T08:30:00Z',
updatedAt: '2024-07-20T08:30:00Z',
},
{
id: 2,
title: 'Meeting with the team',
description:
'Discuss the project milestones and deadlines with the team.',
isDone: false,
createdAt: '2024-07-21T10:00:00Z',
updatedAt: '2024-07-21T10:00:00Z',
},
];

const taskCount = mockTasks.length;
return (
<>
<div className="flex flex-col gap-5 md:items-center md:p-28">
<div className="flex flex-col gap-5 ">
<img
src="/assets/images/profileImage.png"
alt="an incredable image"
className="w-[120px] h-[120px] absolute top-[80px] left-[500px]"
/>
<p className="font-arial font-bold text-[40px] leading-[100px] tracking-[-0.41px] text-center text-[#278291]">
You planned{' '}
<span className="font-arial font-bold text-[123px] leading-[100px] tracking-[-0.41px] text-center text-[#278291]">
<CountUp end={taskCount} />{' '}
</span>
tasks this month
</p>
</div>
</div>
</>
);
}
55 changes: 17 additions & 38 deletions blotztask-ui/src/app/navbar/main-nav.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
'use client';

import {
signOut,
useSession,
} from 'next-auth/react';
import { signOut, useSession } from 'next-auth/react';
import Link from 'next/link';
import styles from './main-nav.module.css';

Expand All @@ -29,16 +26,14 @@ export function MainNav({}: React.HTMLAttributes<HTMLElement>) {
<div className="sm:flex hidden justify-end">
{session?.user ? (
<div className="flex gap-6">
<Link
href="/task-dayview"
className={styles['nav-btn']}
>
<Link href="/task-dayview" className={styles['nav-btn']}>
<span className={styles['link-underline']}>Day View</span>
</Link>
<Link
href="/task-list"
className={styles['nav-btn']}
>
{/* Add the link to the Monthly view page */}
<Link href="/monthly-stats" className={styles['nav-btn']}>
<span className={styles['link-underline']}>Monthly Summary</span>
</Link>
<Link href="/task-list" className={styles['nav-btn']}>
<span className={styles['link-underline']}>All Task</span>
</Link>
{/* <Link
Expand All @@ -47,16 +42,10 @@ export function MainNav({}: React.HTMLAttributes<HTMLElement>) {
>
<span className={styles['link-underline']}>New Task List</span>
</Link> */}
<Link
href="/test-connection"
className={styles['nav-btn']}
>
<Link href="/test-connection" className={styles['nav-btn']}>
<span className={styles['link-underline']}>Test Connection</span>
</Link>
<Link
href="/profile"
className={styles['nav-btn']}
>
<Link href="/profile" className={styles['nav-btn']}>
<span className={styles['link-underline']}>Profile</span>
</Link>
<button
Expand All @@ -69,25 +58,15 @@ export function MainNav({}: React.HTMLAttributes<HTMLElement>) {
</div>
) : (
<div className="flex gap-6">
<Link
href="/signIn"
>
<button
type="button"
className={styles['nav-secondary-btn']}
>
<span>Sign in</span>
</button>
<Link href="/signIn">
<button type="button" className={styles['nav-secondary-btn']}>
<span>Sign in</span>
</button>
</Link>
<Link
href="/signup"
>
<button
type="button"
className={styles['nav-btn']}
>
<span>Sign up</span>
</button>
<Link href="/signup">
<button type="button" className={styles['nav-btn']}>
<span>Sign up</span>
</button>
</Link>
</div>
)}
Expand Down
20 changes: 9 additions & 11 deletions blotztask-ui/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import { H1, H3 } from '@/components/ui/heading-with-anchor';
import { P } from '@/components/ui/heading-with-anchor';

export default function Home() {
return (
<main className="flex flex-col gap-5 p-12 md:items-center md:p-28">
<H1 className="heading-primary">
Blotz
<span className="heading-secondary">Task</span>
</H1>

<H3 className="text-lg font-light text-muted-foreground sm:text-xl">
Designed to help users efficiently organize and track their tasks
providing functionality for task creation, management, and completion
tracking.
</H3>
<p className="w-[679px] h-[60px] absolute top-[197px] left-[402px] font-arial text-[32px] font-bold leading-[48px] tracking-[-0.41px] text-center text-[#278291]">
Welcome to the new age note taking web
</p>
<img
src="/assets/images/homePageNewPicture.png"
alt="an incredable image"
className="w-[849px] h-[350px] absolute top-[305px] left-[296px]"
/>
</main>
);
}
23 changes: 13 additions & 10 deletions blotztask-ui/src/app/task-dayview/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,24 +58,25 @@ export default function Dayview() {
// Simulate fetching tasks
setTasks(validatedTasks);
}, []);

// Count this month's tasks' number for user
const countTasks = (tasks: taskDto[]): number => {
return tasks.length;
};
return (
<>
<div className='flex flex-col gap-5'>
<div className='flex flex-col gap-5'>
<div className="flex flex-col gap-5">
<div className="flex flex-col gap-5">
<H1 className="heading-primary">
Day
<span className="heading-secondary">View</span>
</H1>
<H5>
List of today&apos;s task
</H5>
</H1>
<H5>List of today&apos;s task</H5>
<H5>You planned {countTasks(mockTasks)} tasks this month</H5>
</div>

<div className="grid gap-6 w-3/4">

{tasks.map((task) => (
<Card key={task.id} className='bg-white'>
<Card key={task.id} className="bg-white">
<CardHeader className="flex-row pb-1">
<Checkbox
className="rounded-full mt-1 mr-2"
Expand All @@ -99,7 +100,9 @@ export default function Dayview() {
))}

<div className="w-1/2 flex gap-5 flex-col">
<Button className="self-start" onClick={toggleFormVisibility}>Add task</Button>
<Button className="self-start" onClick={toggleFormVisibility}>
Add task
</Button>
{isFormVisible && (
<Card>
<CardHeader className="pb-1"></CardHeader>
Expand Down
Loading