Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Amama-Fatima committed Jun 17, 2024
2 parents 97c3b2c + 7aaf823 commit d0e4c69
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 16 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,10 @@ Team Manager defines three roles:
- **File Sharing and Collaboration**: Members can share, upload and download files while working on a project
- **Real-time Chat**: Members of a team can chat with each other in real time.
- **Notifications**: Members receive real-time notifications about certain activities on the platform.

## Upcoming Features

- **Restriction on Number of Teams**: Implement a restriction on the number of teams a user can join or create.

- **Improvements on Task Management**: Enhance task management functionality with new features such as task prioritization, due dates, task assignments to specific team members, and task dependencies.

- **Expanded Notifications**: Introduce more notification alerts for various activities, including chat messages, project updates, task assignments, and deadlines.
Expand Down
5 changes: 3 additions & 2 deletions src/components/forms/user-signup-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,13 @@ const UserSignupForm = () => {
});

if (error) {
toast.error('Failed to log in');
toast.error('Failed to create new account');
} else if (data) {
toast.success('Logged in successfully');
toast.success('Account created successfully');
setLogInStatus(true);
}

router.refresh();
router.push('/');
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/site-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function SiteHeader({ user }: SiteHeaderProps) {
<div>
<nav className='flex flex-1 items-center space-x-1'>
<UserProfileDropdown user={user} />
{user ? <NotificationButton /> : null}
{user.email ? <NotificationButton /> : null}
<LoginButton />
<ThemeToggle />
</nav>
Expand Down
4 changes: 3 additions & 1 deletion src/components/tailwind-indicator.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { isProd } from '@/constant/env';

export function TailwindIndicator() {
if (process.env.NODE_ENV === 'production') return null;
if (isProd) return null;

return (
<div className='fixed bottom-1 left-1 z-50 flex size-6 items-center justify-center rounded-full bg-gray-800 p-3 font-mono text-xs text-white'>
Expand Down
11 changes: 10 additions & 1 deletion src/components/user-profile-dropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
'use client';
import Link from 'next/link';
import React from 'react';
import { useRouter } from 'next/navigation';
import React, { useEffect } from 'react';

import { useLogInStatusStore } from '@/lib/store';

import { Icons } from '@/components/icons';
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
Expand All @@ -20,6 +23,12 @@ interface UserProfileDropdownProps {
}

const UserProfileDropdown = ({ user }: UserProfileDropdownProps) => {
const { logInStatus } = useLogInStatusStore();
const router = useRouter();
useEffect(() => {
router.refresh();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [logInStatus]);
return (
<div>
{' '}
Expand Down
4 changes: 0 additions & 4 deletions src/constant/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ export const siteConfig = {
title: 'Projects',
href: '/projects',
},
{
title: 'Teams',
href: '/teams',
},
{
title: 'Inbox',
href: '/inbox',
Expand Down
4 changes: 3 additions & 1 deletion src/constant/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ export const showLogger = isLocal
// Supabase
export const SUPABASE_ANON_KEY =
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY ?? 'sth';
export const SUPABASE_URL = process.env.NEXT_PUBLIC_SUPABASE_URL ?? 'sth';
export const SUPABASE_URL = isProd
? process.env.NEXT_PUBLIC_SUPABASE_PROD_URL
: process.env.NEXT_PUBLIC_SUPABASE_URL;

//Pusher
export const PUSHER_KEY = process.env.NEXT_PUBLIC_PUSHER_KEY ?? 'sth';
Expand Down
1 change: 0 additions & 1 deletion src/lib/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export const fileSchema = z.object({

export const userSignupFormSchema = z.object({
name: z.string(),
// image: z.string(),
email: z.string().email(),
password: z.string().min(8),
});
Expand Down
2 changes: 1 addition & 1 deletion src/lib/supabase/browser-clients.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import { createBrowserClient } from '@supabase/ssr';
import { SUPABASE_ANON_KEY, SUPABASE_URL } from '@/constant/env';

export function createSupabaseBrowserClient() {
return createBrowserClient(SUPABASE_URL, SUPABASE_ANON_KEY);
return createBrowserClient(SUPABASE_URL as string, SUPABASE_ANON_KEY);
}
4 changes: 2 additions & 2 deletions src/lib/supabase/server-clients.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { SUPABASE_ANON_KEY, SUPABASE_URL } from '@/constant/env';
// server component can only get cookies and not set them, hence the "component" check
export function createSupabaseServerClient(component = false) {
cookies().getAll(); // Keep cookies in the JS execution context for Next.js build
return createServerClient(SUPABASE_URL, SUPABASE_ANON_KEY, {
return createServerClient(SUPABASE_URL as string, SUPABASE_ANON_KEY, {
cookies: {
get(name: string) {
return getCookie(name, { cookies });
Expand All @@ -35,7 +35,7 @@ export function createSupabaseReqResClient(
res: NextResponse
) {
cookies().getAll(); // Keep cookies in the JS execution context for Next.js build
return createServerClient(SUPABASE_URL, SUPABASE_ANON_KEY, {
return createServerClient(SUPABASE_URL as string, SUPABASE_ANON_KEY, {
cookies: {
get(name: string) {
return getCookie(name, { req, res });
Expand Down

0 comments on commit d0e4c69

Please sign in to comment.