diff --git a/apps/portal/prisma/migrations/20221024123252_add_upvotes_to_schema/migration.sql b/apps/portal/prisma/migrations/20221024123252_add_upvotes_to_schema/migration.sql new file mode 100644 index 00000000..81d336ec --- /dev/null +++ b/apps/portal/prisma/migrations/20221024123252_add_upvotes_to_schema/migration.sql @@ -0,0 +1,14 @@ +/* + Warnings: + + - Added the required column `upvotes` to the `QuestionsAnswerComment` table without a default value. This is not possible if the table is not empty. + +*/ +-- AlterTable +ALTER TABLE "QuestionsAnswer" ADD COLUMN "upvotes" INTEGER NOT NULL DEFAULT 0; + +-- AlterTable +ALTER TABLE "QuestionsAnswerComment" ADD COLUMN "upvotes" INTEGER NOT NULL; + +-- AlterTable +ALTER TABLE "QuestionsQuestionComment" ADD COLUMN "upvotes" INTEGER NOT NULL DEFAULT 0; diff --git a/apps/portal/prisma/migrations/20221024123849_add_upvotes_default_value/migration.sql b/apps/portal/prisma/migrations/20221024123849_add_upvotes_default_value/migration.sql new file mode 100644 index 00000000..f4a342af --- /dev/null +++ b/apps/portal/prisma/migrations/20221024123849_add_upvotes_default_value/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "QuestionsAnswerComment" ALTER COLUMN "upvotes" SET DEFAULT 0; diff --git a/apps/portal/prisma/schema.prisma b/apps/portal/prisma/schema.prisma index 7e5d6ecf..7ca71159 100644 --- a/apps/portal/prisma/schema.prisma +++ b/apps/portal/prisma/schema.prisma @@ -454,6 +454,7 @@ model QuestionsQuestionComment { id String @id @default(cuid()) questionId String userId String? + upvotes Int @default(0) content String @db.Text createdAt DateTime @default(now()) updatedAt DateTime @updatedAt @@ -482,6 +483,7 @@ model QuestionsAnswer { questionId String userId String? content String @db.Text + upvotes Int @default(0) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt @@ -510,6 +512,7 @@ model QuestionsAnswerComment { answerId String userId String? content String @db.Text + upvotes Int @default(0) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt diff --git a/apps/portal/src/components/offers/OffersNavigation.ts b/apps/portal/src/components/offers/OffersNavigation.ts index cfa314dc..0c43c644 100644 --- a/apps/portal/src/components/offers/OffersNavigation.ts +++ b/apps/portal/src/components/offers/OffersNavigation.ts @@ -1,13 +1,14 @@ import type { ProductNavigationItems } from '~/components/global/ProductNavigation'; const navigation: ProductNavigationItems = [ - { href: '/offers/submit', name: 'Benchmark your offer' }, + { href: '/offers/browse', name: 'Browse' }, + { href: '/offers/submit', name: 'Analyse your offers' }, ]; const config = { navigation, showGlobalNav: false, - title: 'Tech Offers Repo', + title: 'Offer Profile Repository', titleHref: '/offers', }; diff --git a/apps/portal/src/components/offers/OffersTitle.tsx b/apps/portal/src/components/offers/OffersTitle.tsx index 2668ac4e..52798611 100644 --- a/apps/portal/src/components/offers/OffersTitle.tsx +++ b/apps/portal/src/components/offers/OffersTitle.tsx @@ -3,14 +3,14 @@ export default function OffersTitle() { <>

- Tech Handbook Offers Repo + Offer Profile Repository

Reveal profile stories behind offers
- Benchmark your offers and profiles, learn from other's offer profile, + Click into offers to view profiles, benchmark your offers and profiles, and discuss with the community
diff --git a/apps/portal/src/components/offers/constants.ts b/apps/portal/src/components/offers/constants.ts index 10e3b0b1..e2b14d96 100644 --- a/apps/portal/src/components/offers/constants.ts +++ b/apps/portal/src/components/offers/constants.ts @@ -2,26 +2,6 @@ import { EducationBackgroundType } from './types'; export const emptyOption = '----'; -// TODO: use enums -export const titleOptions = [ - { - label: 'Software Engineer', - value: 'Software Engineer', - }, - { - label: 'Frontend Engineer', - value: 'Frontend Engineer', - }, - { - label: 'Backend Engineer', - value: 'Backend Engineer', - }, - { - label: 'Full-stack Engineer', - value: 'Full-stack Engineer', - }, -]; - export const locationOptions = [ { label: 'Singapore, Singapore', diff --git a/apps/portal/src/components/offers/landing/LeftTextCard.tsx b/apps/portal/src/components/offers/landing/LeftTextCard.tsx new file mode 100644 index 00000000..329a58f5 --- /dev/null +++ b/apps/portal/src/components/offers/landing/LeftTextCard.tsx @@ -0,0 +1,55 @@ +import type { ReactNode } from 'react'; + +import { HOME_URL } from '~/components/offers/types'; + +type LeftTextCardProps = Readonly<{ + description: string; + icon: ReactNode; + imageAlt: string; + imageSrc: string; + title: string; +}>; + +export default function LeftTextCard({ + description, + icon, + imageAlt, + imageSrc, + title, +}: LeftTextCardProps) { + return ( +
+
+
+
+ + {icon} + +
+
+

+ {title} +

+

{description}

+
+ + Get started + +
+
+
+
+
+
+ {imageAlt} +
+
+
+ ); +} diff --git a/apps/portal/src/components/offers/landing/RightTextCard.tsx b/apps/portal/src/components/offers/landing/RightTextCard.tsx new file mode 100644 index 00000000..9028ad16 --- /dev/null +++ b/apps/portal/src/components/offers/landing/RightTextCard.tsx @@ -0,0 +1,55 @@ +import type { ReactNode } from 'react'; + +import { HOME_URL } from '~/components/offers/types'; + +type RightTextCarddProps = Readonly<{ + description: string; + icon: ReactNode; + imageAlt: string; + imageSrc: string; + title: string; +}>; + +export default function RightTextCard({ + description, + icon, + imageAlt, + imageSrc, + title, +}: RightTextCarddProps) { + return ( +
+
+
+
+ + {icon} + +
+
+

+ {title} +

+

{description}

+
+ + Get started + +
+
+
+
+
+
+ {imageAlt} +
+
+
+ ); +} diff --git a/apps/portal/src/components/offers/offersSubmission/OffersSubmissionForm.tsx b/apps/portal/src/components/offers/offersSubmission/OffersSubmissionForm.tsx index 95d43be8..0e1127ab 100644 --- a/apps/portal/src/components/offers/offersSubmission/OffersSubmissionForm.tsx +++ b/apps/portal/src/components/offers/offersSubmission/OffersSubmissionForm.tsx @@ -115,7 +115,7 @@ export default function OffersSubmissionForm({ ), hasNext: true, hasPrevious: false, - label: 'Offer details', + label: 'Offers', }, { component: , @@ -125,28 +125,33 @@ export default function OffersSubmissionForm({ }, { component: ( - ), hasNext: true, hasPrevious: false, - label: 'Analysis', + label: 'Save profile', }, { component: ( - +
+
+ Result +
+ +
), hasNext: false, - hasPrevious: false, - label: 'Save', + hasPrevious: true, + label: 'Analysis', }, ]; @@ -231,7 +236,7 @@ export default function OffersSubmissionForm({
{formSteps[formStep].component} - {/*
{JSON.stringify(formMethods.watch(), null, 2)}
*/} +
{JSON.stringify(formMethods.watch(), null, 2)}
{formSteps[formStep].hasNext && (