Skip to content

Commit

Permalink
chore: Pass page data straight to home, cv & bio page
Browse files Browse the repository at this point in the history
  • Loading branch information
codinsonn committed Dec 10, 2023
1 parent 173efd8 commit c87fab3
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 35 deletions.
3 changes: 2 additions & 1 deletion features/app-core/routes/bio/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import React from 'react'
import { AetherPage } from 'aetherspace/navigation'
// Screens
import * as bioScreen from 'links-page/screens/BioScreen'
import { userBioMock } from 'links-page/mocks/userBio.mock'

/* --- /bio ------------------------------------------------------------------------------------ */

const PageScreen = (props: bioScreen.TBioScreenProps) => (
<AetherPage
{...props}
{...userBioMock}
params={{ slug: 'codinsonn' }}
screen={bioScreen.BioScreen}
screenConfig={bioScreen.screenConfig}
Expand Down
4 changes: 2 additions & 2 deletions features/app-core/routes/cv/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react'
// Navigation
import { AetherPage } from 'aetherspace/navigation'
// Screens
import * as ResumeScreen from 'cv-page/screens/ResumeScreen'
import { dummyResumeData } from 'cv-page/mocks/resumeData.mock'

/* --- Config ---------------------------------------------------------------------------------- */

Expand All @@ -14,6 +13,7 @@ const screenConfig = ResumeScreen.screenConfig
const PageScreen = (props: ResumeScreen.TResumeScreenProps) => (
<AetherPage
{...props}
{...dummyResumeData}
params={{ slug: 'codinsonn' }}
screen={ScreenComponent}
screenConfig={screenConfig}
Expand Down
3 changes: 2 additions & 1 deletion features/app-core/routes/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import React from 'react'
import { AetherPage } from 'aetherspace/navigation'
// Screens
import * as bioScreen from 'links-page/screens/BioScreen'
import { userBioMock } from 'links-page/mocks/userBio.mock'

/* --- /links ---------------------------------------------------------------------------------- */

const PageScreen = (props: bioScreen.TBioScreenProps) => (
<AetherPage
{...props}
{...userBioMock}
params={{ slug: 'codinsonn' }}
screen={bioScreen.BioScreen}
screenConfig={bioScreen.screenConfig}
Expand Down
3 changes: 2 additions & 1 deletion features/app-core/routes/links/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import React from 'react'
import { AetherPage } from 'aetherspace/navigation'
// Screens
import * as bioScreen from 'links-page/screens/BioScreen'
import { userBioMock } from 'links-page/mocks/userBio.mock'

/* --- /links ---------------------------------------------------------------------------------- */

const PageScreen = (props: bioScreen.TBioScreenProps) => (
<AetherPage
{...props}
{...userBioMock}
params={{ slug: 'codinsonn' }}
screen={bioScreen.BioScreen}
screenConfig={bioScreen.screenConfig}
Expand Down
4 changes: 2 additions & 2 deletions features/app-core/routes/resume/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react'
// Navigation
import { AetherPage } from 'aetherspace/navigation'
// Screens
import * as ResumeScreen from 'cv-page/screens/ResumeScreen'
import { dummyResumeData } from 'cv-page/mocks/resumeData.mock'

/* --- Config ---------------------------------------------------------------------------------- */

Expand All @@ -14,6 +13,7 @@ const screenConfig = ResumeScreen.screenConfig
const PageScreen = (props: ResumeScreen.TResumeScreenProps) => (
<AetherPage
{...props}
{...dummyResumeData}
params={{ slug: 'codinsonn' }}
screen={ScreenComponent}
screenConfig={screenConfig}
Expand Down
6 changes: 3 additions & 3 deletions features/cv-page/components/ResumeEntry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import { twStyled, useTailwindStyles } from 'aetherspace/styles'
export const ResumeEntryProps = aetherSchema('ResumeEntryProps', {
sideLabel: z.string(),
title: z.string(),
subTitle: z.string().optional(),
linkUrl: z.string().optional(),
description: z.string().optional(),
subTitle: z.string().nullish(),
linkUrl: z.string().nullish(),
description: z.string().nullish(),
})

/* --- <ResumeEntry/> -------------------------------------------------------------------------- */
Expand Down
6 changes: 3 additions & 3 deletions features/cv-page/schemas/BaseResumeListItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ const d = {
/** -i- Shared set of datastructure for all kinds of projects you'd like to share on your resume */ // prettier-ignore
export const BaseResumeListItem = BaseLinkData.extendSchema('BaseResumeListItem', {
title: z.string().describe(d.title),
year: z.string().optional().describe(d.year),
collaborators: z.string().optional().describe(d.collaborators),
description: z.string().optional().describe(d.description),
year: z.string().nullish().describe(d.year),
collaborators: z.string().nullish().describe(d.collaborators),
description: z.string().nullish().describe(d.description),
}).describe(d.BaseResumeListItem)

/** -i- Shared set of datastructure for all kinds of projects you'd like to share on your resume */
Expand Down
2 changes: 1 addition & 1 deletion features/cv-page/schemas/ResumeAwardData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const d = {
/** --- ResumeAwardData ---------------------------------------------------------------------- */
/** -i- Data for a project to be listed on the resume */
export const ResumeAwardData = BaseResumeListItem.extendSchema('ResumeAwardData', {
presentedBy: z.string().optional().describe(d.presentedBy),
presentedBy: z.string().nullish().describe(d.presentedBy),
}).describe(d.ResumeAwardData)

/** -i- Data for a project to be listed on the resume */
Expand Down
22 changes: 11 additions & 11 deletions features/cv-page/schemas/ResumeData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ export const ResumeData = aetherSchema('ResumeData', {
slug: z.string().describe(d.slug),
generalData: ResumeCardData,
contactLinks: SocialLinkData.array().describe(d.contactLinks),
projects: ResumeProjectData.array().optional(),
sideProjects: ResumeProjectData.array().optional(),
writing: ResumeWritingData.array().optional(),
speaking: ResumeSpeakingData.array().optional(),
awards: ResumeAwardData.array().optional(),
features: ResumeWritingData.array().optional(),
workExperience: ResumeExperienceData.array().optional(),
volunteering: ResumeExperienceData.array().optional(),
education: ResumeEducationData.array().optional(),
certifications: ResumeCertificationData.array().optional(),
ctaSection: ResumeCTAData.optional(),
projects: ResumeProjectData.array().nullish(),
sideProjects: ResumeProjectData.array().nullish(),
writing: ResumeWritingData.array().nullish(),
speaking: ResumeSpeakingData.array().nullish(),
awards: ResumeAwardData.array().nullish(),
features: ResumeWritingData.array().nullish(),
workExperience: ResumeExperienceData.array().nullish(),
volunteering: ResumeExperienceData.array().nullish(),
education: ResumeEducationData.array().nullish(),
certifications: ResumeCertificationData.array().nullish(),
ctaSection: ResumeCTAData.nullish(),
}).describe(d.ResumeData).eg(dummyResumeData) // prettier-ignore

/** -i- Single Source of Truth for the cv-page screen data */
Expand Down
4 changes: 2 additions & 2 deletions features/cv-page/schemas/ResumeExperienceData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ const d = {
export const ResumeExperienceData = BaseResumeListItem.extendSchema('ResumeExperienceData', {
from: z.string().describe(d.from),
to: z.string().describe(d.to),
title: z.string().optional().describe(d.title),
title: z.string().nullish().describe(d.title),
company: z.string().describe(d.company),
location: z.string().optional().describe(d.location),
location: z.string().nullish().describe(d.location),
}).describe(d.ResumeExperienceData)

/** -i- Experience data for this resume */
Expand Down
12 changes: 6 additions & 6 deletions features/links-page/schemas/BaseLinkData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ const d = {
/** --- BaseLinkData --------------------------------------------------------------------------- */
/** -i- Datastructure for one social link */
export const BaseLinkData = aetherSchema('BaseLinkData', {
id: z.string().coerce().id().optional().describe(d.id),
id: z.string().coerce().id().nullish().describe(d.id),
linkUrl: z.string().describe(d.linkUrl),
linkTitle: z.string().optional().eg('Some link title').describe(d.linkTitle),
linkIconKey: z.string().optional().describe(d.linkIconKey),
sortOrder: z.number().optional().describe(d.sortOrder),
linkTitle: z.string().nullish().eg('Some link title').describe(d.linkTitle),
linkIconKey: z.string().nullish().describe(d.linkIconKey),
sortOrder: z.number().nullish().describe(d.sortOrder),
// - Links & Search Helpers -
userId: z.string().optional().describe(d.userId),
userSlug: z.string().optional().describe(d.userSlug),
userId: z.string().nullish().describe(d.userId),
userSlug: z.string().nullish().describe(d.userSlug),
}).describe(d.BaseLinkData)

/** -i- Datastructure for one social link */
Expand Down
4 changes: 2 additions & 2 deletions features/links-page/screens/BioScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export const BioScreen = (props: TBioScreenProps) => {
href={bioIcon.linkUrl!}
tw={['px-1 xs:px-2 md:px-3', bioIcon.extraClasses]}
>
<AetherIcon name={bioIcon.linkIconKey} size={ICON_SIZE} fill={ICON_COLOR} />
<AetherIcon name={bioIcon.linkIconKey!} size={ICON_SIZE} fill={ICON_COLOR} />
</Link>
))}
</View>
Expand Down Expand Up @@ -144,7 +144,7 @@ export const BioScreen = (props: TBioScreenProps) => {
from the Web,
</Text>
<Text tw="font-primary-light text-secondary text-center text-sm sm:text-base">
*and* <Text tw="font-primary-regular">Higher conversions</Text> on Mobile?
<Text tw="font-primary-regular">Higher conversions</Text> on Mobile?
</Text>
<View tw="h-3" />
<Text tw="flex-row">
Expand Down

0 comments on commit c87fab3

Please sign in to comment.