-
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.
feat: initial customer case detail page
- Loading branch information
Showing
7 changed files
with
187 additions
and
6 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
91 changes: 91 additions & 0 deletions
91
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,91 @@ | ||
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) { | ||
console.log(customerCase.image); | ||
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
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,7 @@ | ||
import { IImage } from "studio/lib/interfaces/media"; | ||
|
||
export interface ImageBlock { | ||
_key: string; | ||
_type: "imageBlock"; | ||
images: IImage[]; | ||
} |
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,7 @@ | ||
import { PortableTextBlock } from "sanity"; | ||
|
||
export interface RichTextBlock { | ||
_key: string; | ||
_type: "richTextBlock"; | ||
richText: PortableTextBlock[]; | ||
} |
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