Skip to content

Commit

Permalink
subject links, module collapse, design updates
Browse files Browse the repository at this point in the history
  • Loading branch information
xvvvyz committed Jul 7, 2024
1 parent f1f855c commit e73771c
Show file tree
Hide file tree
Showing 71 changed files with 1,298 additions and 1,108 deletions.
4 changes: 3 additions & 1 deletion app/(pages)/(with-nav)/inputs/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Button from '@/_components/button';
import PlusIcon from '@heroicons/react/24/outline/PlusIcon';
import { ReactNode } from 'react';

interface LayoutProps {
Expand All @@ -10,7 +11,8 @@ const Layout = ({ children }: LayoutProps) => (
<div className="my-16 flex h-8 items-center justify-between gap-8 px-4">
<h1 className="text-2xl">Inputs</h1>
<Button href="/inputs/create" scroll={false} size="sm">
Create input
<PlusIcon className="w-5" />
New input
</Button>
</div>
{children}
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/(with-nav)/subjects/(list)/@archived/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import CollapsibleArchive from '@/_components/collapsible-archive';
import SubjectList from '@/_components/subject-list';
import CollapsibleArchive from '@/_queries/collapsible-archive';
import countArchivedSubjects from '@/_queries/count-archived-subjects';

const Page = async () => {
Expand Down
4 changes: 3 additions & 1 deletion app/(pages)/(with-nav)/subjects/(list)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Button from '@/_components/button';
import PlusIcon from '@heroicons/react/24/outline/PlusIcon';
import { ReactNode } from 'react';

interface LayoutProps {
Expand All @@ -11,7 +12,8 @@ const Layout = async ({ archived, children }: LayoutProps) => (
<div className="my-16 flex h-8 items-center justify-between gap-8 px-4">
<h1 className="text-2xl">Subjects</h1>
<Button href="/subjects/create" scroll={false} size="sm">
Create subject
<PlusIcon className="w-5" />
New subject
</Button>
</div>
<div className="space-y-4">
Expand Down
4 changes: 3 additions & 1 deletion app/(pages)/(with-nav)/templates/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Button from '@/_components/button';
import PlusIcon from '@heroicons/react/24/outline/PlusIcon';
import { ReactNode } from 'react';

interface LayoutProps {
Expand All @@ -10,7 +11,8 @@ const Layout = ({ children }: LayoutProps) => (
<div className="my-16 flex h-8 items-center justify-between gap-8 px-4">
<h1 className="text-2xl">Templates</h1>
<Button href="/templates/create" scroll={false} size="sm">
Create template
<PlusIcon className="w-5" />
New template
</Button>
</div>
{children}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const Page = async ({ params: { insightId, subjectId } }: PageProps) => {

return (
<>
<PageModalHeader title="Create insight" />
<PageModalHeader title="New insight" />
<InsightForm events={events} insight={insight} subjectId={subjectId} />
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface PageProps {
}

export const metadata = {
title: formatTitle(['Subjects', 'Insights', 'Create']),
title: formatTitle(['Subjects', 'Insights', 'New']),
};

const Page = async ({ params: { subjectId } }: PageProps) => {
Expand All @@ -24,7 +24,7 @@ const Page = async ({ params: { subjectId } }: PageProps) => {

return (
<>
<PageModalHeader title="Create insight" />
<PageModalHeader title="New insight" />
<InsightForm events={events} subjectId={subjectId} />
</>
);
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/@modal/(md)/account/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface LayoutProps {
const Layout = async ({ children }: LayoutProps) => (
<>
<PageModalHeader title="Account settings" />
<div className="!border-t-0 px-4 pb-8 sm:px-8">
<div className="px-4 pb-8 sm:px-8">
<div className="grid w-full grid-cols-3 divide-x divide-alpha-3 rounded border border-alpha-3">
<Button
activeClassName="text-fg-2 bg-alpha-1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface PageProps {
};
}

export const metadata = { title: formatTitle(['Inputs', 'Create']) };
export const metadata = { title: formatTitle(['Inputs', 'New']) };

const Page = async ({ params: { inputId } }: PageProps) => {
const [{ data: subjects }, { data: input }] = await Promise.all([
Expand All @@ -22,7 +22,7 @@ const Page = async ({ params: { inputId } }: PageProps) => {

return (
<>
<PageModalHeader title="Create input" />
<PageModalHeader title="New input" />
<InputForm input={input} isDuplicate subjects={subjects} />
</>
);
Expand Down
4 changes: 2 additions & 2 deletions app/(pages)/@modal/(md)/inputs/create/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import PageModalHeader from '@/_components/page-modal-header';
import listSubjectsByTeamId from '@/_queries/list-subjects-by-team-id';
import formatTitle from '@/_utilities/format-title';

export const metadata = { title: formatTitle(['Inputs', 'Create']) };
export const metadata = { title: formatTitle(['Inputs', 'New']) };

const Page = async () => {
const { data: subjects } = await listSubjectsByTeamId();
if (!subjects) return null;

return (
<>
<PageModalHeader title="Create input" />
<PageModalHeader title="New input" />
<InputForm subjects={subjects} />
</>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import SessionsLoading from '@/_components/sessions-loading';
import PageModalLoading from '@/_components/page-modal-loading';

export default SessionsLoading;
const Loading = PageModalLoading;

export default Loading;
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import getEventTypeWithInputs from '@/_queries/get-event-type-with-inputs';
import getSubject from '@/_queries/get-subject';
import listInputsBySubjectId from '@/_queries/list-inputs-by-subject-id';
import listSubjectsByTeamId from '@/_queries/list-subjects-by-team-id';
import listTemplatesWithData from '@/_queries/list-templates-with-data';
import formatTitle from '@/_utilities/format-title';

interface PageProps {
Expand All @@ -23,23 +22,15 @@ const Page = async ({ params: { eventTypeId, subjectId } }: PageProps) => {
{ data: subject },
{ data: eventType },
{ data: availableInputs },
{ data: availableTemplates },
{ data: subjects },
] = await Promise.all([
getSubject(subjectId),
getEventTypeWithInputs(eventTypeId),
listInputsBySubjectId(subjectId),
listTemplatesWithData(),
listSubjectsByTeamId(),
]);

if (
!subject ||
!eventType ||
!availableInputs ||
!availableTemplates ||
!subjects
) {
if (!subject || !eventType || !availableInputs || !subjects) {
return null;
}

Expand All @@ -48,7 +39,6 @@ const Page = async ({ params: { eventTypeId, subjectId } }: PageProps) => {
<PageModalHeader title={eventType.name as string} />
<EventTypeForm
availableInputs={availableInputs}
availableTemplates={availableTemplates}
eventType={eventType}
subjects={subjects}
subjectId={subjectId}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface PageProps {
}

export const metadata = {
title: formatTitle(['Subjects', 'Event types', 'Create']),
title: formatTitle(['Subjects', 'Event types', 'New']),
};

const Page = async ({ params: { subjectId } }: PageProps) => {
Expand All @@ -35,10 +35,9 @@ const Page = async ({ params: { subjectId } }: PageProps) => {

return (
<>
<PageModalHeader title="Create event type" />
<PageModalHeader title="New event type" />
<EventTypeForm
availableInputs={availableInputs}
availableTemplates={availableTemplates}
subjects={subjects}
subjectId={subjectId}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ interface PageProps {
}

export const metadata = {
title: formatTitle(['Subjects', 'Training plans', 'Sessions', 'Create']),
title: formatTitle(['Subjects', 'Training plans', 'Sessions', 'New']),
};

const Page = async ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface PageProps {
}

export const metadata = {
title: formatTitle(['Subjects', 'Training plans', 'Sessions', 'Create']),
title: formatTitle(['Subjects', 'Training plans', 'Sessions', 'New']),
};

const Page = async ({ params: { missionId, order, subjectId } }: PageProps) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface PageProps {
}

export const metadata = {
title: formatTitle(['Subjects', 'Training plans', 'Create']),
title: formatTitle(['Subjects', 'Training plans', 'New']),
};

const Page = async ({ params: { subjectId } }: PageProps) => {
Expand All @@ -19,7 +19,7 @@ const Page = async ({ params: { subjectId } }: PageProps) => {

return (
<>
<PageModalHeader title="Create training plan" />
<PageModalHeader title="New training plan" />
<MissionForm subjectId={subjectId} />
</>
);
Expand Down
4 changes: 2 additions & 2 deletions app/(pages)/@modal/(md)/subjects/create/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import PageModalHeader from '@/_components/page-modal-header';
import SubjectForm from '@/_components/subject-form';
import formatTitle from '@/_utilities/format-title';

export const metadata = { title: formatTitle(['Subjects', 'Create']) };
export const metadata = { title: formatTitle(['Subjects', 'New']) };

const Page = () => (
<>
<PageModalHeader title="Create subject" />
<PageModalHeader title="New subject" />
<SubjectForm />
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface PageProps {
};
}

export const metadata = { title: formatTitle(['Templates', 'Create']) };
export const metadata = { title: formatTitle(['Templates', 'New']) };

const Page = async ({ params: { eventTypeId } }: PageProps) => {
const [{ data: eventType }, { data: availableInputs }, { data: subjects }] =
Expand All @@ -25,7 +25,7 @@ const Page = async ({ params: { eventTypeId } }: PageProps) => {

return (
<>
<PageModalHeader title="Create template" />
<PageModalHeader title="New template" />
<TemplateForm
availableInputs={availableInputs}
disableCache
Expand Down
4 changes: 2 additions & 2 deletions app/(pages)/@modal/(md)/templates/create/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import listInputs from '@/_queries/list-inputs';
import listSubjectsByTeamId from '@/_queries/list-subjects-by-team-id';
import formatTitle from '@/_utilities/format-title';

export const metadata = { title: formatTitle(['Templates', 'Create']) };
export const metadata = { title: formatTitle(['Templates', 'New']) };

const Page = async () => {
const [{ data: availableInputs }, { data: subjects }] = await Promise.all([
Expand All @@ -16,7 +16,7 @@ const Page = async () => {

return (
<>
<PageModalHeader title="Create template" />
<PageModalHeader title="New template" />
<TemplateForm availableInputs={availableInputs} subjects={subjects} />
</>
);
Expand Down
3 changes: 1 addition & 2 deletions app/_components/account-email-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const AccountEmailForm = ({ user }: AccountEmailFormProps) => {

return (
<form
className="divide-y divide-alpha-1"
onSubmit={form.handleSubmit((values) =>
startTransition(async () => {
const supabase = createBrowserSupabaseClient();
Expand All @@ -48,7 +47,7 @@ const AccountEmailForm = ({ user }: AccountEmailFormProps) => {
}),
)}
>
<div className="px-4 py-8 sm:px-8">
<div className="px-4 pb-8 pt-6 sm:px-8">
<Input
label="Email address"
required
Expand Down
3 changes: 1 addition & 2 deletions app/_components/account-password-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const AccountPasswordForm = () => {

return (
<form
className="divide-y divide-alpha-1"
onSubmit={form.handleSubmit((values) =>
startTransition(async () => {
const supabase = createBrowserSupabaseClient();
Expand All @@ -45,7 +44,7 @@ const AccountPasswordForm = () => {
}),
)}
>
<div className="px-4 py-8 sm:px-8">
<div className="px-4 pb-8 pt-6 sm:px-8">
<Input
label="New password"
minLength={6}
Expand Down
3 changes: 1 addition & 2 deletions app/_components/account-profile-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ const AccountProfileForm = ({ user }: AccountProfileFormProps) => {

return (
<form
className="divide-y divide-alpha-1"
onSubmit={form.handleSubmit((values) =>
startTransition(async () => {
const supabase = createBrowserSupabaseClient();
Expand Down Expand Up @@ -72,7 +71,7 @@ const AccountProfileForm = ({ user }: AccountProfileFormProps) => {
}),
)}
>
<div className="flex flex-col gap-6 px-4 py-8 sm:px-8">
<div className="flex flex-col gap-8 px-4 pb-8 pt-6 sm:px-8">
<div className="flex gap-6">
<Input label="First name" required {...form.register('firstName')} />
<Input label="Last name" required {...form.register('lastName')} />
Expand Down
2 changes: 1 addition & 1 deletion app/_components/alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const Alert = ({
<div className="fixed inset-0 z-20 bg-alpha-reverse-1 backdrop-blur-sm" />
<div className="fixed inset-0 z-30 overflow-y-auto p-4">
<div className="flex min-h-full items-center justify-center">
<DialogPanel className="w-full max-w-xs rounded border border-alpha-1 bg-bg-2 p-8 text-center shadow-lg">
<DialogPanel className="w-full max-w-xs rounded border border-alpha-1 bg-bg-2 p-8 text-center drop-shadow">
<DialogTitle className="text-2xl">{title}</DialogTitle>
{description && (
<Description className="mt-2 text-fg-4">
Expand Down
2 changes: 1 addition & 1 deletion app/_components/calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const Calendar = ({
classNames={{
caption: 'flex justify-center pt-1 relative items-center',
cell: 'p-0 group',
day: 'h-9 w-9 rounded-sm transition-colors hover:bg-alpha-2 border border-transparent focus:ring-1 focus:ring-accent-2 focus:outline-none font-normal',
day: 'h-9 w-9 rounded-sm font-mono transition-colors hover:bg-alpha-2 border border-transparent focus:ring-1 focus:ring-accent-2 focus:outline-none font-normal',
day_disabled: 'disabled',
day_hidden: 'invisible',
day_outside: 'text-fg-4',
Expand Down
6 changes: 5 additions & 1 deletion app/_components/checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ const Checkbox = forwardRef(
<CheckIcon className="invisible h-5 w-5" />
</span>
</label>
{tooltip && <Tip className="-mr-[0.15rem]">{tooltip}</Tip>}
{tooltip && (
<Tip className="-mr-[0.2rem]" side="left">
{tooltip}
</Tip>
)}
</div>
),
);
Expand Down
File renamed without changes.
Loading

0 comments on commit e73771c

Please sign in to comment.