+
+
{resumeInfo.title}
{resumeInfo.role}
@@ -33,11 +34,11 @@ export default function BrowseListItem({ href, resumeInfo }: Props) {
-
- {/* TODO: Replace hardcoded days ago with calculated days ago*/}
- Uploaded 2 days ago by {resumeInfo.user}
+
+ Uploaded {formatDistanceToNow(resumeInfo.createdAt)} ago by{' '}
+ {resumeInfo.user}
-
+
);
diff --git a/apps/portal/src/components/resumes/browse/constants.ts b/apps/portal/src/components/resumes/browse/constants.ts
index 6a52fc7f..18448cee 100644
--- a/apps/portal/src/components/resumes/browse/constants.ts
+++ b/apps/portal/src/components/resumes/browse/constants.ts
@@ -1,3 +1,9 @@
+export const BROWSE_TABS_VALUES = {
+ ALL: 'all',
+ MY: 'my',
+ STARRED: 'starred',
+};
+
export const SORT_OPTIONS = [
{ current: true, href: '#', name: 'Latest' },
{ current: false, href: '#', name: 'Popular' },
@@ -17,19 +23,33 @@ export const ROLES = [
label: 'Full-Stack Engineer',
value: 'Full-Stack Engineer',
},
- { checked: false, label: 'Frontend Engineer', value: 'frontend-engineer' },
- { checked: false, label: 'Backend Engineer', value: 'backend-engineer' },
- { checked: false, label: 'DevOps Engineer', value: 'devops-engineer' },
- { checked: false, label: 'iOS Engineer', value: 'ios-engineer' },
- { checked: false, label: 'Android Engineer', value: 'android-engineer' },
+ { checked: false, label: 'Frontend Engineer', value: 'Frontend Engineer' },
+ { checked: false, label: 'Backend Engineer', value: 'Backend Engineer' },
+ { checked: false, label: 'DevOps Engineer', value: 'DevOps Engineer' },
+ { checked: false, label: 'iOS Engineer', value: 'iOS Engineer' },
+ { checked: false, label: 'Android Engineer', value: 'Android Engineer' },
];
export const EXPERIENCE = [
- { checked: false, label: 'Freshman', value: 'freshman' },
- { checked: false, label: 'Sophomore', value: 'sophomore' },
- { checked: false, label: 'Junior', value: 'junior' },
- { checked: false, label: 'Senior', value: 'senior' },
- { checked: false, label: 'Fresh Grad (0-1 years)', value: 'freshgrad' },
+ { checked: false, label: 'Freshman', value: 'Freshman' },
+ { checked: false, label: 'Sophomore', value: 'Sophomore' },
+ { checked: false, label: 'Junior', value: 'Junior' },
+ { checked: false, label: 'Senior', value: 'Senior' },
+ {
+ checked: false,
+ label: 'Fresh Grad (0-1 years)',
+ value: 'Fresh Grad (0-1 years)',
+ },
+ {
+ checked: false,
+ label: 'Mid-level (2 - 5 years)',
+ value: 'Mid-level (2 - 5 years)',
+ },
+ {
+ checked: false,
+ label: 'Senior (5+ years)',
+ value: 'Senior (5+ years)',
+ },
];
export const LOCATION = [
diff --git a/apps/portal/src/components/resumes/comments/CommentsForm.tsx b/apps/portal/src/components/resumes/comments/CommentsForm.tsx
index c7b7dc6a..a14f9e3e 100644
--- a/apps/portal/src/components/resumes/comments/CommentsForm.tsx
+++ b/apps/portal/src/components/resumes/comments/CommentsForm.tsx
@@ -1,7 +1,7 @@
import { useState } from 'react';
import type { SubmitHandler } from 'react-hook-form';
import { useForm } from 'react-hook-form';
-import { Button, Dialog, TextInput } from '@tih/ui';
+import { Button, Dialog, TextArea } from '@tih/ui';
import { trpc } from '~/utils/trpc';
@@ -86,45 +86,39 @@ export default function CommentsForm({
- {resumesQuery.isLoading ? (
+ {allResumesQuery.isLoading ||
+ starredResumesQuery.isLoading ||
+ myResumesQuery.isLoading ? (
Loading...
- {resumesQuery.data?.map((resumeObj) => (
+ {resumes.map((resumeObj) => (
-
-
+
))}
diff --git a/apps/portal/src/pages/resumes/submit.tsx b/apps/portal/src/pages/resumes/submit.tsx
index 54bb0e6d..b95a202a 100644
--- a/apps/portal/src/pages/resumes/submit.tsx
+++ b/apps/portal/src/pages/resumes/submit.tsx
@@ -1,10 +1,17 @@
+import clsx from 'clsx';
import Head from 'next/head';
import { useRouter } from 'next/router';
import { useMemo, useState } from 'react';
import type { SubmitHandler } from 'react-hook-form';
import { useForm } from 'react-hook-form';
import { PaperClipIcon } from '@heroicons/react/24/outline';
-import { Button, Select, TextInput } from '@tih/ui';
+import { Button, Select, TextArea, TextInput } from '@tih/ui';
+
+import {
+ EXPERIENCE,
+ LOCATION,
+ ROLES,
+} from '~/components/resumes/browse/constants';
import { trpc } from '~/utils/trpc';
@@ -13,7 +20,7 @@ const TITLE_PLACEHOLDER =
const ADDITIONAL_INFO_PLACEHOLDER = `e.g. I’m applying for company XYZ. I have been resume-rejected by N companies that I have applied for. Please help me to review so company XYZ gives me an interview!`;
const FILE_UPLOAD_ERROR = 'Please upload a PDF file that is less than 10MB.';
-const MAX_FILE_SIZE_LIMIT = 10485760;
+const MAX_FILE_SIZE_LIMIT = 10000000;
type IFormInput = {
additionalInfo?: string;
@@ -25,52 +32,6 @@ type IFormInput = {
};
export default function SubmitResumeForm() {
- // TODO: Use enums instead
- const roleItems = [
- {
- label: 'Frontend Engineer',
- value: 'Frontend Engineer',
- },
- {
- label: 'Full-Stack Engineer',
- value: 'Full-Stack Engineer',
- },
- {
- label: 'Backend Engineer',
- value: 'Backend Engineer',
- },
- ];
-
- const experienceItems = [
- {
- label: 'Fresh Graduate (0 - 1 years)',
- value: 'Fresh Graduate (0 - 1 years)',
- },
- {
- label: 'Mid',
- value: 'Mid',
- },
- {
- label: 'Senior',
- value: 'Senior',
- },
- ];
-
- const locationItems = [
- {
- label: 'United States',
- value: 'United States',
- },
- {
- label: 'Singapore',
- value: 'Singapore',
- },
- {
- label: 'India',
- value: 'India',
- },
- ];
-
const resumeCreateMutation = trpc.useMutation('resumes.resume.user.create');
const router = useRouter();
@@ -126,7 +87,7 @@ export default function SubmitResumeForm() {
Upload a resume
-
+
@@ -139,6 +100,7 @@ export default function SubmitResumeForm() {
errorMessage={errors?.title && 'Title cannot be empty!'}
label="Title"
placeholder={TITLE_PLACEHOLDER}
+ required={true}
onChange={(val) => setValue('title', val)}
/>
@@ -146,7 +108,8 @@ export default function SubmitResumeForm() {