Skip to content

Commit

Permalink
chore: small changes. attention to detail
Browse files Browse the repository at this point in the history
  • Loading branch information
Amama-Fatima committed Jun 25, 2024
1 parent 739d4e3 commit cbbb7aa
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 18 deletions.
8 changes: 7 additions & 1 deletion src/app/(lobby)/dashboard/projects/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,11 @@ export default async function ProjectPage() {
</div>
);
}
return <div>no user</div>;
return (
<div className='self-center mt-6 rounded-md border border-muted-foreground p-2'>
<p className='text-muted-foreground text-sm text-center'>
No user. Login to view projects
</p>
</div>
);
}
8 changes: 7 additions & 1 deletion src/app/(lobby)/dashboard/teams/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ export default async function TeamsPage() {
} = await serverSupabase.auth.getUser();
const user_id = user?.id;
if (!user_id) {
return <div>no user</div>;
return (
<div className='self-center mt-6 rounded-md border border-muted-foreground p-2'>
<p className='text-muted-foreground text-sm text-center'>
No user. Login to view teams
</p>
</div>
);
}

//get teams
Expand Down
8 changes: 7 additions & 1 deletion src/app/my-profile/[name]/invitations/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ import Invitations from '@/components/pending-invitations';
export default async function InvitationsPage() {
const user = await getUser();
if (!user) {
return <div>no user</div>;
return (
<div className='self-center mt-6 rounded-md border border-muted-foreground p-2'>
<p className='text-muted-foreground text-sm text-center'>
No user. Login to view invitations
</p>
</div>
);
}
const userId = user.id as string;
const role = await getRole(userId);
Expand Down
10 changes: 8 additions & 2 deletions src/components/forms/add-task-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,13 @@ import UploadFile from '@/components/upload-file';

interface AddTaskFormProps {
projectName: string;
isDisabled?: boolean;
}

export default function AddTaskForm({ projectName }: AddTaskFormProps) {
export default function AddTaskForm({
projectName,
isDisabled = false,
}: AddTaskFormProps) {
const [isLoading, setIsLoading] = useState(false);
const form = useForm<taskFormSchemaType>({
resolver: zodResolver(taskFormSchema),
Expand Down Expand Up @@ -108,7 +112,9 @@ export default function AddTaskForm({ projectName }: AddTaskFormProps) {
return (
<Dialog>
<DialogTrigger asChild>
<Button size='sm'>Add Task</Button>
<Button size='sm' disabled={isDisabled}>
Add Task
</Button>
</DialogTrigger>
<DialogContent>
<DialogHeader className='mb-4'>
Expand Down
2 changes: 2 additions & 0 deletions src/components/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
Briefcase,
CheckIcon,
ClipboardPlus,
Download,
File,
FileImage,
FileText,
Expand Down Expand Up @@ -36,6 +37,7 @@ export const Icons = {
sun: SunMedium,
moon: Moon,
close: X,
download: Download,
employee: UserRoundPlus,
spinner: Loader2,
add: Plus,
Expand Down
38 changes: 25 additions & 13 deletions src/components/tasks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,10 @@ export default function Tasks({ projectName, tasks }: TasksProps) {
</Tooltip>
</>
)}
<AddTaskForm projectName={projectName} />
<AddTaskForm
projectName={projectName}
isDisabled={!isProjectInProgress}
/>
</div>
</div>

Expand All @@ -245,11 +248,13 @@ export default function Tasks({ projectName, tasks }: TasksProps) {
onClick={() => setTaskSelected(task)}
variant='ghost'
className={cn(
' w-full font-semibold hover:cursor-pointer hover:text-primary-foreground transition-all duration-400',
taskSelected === task && 'text-xl font-bold'
' w-full font-semibold text-sm hover:cursor-pointer hover:text-primary-foreground transition-all duration-400',
taskSelected === task && 'text-md font-bold'
)}
>
{task.title}
{task.title.length > 12
? `${task.title.substring(0, 9)}...`
: task.title}
</Button>
))
) : (
Expand All @@ -276,15 +281,22 @@ export default function Tasks({ projectName, tasks }: TasksProps) {
<span className='text-lg'>{taskSelected.details}</span>
</div>
<div className='flex gap-3'>
<Button
size='sm'
variant='secondary'
onClick={async () => {
await handleZip();
}}
>
Download Reference Material
</Button>
<Tooltip>
<TooltipTrigger asChild>
<Button
size='sm'
variant='ghost'
onClick={async () => {
await handleZip();
}}
>
<Icons.download className=' size-4' />
</Button>
</TooltipTrigger>
<TooltipContent>
<span>Download Reference Material</span>
</TooltipContent>
</Tooltip>
</div>
</div>
) : (
Expand Down

0 comments on commit cbbb7aa

Please sign in to comment.