Skip to content

Commit

Permalink
♻️ Bedre visning av bilder i nyhet-modal
Browse files Browse the repository at this point in the history
  • Loading branch information
elitho committed Dec 21, 2024
1 parent 72f57fb commit 0b7894b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
11 changes: 11 additions & 0 deletions src/components/header/nyheter/NyhetModal.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,19 @@
min-height: 10rem;
}

.bildecontainer {
width: 100%;
max-height: 350px;
display: flex;
justify-content: center;

}

.bilde {
object-fit: contain;
width: auto !important;
position: relative !important;
height: unset !important;
}

.step {
Expand Down
17 changes: 9 additions & 8 deletions src/components/header/nyheter/NyhetModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@ export const NyhetModal = ({ onClose, showModal, nyhetModal }: NyhetModalProps):
<PortableText value={slides[slideIndex]?.slideBeskrivelse} components={components} />
)}
{slides[slideIndex]?.bildeUrl && (
<Image
className={styles.bilde}
src={slides[slideIndex]?.bildeUrl}
alt={slides[slideIndex]?.altTekst}
height={400}
width={730}
unoptimized
/>
<div className={styles.bildecontainer}>
<Image
className={styles.bilde}
src={slides[slideIndex]?.bildeUrl}
alt={slides[slideIndex]?.altTekst}
fill
unoptimized
/>
</div>
)}
</Modal.Body>
{slides.length > 1 && (
Expand Down

0 comments on commit 0b7894b

Please sign in to comment.