- {/* TODO: add logic for location buttons */}
- {companyLocations &&
- companyLocations.data.map((location) => (
-
- ))}
+
+
+
+ {/* TODO: translation */}
+
+ Trenger du hjelp med lignende eller noe helt annet?
+
+ Kontakt salg!
+
+
+
+
- {consultantsResult.ok && (
-
- )}
);
-};
-export default ContactInformation;
+}
diff --git a/src/components/customerCases/customerCase/contactInformation/contactInformation.module.css b/src/components/customerCases/customerCase/contactInformation/contactInformation.module.css
index cccd8e441..e86f6bf9c 100644
--- a/src/components/customerCases/customerCase/contactInformation/contactInformation.module.css
+++ b/src/components/customerCases/customerCase/contactInformation/contactInformation.module.css
@@ -1,17 +1,32 @@
-.container {
+.wrapper {
+ display: flex;
+ flex-direction: column;
+ margin: 4rem 0;
+
+ @media (min-width: 1024px) {
+ align-items: center;
+ }
+}
+
+.content {
display: flex;
flex-direction: row;
- gap: 3rem;
- padding: 0 12.5rem;
+ gap: 1rem;
+ max-width: 960px;
+
+ @media (max-width: 1024px) {
+ flex-direction: column;
+ gap: 2rem;
+ }
}
.titleSection {
display: flex;
flex-direction: column;
+ gap: 0.75rem;
}
-.locationSection {
+.contactSection {
display: flex;
- flex-direction: column;
- gap: 0.75rem;
+ gap: 1.5rem;
}
diff --git a/src/components/customerCases/customerCase/contactInformation/contactSelector/ContactSelector.tsx b/src/components/customerCases/customerCase/contactInformation/contactSelector/ContactSelector.tsx
new file mode 100644
index 000000000..479bb362e
--- /dev/null
+++ b/src/components/customerCases/customerCase/contactInformation/contactSelector/ContactSelector.tsx
@@ -0,0 +1,68 @@
+"use client";
+
+import { useState } from "react";
+
+import Button from "src/components/buttons/Button";
+import ConsultantCard from "src/components/consultantCard/ConsultantCard";
+import { ChewbaccaEmployee } from "src/types/employees";
+import { CompanyLocation } from "studio/lib/interfaces/companyDetails";
+
+import styles from "./contactSelector.module.css";
+
+export type ContactByLocationMap = {
+ [locationId: string]: ChewbaccaEmployee;
+};
+
+export interface ContactSelectorProps {
+ language: string;
+ locations: CompanyLocation[];
+ contactByLocation: ContactByLocationMap;
+ employeePageSlug?: string;
+}
+
+export default function ContactSelector({
+ language,
+ locations,
+ contactByLocation,
+ employeePageSlug,
+}: ContactSelectorProps) {
+ const locationIds = Object.keys(contactByLocation);
+
+ const [selectedLocationId, setSelectedLocationId] = useState
(
+ locationIds.length === 0 ? locationIds[0] : null,
+ );
+
+ if (locationIds.length === 0) {
+ return;
+ }
+
+ const selectedOrDefaultLocationId = selectedLocationId ?? locationIds[0];
+
+ return (
+ <>
+
+ {locations.map((location) => (
+
+ ))}
+
+
+
+
+ >
+ );
+}
diff --git a/src/components/customerCases/customerCase/contactInformation/contactSelector/contactSelector.module.css b/src/components/customerCases/customerCase/contactInformation/contactSelector/contactSelector.module.css
new file mode 100644
index 000000000..e0f2ce2ef
--- /dev/null
+++ b/src/components/customerCases/customerCase/contactInformation/contactSelector/contactSelector.module.css
@@ -0,0 +1,9 @@
+.locationSection {
+ display: flex;
+ flex-direction: column;
+ gap: 0.75rem;
+}
+
+.consultantSection {
+ min-width: 400px;
+}
diff --git a/src/components/customerCases/customerCase/sections/customerCaseConsultants/CustomerCaseConsultants.tsx b/src/components/customerCases/customerCase/sections/customerCaseConsultants/CustomerCaseConsultants.tsx
index 385872e7d..ed91f8204 100644
--- a/src/components/customerCases/customerCase/sections/customerCaseConsultants/CustomerCaseConsultants.tsx
+++ b/src/components/customerCases/customerCase/sections/customerCaseConsultants/CustomerCaseConsultants.tsx
@@ -1,11 +1,6 @@
-import Image from "next/image";
-import Link from "next/link";
-
-import CustomLink from "src/components/link/CustomLink";
+import ConsultantCard from "src/components/consultantCard/ConsultantCard";
import Text from "src/components/text/Text";
import { ChewbaccaEmployee } from "src/types/employees";
-import { aliasFromEmail } from "src/utils/employees";
-import { LinkType } from "studio/lib/interfaces/navigation";
import { EMPLOYEE_PAGE_SLUG_QUERY } from "studio/lib/queries/siteSettings";
import { loadStudioQuery } from "studio/lib/store";
@@ -32,63 +27,14 @@ export default async function CustomerCaseConsultants({
Varianter på prosjektet
- {consultants.map((consultant) => {
- const title = (
-
{consultant.name}
- );
- return (
- consultant.imageThumbUrl &&
- consultant.name &&
- consultant.email && (
-
-
-
-
-
- {employeePageSlug !== undefined ? (
-
- {title}
-
- ) : (
- title
- )}
- {consultant.officeName && (
-
- {consultant.officeName}
-
- )}
- {consultant.email && (
-
{consultant.email}
- )}
- {consultant.telephone && (
-
- {consultant.telephone}
-
- )}
-
-
-
- )
- );
- })}
+ {consultants.map((consultant) => (
+
+ ))}
);
diff --git a/src/components/customerCases/customerCase/sections/customerCaseConsultants/customerCaseConsulants.module.css b/src/components/customerCases/customerCase/sections/customerCaseConsultants/customerCaseConsulants.module.css
index 09d000704..0745727f4 100644
--- a/src/components/customerCases/customerCase/sections/customerCaseConsultants/customerCaseConsulants.module.css
+++ b/src/components/customerCases/customerCase/sections/customerCaseConsultants/customerCaseConsulants.module.css
@@ -14,47 +14,3 @@
grid-template-columns: repeat(auto-fit, 350px);
justify-content: space-between;
}
-
-.consultant {
- display: flex;
- width: 100%;
- gap: 1rem;
-}
-
-.consultantImage {
- display: flex;
- flex-direction: column;
- align-items: center;
- background-color: var(--primary-black);
- border-radius: 12px;
- height: 125px;
- width: 50%;
- padding: 1rem;
- position: relative;
-}
-
-.consultantInfo {
- display: flex;
- flex-direction: column;
- width: 50%;
- gap: 0.5rem;
-}
-
-.consultantName {
- color: var(--primary-black);
- font-size: 16px;
- font-weight: 600;
-}
-
-.consultantRole {
- color: var(--primary-black);
- font-size: 16px;
- font-weight: 300;
-}
-
-.consultantEmail,
-.consultantTelephone {
- color: var(--primary-black);
- font-size: 14px;
- font-weight: 300;
-}
diff --git a/src/styles/global.css b/src/styles/global.css
index d20a2e753..e266074ff 100644
--- a/src/styles/global.css
+++ b/src/styles/global.css
@@ -18,6 +18,7 @@ html {
--primary-white-bright: #ffffff;
--primary-white: #faf8f5;
--primary-black: #2d2d2d;
+ --primary-black-darker: #000000;
--secondary-off-white1: #f4efe8;
--secondary-off-white2: #ece1d3;
diff --git a/studio/lib/interfaces/companyDetails.ts b/studio/lib/interfaces/companyDetails.ts
index 81dec6502..5cd64b12c 100644
--- a/studio/lib/interfaces/companyDetails.ts
+++ b/studio/lib/interfaces/companyDetails.ts
@@ -10,4 +10,5 @@ export interface CompanyLocation {
_id: string;
_updatedAt: string;
companyLocationName: string;
+ contactPerson?: string;
}
diff --git a/studio/schemas/documents/admin/companyLocation.ts b/studio/schemas/documents/admin/companyLocation.ts
index 0d87dee31..04ee26a6b 100644
--- a/studio/schemas/documents/admin/companyLocation.ts
+++ b/studio/schemas/documents/admin/companyLocation.ts
@@ -24,7 +24,7 @@ const companyLocation = defineType({
}),
defineField({
name: companyLocationContactPersonID,
- type: "string",
+ type: "email",
title: "Contact person for Sales",
description: "Add the email of the contact person for Sales",
}),