Started working on the profile pages

This commit is contained in:
2023-06-02 23:49:18 -05:00
parent 078a127d29
commit 9d861bc1d9
6 changed files with 36 additions and 97 deletions

View File

@@ -28,7 +28,7 @@ const components = {
), ),
blockquote: (props: Tag<HTMLQuoteElement>) => ( blockquote: (props: Tag<HTMLQuoteElement>) => (
<blockquote <blockquote
className="rounded border-l-4 border-fg-700 pl-4 italic" className="my-4 rounded border-l-4 border-fg-700 pl-4 italic"
{...props} {...props}
/> />
), ),
@@ -41,17 +41,17 @@ const components = {
<hr className="my-4 rounded border-2 border-fg-700" {...props} /> <hr className="my-4 rounded border-2 border-fg-700" {...props} />
), ),
img: (props: Tag<HTMLImageElement>) => ( img: (props: Tag<HTMLImageElement>) => (
<img className="max-w-full" {...props} /> <img className="my-4 max-w-full rounded" {...props} />
), ),
li: (props: Tag<HTMLLIElement>) => <li className="ml-4" {...props} />, li: (props: Tag<HTMLLIElement>) => <li className="ml-4" {...props} />,
ol: (props: Tag<HTMLOListElement>) => ( ol: (props: Tag<HTMLOListElement>) => (
<ol className="ml-4 list-decimal" {...props} /> <ol className="my-2 ml-4 list-decimal" {...props} />
), ),
ul: (props: Tag<HTMLUListElement>) => ( ul: (props: Tag<HTMLUListElement>) => (
<ul className="ml-4 list-disc" {...props} /> <ul className="my-2 ml-4 list-disc" {...props} />
), ),
pre: (props: Tag<HTMLPreElement>) => ( pre: (props: Tag<HTMLPreElement>) => (
<pre className="overflow-auto rounded" {...props} /> <pre className="my-4 overflow-auto rounded" {...props} />
), ),
strong: (props: HTMLTag) => <strong className="font-bold" {...props} />, strong: (props: HTMLTag) => <strong className="font-bold" {...props} />,
}; };

View File

@@ -5,7 +5,7 @@ export const MainLayout: React.FC<Children> = ({ children }) => {
return ( return (
<div className="min-w-screen flex h-screen flex-row"> <div className="min-w-screen flex h-screen flex-row">
<SidePanel /> <SidePanel />
<main className="w-full overflow-y-scroll">{children}</main> <main className="flex-grow overflow-y-scroll">{children}</main>
</div> </div>
); );
}; };

View File

@@ -89,8 +89,8 @@ export const ProjectCard: React.FC<ProjectCardProps> = ({
alt={title} alt={title}
/> />
</div> </div>
<div className="mx-4 my-4 flex flex-grow flex-col justify-between gap-y-2 overflow-hidden overflow-ellipsis transition-all"> <div className="mx-4 flex flex-grow flex-col justify-between gap-y-2 overflow-hidden overflow-ellipsis transition-all">
<label className="block overflow-x-clip overflow-ellipsis whitespace-nowrap text-left font-bold text-r-xl"> <label className="mt-4 block overflow-x-clip overflow-ellipsis whitespace-nowrap text-left font-bold text-r-xl">
{title} {title}
</label> </label>
{showMore && ( {showMore && (
@@ -100,7 +100,7 @@ export const ProjectCard: React.FC<ProjectCardProps> = ({
</p> </p>
</WithScroll> </WithScroll>
)} )}
<div className="flex flex-row items-center gap-x-3"> <div className="mb-4 flex flex-row items-center gap-x-3">
<ProjectLifecycleIndicator state={state} /> <ProjectLifecycleIndicator state={state} />
<p className="overflow-ellipsis"> <p className="overflow-ellipsis">
{/* TODO: Change to time last updated */} {/* TODO: Change to time last updated */}

View File

@@ -22,12 +22,20 @@ const Profile: NextPage<
<p>{data?.bio}</p> <p>{data?.bio}</p>
</div> </div>
<Divider className="my-11" /> <Divider className="my-11" />
<h3 className="mx-11 font-bold text-r-3xl">My Projects</h3> <h2 className="mx-11 font-bold text-r-4xl">My Projects</h2>
<ProjectCardList projects={data?.authoredProjects} /> {data && data.authoredProjects.length > 0 ? (
<h3 className="mx-11 font-bold text-r-3xl"> <ProjectCardList projects={data?.authoredProjects} />
) : (
<p className="mx-11">There are no projects here yet.</p>
)}
<h2 className="mx-11 font-bold text-r-4xl">
Projects I{"'"}ve Worked On Projects I{"'"}ve Worked On
</h3> </h2>
<ProjectCardList projects={data?.projects} /> {data && data.projects.length > 0 ? (
<ProjectCardList projects={data?.projects} />
) : (
<p className="mx-11">There are no projects here yet.</p>
)}
</MainLayout> </MainLayout>
); );
}; };

View File

@@ -57,43 +57,13 @@ const SpecificProject: NextPage<
return ( return (
<MainLayout> <MainLayout>
<article className="mx-11"> <article className="mx-11 max-w-4xl flex-grow">
<h1 className="mb-6 mt-8 font-bold text-primary text-r-5xl"> <h1 className="mb-6 mt-8 font-bold text-primary text-r-5xl">
{data?.title} {data?.title}
</h1> </h1>
<MDX {...description} /> <MDX {...description} />
</article> </article>
{/* {!data ? ( {/* Right side panel */}
<p>Loading...</p>
) : (
<>
<p>{data.title}</p>
<p>{formatDate(data.createdAt)}</p>
<p>{data.description}</p>
<p>ID: {data.id}</p>
<p>State: {data.state}</p>
<div className="flex flex-row gap-x-4">
<Button
variant={{ size: "small" }}
disabled={
data.state === "PROPOSAL" || isUpdatingState || isRefetching
}
onClick={() => changeState(-1)}
>
Prev State
</Button>
<Button
variant={{ size: "small" }}
disabled={
data.state === "COMPLETE" || isUpdatingState || isRefetching
}
onClick={() => changeState(1)}
>
Next State
</Button>
</div>
</>
)} */}
</MainLayout> </MainLayout>
); );
}; };
@@ -129,56 +99,12 @@ export const getServerSideProps = async (ctx: GetServerSidePropsContext) => {
const projectId = Array.isArray(ctx.params.projectId) const projectId = Array.isArray(ctx.params.projectId)
? ctx.params.projectId.join("") ? ctx.params.projectId.join("")
: ctx.params.projectId; : ctx.params.projectId;
// const project = await ssg.projects.getProjectById.fetch({ projectId });
// const projectDescription = project?.description ?? "";
// const mdxSource = await serialize(projectDescription);
const mdxSource = await serialize( const project = await ssg.projects.getProjectById.fetch({ projectId });
` const projectDescription = project?.description ?? "";
# Heading 1 const mdxSource = await serialize(projectDescription, {
mdxOptions: { rehypePlugins: [rehypeHighlight] },
## Heading 2 });
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6
Paragraph text.
[Link](#)
> Blockquote text
Some \`inline code\` example.
---
![Image](#)
- List item 1
- List item 2
- List item 3
1. Ordered item 1
2. Ordered item 2
3. Ordered item 3
\`\`\`javascript
function greet() {
console.log("Hello, world!");
}
\`\`\`
*Emphasized* text.
**Strong** text.
`,
{ mdxOptions: { rehypePlugins: [rehypeHighlight] } }
);
return { props: { projectId, description: mdxSource } }; return { props: { projectId, description: mdxSource } };
}; };

View File

@@ -1,6 +1,4 @@
@tailwind base; @tailwind base;
@tailwind components;
@tailwind utilities;
html, html,
body { body {
@@ -13,6 +11,13 @@ a {
@apply text-r-lg; @apply text-r-lg;
} }
::selection {
@apply bg-[#504945];
}
@tailwind components;
@tailwind utilities;
/* Special */ /* Special */
.custom-home-bg { .custom-home-bg {