Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix image section position and featured cases card link #1048

Merged
merged 2 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"image": "image",
"case": "Case",
"field": "Field"
},
"featured_cases": {
"projects": "Featured Projects"
}
},
"contact_information": {
Expand Down
3 changes: 3 additions & 0 deletions messages/no.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"image": "bilde",
"case": "Case",
"field": "Fag"
},
"featured_cases": {
"projects": "Lignende prosjekter"
}
},
"contact_information": {
Expand Down
3 changes: 3 additions & 0 deletions messages/se.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"image": "bild",
"case": "Case",
"field": "Fält"
},
"featured_cases": {
"projects": "Liknande Projekt"
}
},
"contact_information": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Link from "next/link";
import { useTranslations } from "next-intl";

import { SanitySharedImage } from "src/components/image/SanityImage";
import Text from "src/components/text/Text";
Expand All @@ -15,24 +16,26 @@ export default function FeaturedCases({
featuredCases,
customerCasesPath,
}: FeaturedCasesProps) {
const t = useTranslations("customer_case");

return (
featuredCases.length > 0 && (
<div className={styles.wrapper}>
<Text type={"h3"}>Lignende prosjekter</Text>
<Text type={"h3"}>{t("featured_cases.projects")}</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("/")}`}
>
<Link
href={`/${[...customerCasesPath, featuredCase.slug].join("/")}`}
>
<div className={styles.caseImageWrapper}>
<SanitySharedImage image={featuredCase.image} />
</div>
<div>
<Text type={"bodyBig"}>{featuredCase.basicTitle}</Text>
</Link>
<Text type={"bodySmall"}>{featuredCase.description}</Text>
</div>
<Text type={"bodySmall"}>{featuredCase.description}</Text>
</div>
</Link>
</div>
))}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@
}

.caseImageWrapper img {
border-radius: 0.75rem;
border-radius: 1.5rem;
transition: all 0.3s ease;
width: 100% !important;
&:hover {
border-radius: 0.375rem;
}
}

.content:hover img {
border-radius: 0.375rem;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import styles from "./imageSectionComponent.module.css";

const ImageSectionComponent = ({ section }: { section: ImageSection }) => {
return (
<article className={styles.article}>
<div className={styles.article}>
{section.image && (
<div className={styles.image}>
<SanityImage image={section.image} />
</div>
)}
</article>
</div>
);
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
.article {
width: 100%;
max-width: var(--max-content-width-medium);
display: flex;
flex-direction: column;
justify-self: center;
justify-content: center;
}

.image {
display: flex;
flex-shrink: 1;
max-width: 46rem;
max-width: var(--max-content-width-large);
width: 100%;
padding: var(--padding-l) 0rem;

@media (max-width: 834px) {
Expand All @@ -23,16 +23,16 @@
}

.image img {
max-width: var(--max-content-width-large);
max-width: var(--max-content-width-medium) !important;
width: 100%;
height: 100%;
display: block;

@media (max-width: 834px) {
max-width: var(--max-content-width-medium);
max-width: var(--max-content-width-medium) !important;
}

@media (max-width: 425px) {
max-width: var(--max-content-width-small);
max-width: var(--max-content-width-small) !important;
}
}
Loading