-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v3 - customer case detail and landing page (#793)
* feat: remove global :focus * feat: update color palette * feat(SanityImage): alternatives to useNextSanityGlobalImage If the project is known, the image url should be used directly without the existence check * feat(SanityImage): blurDataURL * feat(customerCase): remove root rich text field * feat: initial customer case detail page * feat(customerCases): initial customer cases landing page
- Loading branch information
Showing
13 changed files
with
280 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
src/components/customerCases/customerCase/CustomerCase.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import { SanitySharedImage } from "src/components/image/SanityImage"; | ||
import { RichText } from "src/components/richText/RichText"; | ||
import Text from "src/components/text/Text"; | ||
import { CustomerCase as CustomerCaseDocument } from "studioShared/lib/interfaces/customerCases"; | ||
|
||
import styles from "./customerCase.module.css"; | ||
|
||
export interface CustomerCaseProps { | ||
customerCase: CustomerCaseDocument; | ||
} | ||
|
||
export default function CustomerCase({ customerCase }: CustomerCaseProps) { | ||
return ( | ||
<div className={styles.wrapper}> | ||
<div className={styles.content}> | ||
<Text type={"h1"} className={styles.mainTitle}> | ||
{customerCase.basicTitle} | ||
</Text> | ||
<div className={styles.mainImageWrapper}> | ||
<SanitySharedImage image={customerCase.image} /> | ||
</div> | ||
<div className={styles.ingress}> | ||
<Text type={"bodyLarge"}>{customerCase.description}</Text> | ||
<div className={styles.projectInfo}> | ||
<div className={styles.projectInfoItem}> | ||
<Text>Kunde</Text> | ||
<Text className={styles.projectInfoItemValue}> | ||
{customerCase.projectInfo.customer} | ||
</Text> | ||
</div> | ||
<div className={styles.projectInfoItem}> | ||
<Text>Prosjekt</Text> | ||
<Text className={styles.projectInfoItemValue}> | ||
{customerCase.projectInfo.name} | ||
</Text> | ||
</div> | ||
<div className={styles.projectInfoItem}> | ||
<Text>Varighet</Text> | ||
<Text className={styles.projectInfoItemValue}> | ||
{customerCase.projectInfo.duration} | ||
</Text> | ||
</div> | ||
</div> | ||
<div className={styles.projectInfo}> | ||
<div className={styles.projectInfoItem}> | ||
<Text>Bransje</Text> | ||
<Text className={styles.projectInfoItemValue}> | ||
{customerCase.projectInfo.sector} | ||
</Text> | ||
</div> | ||
<div className={styles.projectInfoItem}> | ||
<Text>Leveranse</Text> | ||
<Text className={styles.projectInfoItemValue}> | ||
{customerCase.projectInfo.delivery} | ||
</Text> | ||
</div> | ||
<div className={styles.projectInfoItem}> | ||
<Text>Konsulenter</Text> | ||
<Text className={styles.projectInfoItemValue}> | ||
{customerCase.projectInfo.consultants.join(", ")} | ||
</Text> | ||
</div> | ||
</div> | ||
</div> | ||
<div className={styles.sectionsWrapper}> | ||
{customerCase.sections.map((section) => ( | ||
<div key={section._key}> | ||
{section._type === "richTextBlock" ? ( | ||
<RichText value={section.richText} /> | ||
) : ( | ||
<div className={styles.imageBlockWrapper}> | ||
{section.images.map((image) => ( | ||
<div | ||
key={image._key} | ||
className={styles.imageBlockImageWrapper} | ||
> | ||
<div className={styles.imageBlockImageContent}> | ||
<SanitySharedImage image={image} /> | ||
</div> | ||
</div> | ||
))} | ||
</div> | ||
)} | ||
</div> | ||
))} | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |
70 changes: 70 additions & 0 deletions
70
src/components/customerCases/customerCase/customerCase.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
.wrapper { | ||
display: flex; | ||
flex-direction: column; | ||
margin: 8rem 0; | ||
align-items: center; | ||
} | ||
|
||
.content { | ||
display: flex; | ||
flex-direction: column; | ||
max-width: 1200px; | ||
gap: 2rem; | ||
padding: 1rem; | ||
} | ||
|
||
.mainTitle { | ||
font-weight: 600; | ||
} | ||
|
||
.mainImageWrapper img { | ||
border-radius: 12px; | ||
} | ||
|
||
.ingress { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1.5rem; | ||
} | ||
|
||
.projectInfo { | ||
display: flex; | ||
gap: 1rem; | ||
flex-grow: 1; | ||
} | ||
|
||
.projectInfoItem { | ||
display: flex; | ||
gap: 1rem; | ||
} | ||
|
||
.projectInfoItemValue { | ||
font-weight: 300; | ||
white-space: nowrap; | ||
} | ||
|
||
.sectionsWrapper { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 2rem; | ||
} | ||
|
||
.imageBlockWrapper { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
} | ||
|
||
.imageBlockImageWrapper { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
} | ||
|
||
.imageBlockImageContent { | ||
max-width: 800px; | ||
} | ||
|
||
.imageBlockImageContent img { | ||
border-radius: 12px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,34 @@ | ||
.wrapper { | ||
display: flex; | ||
flex-direction: column; | ||
padding: 10rem 5rem; | ||
margin: 8rem 0; | ||
align-items: center; | ||
} | ||
|
||
.content { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 5rem; | ||
max-width: 1200px; | ||
padding: 1rem; | ||
} | ||
|
||
.section { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 5rem; | ||
} | ||
|
||
.caseWrapper { | ||
display: flex; | ||
gap: 3rem; | ||
} | ||
|
||
.caseImageWrapper { | ||
min-width: 20rem; | ||
max-width: 20rem; | ||
} | ||
|
||
.caseImageWrapper img { | ||
border-radius: 12px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.