-
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.
Merge branch 'v3' into v3-customer-case-block-results
- Loading branch information
Showing
52 changed files
with
1,394 additions
and
225 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
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
42 changes: 42 additions & 0 deletions
42
src/components/customerCases/customerCase/featuredCases/FeaturedCases.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,42 @@ | ||
import Link from "next/link"; | ||
|
||
import { SanitySharedImage } from "src/components/image/SanityImage"; | ||
import Text from "src/components/text/Text"; | ||
import { CustomerCaseBase } from "studioShared/lib/interfaces/customerCases"; | ||
|
||
import styles from "./featuredCases.module.css"; | ||
|
||
export interface FeaturedCasesProps { | ||
featuredCases: CustomerCaseBase[]; | ||
customerCasesPath: string[]; | ||
} | ||
|
||
export default function FeaturedCases({ | ||
featuredCases, | ||
customerCasesPath, | ||
}: FeaturedCasesProps) { | ||
return ( | ||
featuredCases.length > 0 && ( | ||
<div className={styles.wrapper}> | ||
<Text type={"h3"}>Lignende prosjekter</Text> | ||
<div className={styles.content}> | ||
{featuredCases.map((featuredCase) => ( | ||
<div key={featuredCase._id} className={styles.caseWrapper}> | ||
<div className={styles.caseImageWrapper}> | ||
<SanitySharedImage image={featuredCase.image} /> | ||
</div> | ||
<div> | ||
<Link | ||
href={`/${[...customerCasesPath, featuredCase.slug].join("/")}`} | ||
> | ||
<Text type={"bodyBig"}>{featuredCase.basicTitle}</Text> | ||
</Link> | ||
<Text type={"bodySmall"}>{featuredCase.description}</Text> | ||
</div> | ||
</div> | ||
))} | ||
</div> | ||
</div> | ||
) | ||
); | ||
} |
34 changes: 34 additions & 0 deletions
34
src/components/customerCases/customerCase/featuredCases/featuredCases.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,34 @@ | ||
.wrapper { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 2rem; | ||
margin: 4rem 0; | ||
} | ||
|
||
.content { | ||
display: flex; | ||
gap: 5rem; | ||
|
||
@media (max-width: 1024px) { | ||
flex-direction: column; | ||
} | ||
} | ||
|
||
.caseWrapper { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
max-width: 500px; | ||
flex-grow: 1; | ||
flex-basis: 0; | ||
} | ||
|
||
.caseImageWrapper { | ||
width: 100%; | ||
height: 200px; | ||
} | ||
|
||
.caseImageWrapper img { | ||
border-radius: 0.75rem; | ||
width: 100% !important; | ||
} |
23 changes: 23 additions & 0 deletions
23
src/components/customerCases/customerCase/sections/CustomerCaseSection.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,23 @@ | ||
import { CustomerCaseSection as CustomerCaseSectionObject } from "studioShared/lib/interfaces/customerCases"; | ||
|
||
import ImageSection from "./image/ImageSection"; | ||
import QuoteBlock from "./quote/QuoteBlock"; | ||
import RichTextSection from "./richText/RichTextSection"; | ||
import SplitSection from "./splitSection/SplitSection"; | ||
|
||
export function CustomerCaseSection({ | ||
section, | ||
}: { | ||
section: CustomerCaseSectionObject; | ||
}) { | ||
switch (section._type) { | ||
case "splitSection": | ||
return <SplitSection section={section} />; | ||
case "richTextBlock": | ||
return <RichTextSection section={section} />; | ||
case "quoteBlock": | ||
return <QuoteBlock section={section} />; | ||
case "imageBlock": | ||
return <ImageSection section={section} />; | ||
} | ||
} |
Oops, something went wrong.