Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V3 add competence to employee #876

Merged
merged 6 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/components/consultantCard/ConsultantCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Link from "next/link";
import { useTranslations } from "next-intl";

import CustomLink from "src/components/link/CustomLink";
import Text from "src/components/text/Text";
import formatPhoneNumber from "src/components/utils/formatPhoneNumber";
import { ChewbaccaEmployee } from "src/types/employees";
import { aliasFromEmail } from "src/utils/employees";
Expand Down Expand Up @@ -47,6 +48,11 @@ export default function ConsultantCard({
) : (
title
)}
{consultant.competences.map((competence) => (
<Text type="labelRegular" key={competence}>
{competence}
</Text>
))}
{consultant.officeName && (
<p className={styles.consultantRole}>{consultant.officeName}</p>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function SplitSection({ section }: SplitSectionProps) {
return (
<div className={styles.wrapper}>
<div className={styles.content}>
{section.sections.map((section) => (
{section.sections?.map((section) => (
<SplitSectionSection key={section._key} section={section} />
))}
</div>
Expand Down
5 changes: 5 additions & 0 deletions src/components/employeePage/EmployeePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ export default function EmployeePage({ employee }: EmployeePageProps) {
{employee.officeName}
</Text>
)}
{employee.competences.map((competence) => (
<Text type="bodyNormal" key={competence}>
{competence}
</Text>
))}
</div>
</div>
</div>
Expand Down
13 changes: 10 additions & 3 deletions src/components/sections/employees/Employees.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { headers } from "next/headers";
import Image from "next/image";
import Link from "next/link";

import Text from "src/components/text/Text";
import formatPhoneNumber from "src/components/utils/formatPhoneNumber";
import {
aliasFromEmail,
Expand Down Expand Up @@ -74,9 +75,15 @@ export default async function Employees({ language, section }: EmployeesProps) {
</Link>
<div className={styles.employeeInfo}>
<p className={styles.employeeName}>{employee.name}</p>
{employee.officeName && (
<p className={styles.employeeRole}>{employee.officeName}</p>
)}
{employee.competences.map((competence) => (
<Text
type="labelRegular"
key={competence}
className={styles.employeeRole}
>
{competence}
</Text>
))}
{employee.email && (
<p className={styles.employeeEmail}>{employee.email}</p>
)}
Expand Down
4 changes: 1 addition & 3 deletions src/components/sections/employees/employees.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@
}

.employeeRole {
color: var(--primary-black);
font-size: 16px;
font-weight: 300;
color: var(--primary-grey);
}

.employeeEmail,
Expand Down
1 change: 1 addition & 0 deletions src/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ html {
--primary-white: #faf8f5;
--primary-black: #2d2d2d;
--primary-black-darker: #000000;
--primary-grey: #5e5e5e;

--secondary-off-white1: #f4efe8;
--secondary-off-white2: #ece1d3;
Expand Down
6 changes: 5 additions & 1 deletion src/types/employees.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export interface ChewbaccaEmployee {
imageThumbUrl?: string | null;
officeName?: string | null;
startDate?: string | null;
competences: string[];
}

export function isChewbaccaEmployee(
Expand Down Expand Up @@ -52,6 +53,9 @@ export function isChewbaccaEmployee(
value.officeName === null) &&
(!("startDate" in value) ||
typeof value.startDate === "string" ||
value.startDate === null)
value.startDate === null) &&
(!("competences" in value) ||
typeof value.competences === "object" ||
value.competences === null)
);
}