-
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.
* fix(customerCase): prevent content overflow * feat(customerCase): featured customer cases * feat(featuredCases): case link in title
- Loading branch information
Showing
9 changed files
with
164 additions
and
11 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
4 changes: 2 additions & 2 deletions
4
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
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; | ||
} |
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