|
|
@ -4,6 +4,7 @@ import { useState } from 'react';
|
|
|
|
import { Button, Spinner } from '@tih/ui';
|
|
|
|
import { Button, Spinner } from '@tih/ui';
|
|
|
|
|
|
|
|
|
|
|
|
import DashboardProfileCard from '~/components/offers/dashboard/DashboardProfileCard';
|
|
|
|
import DashboardProfileCard from '~/components/offers/dashboard/DashboardProfileCard';
|
|
|
|
|
|
|
|
import Container from '~/components/shared/Container';
|
|
|
|
|
|
|
|
|
|
|
|
import { trpc } from '~/utils/trpc';
|
|
|
|
import { trpc } from '~/utils/trpc';
|
|
|
|
|
|
|
|
|
|
|
@ -30,19 +31,21 @@ export default function ProfilesDashboard() {
|
|
|
|
|
|
|
|
|
|
|
|
if (status === 'loading' || userProfilesQuery.isLoading) {
|
|
|
|
if (status === 'loading' || userProfilesQuery.isLoading) {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className="flex h-screen w-screen">
|
|
|
|
<div className="flex w-full">
|
|
|
|
<div className="m-auto mx-auto w-full justify-center">
|
|
|
|
<div className="m-auto mx-auto w-full justify-center">
|
|
|
|
<Spinner className="m-10" display="block" size="lg" />
|
|
|
|
<Spinner className="m-10" display="block" size="lg" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (status === 'unauthenticated') {
|
|
|
|
if (status === 'unauthenticated') {
|
|
|
|
signIn();
|
|
|
|
signIn();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (userProfiles.length === 0) {
|
|
|
|
if (userProfiles.length === 0) {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className="flex h-screen w-screen">
|
|
|
|
<div className="flex w-full">
|
|
|
|
<div className="m-auto mx-auto w-full justify-center text-xl">
|
|
|
|
<div className="m-auto mx-auto w-full justify-center text-xl">
|
|
|
|
<div className="mb-8 flex w-full flex-row justify-center">
|
|
|
|
<div className="mb-8 flex w-full flex-row justify-center">
|
|
|
|
<h2>You have not saved any offer profiles yet.</h2>
|
|
|
|
<h2>You have not saved any offer profiles yet.</h2>
|
|
|
@ -59,10 +62,11 @@ export default function ProfilesDashboard() {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<Container variant="xs">
|
|
|
|
{userProfilesQuery.isLoading && (
|
|
|
|
{userProfilesQuery.isLoading && (
|
|
|
|
<div className="flex h-screen w-screen">
|
|
|
|
<div className="flex h-screen">
|
|
|
|
<div className="m-auto mx-auto w-full justify-center">
|
|
|
|
<div className="m-auto mx-auto w-full justify-center">
|
|
|
|
<Spinner className="m-10" display="block" size="lg" />
|
|
|
|
<Spinner className="m-10" display="block" size="lg" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -70,19 +74,17 @@ export default function ProfilesDashboard() {
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
{!userProfilesQuery.isLoading && (
|
|
|
|
{!userProfilesQuery.isLoading && (
|
|
|
|
<div className="overflow-y-auto py-8">
|
|
|
|
<div className="overflow-y-auto py-8">
|
|
|
|
<h1 className="mx-auto mb-4 w-3/4 text-start text-4xl font-bold text-slate-900">
|
|
|
|
<h1 className="mx-auto mb-4 text-start text-4xl font-bold text-slate-900">
|
|
|
|
Your dashboard
|
|
|
|
Your dashboard
|
|
|
|
</h1>
|
|
|
|
</h1>
|
|
|
|
<p className="mx-auto w-3/4 text-start text-xl text-slate-900">
|
|
|
|
<p className="mt-4 text-xl leading-8 text-slate-500">
|
|
|
|
Save your offer profiles to dashboard to easily access and edit them
|
|
|
|
Save your offer profiles to your dashboard to easily access and edit
|
|
|
|
later.
|
|
|
|
them later.
|
|
|
|
</p>
|
|
|
|
</p>
|
|
|
|
<div className="justfy-center mt-8 flex w-screen">
|
|
|
|
<div className="mt-8 flex justify-center">
|
|
|
|
<ul className="mx-auto w-3/4 space-y-3" role="list">
|
|
|
|
<ul className="w-full space-y-4" role="list">
|
|
|
|
{userProfiles?.map((profile) => (
|
|
|
|
{userProfiles?.map((profile) => (
|
|
|
|
<li
|
|
|
|
<li key={profile.id}>
|
|
|
|
key={profile.id}
|
|
|
|
|
|
|
|
className="overflow-hidden bg-white px-4 py-4 shadow sm:rounded-md sm:px-6">
|
|
|
|
|
|
|
|
<DashboardProfileCard key={profile.id} profile={profile} />
|
|
|
|
<DashboardProfileCard key={profile.id} profile={profile} />
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
))}
|
|
|
|
))}
|
|
|
@ -90,6 +92,6 @@ export default function ProfilesDashboard() {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
</>
|
|
|
|
</Container>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|