Skip to content

Commit

Permalink
Merge branch 'bose/2290' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
BorghildSelle committed Aug 16, 2024
2 parents 3da6743 + 9c9e8dd commit 7188615
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions web/pageComponents/shared/Hero/FullImageHero.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,15 @@
import styled from 'styled-components'
import type { HeroType, ImageWithCaptionData } from 'types'
import { useSanityLoader } from '../../../lib/hooks/useSanityLoader'
import Image, { Ratios } from '../SanityImage'
import { StyledCaption } from '../image/StyledCaption'

const ImgWrapper = styled.div`
height: calc(100vh - var(--topbar-height));
position: relative;
`

type FullImageHeroType = {
figure: ImageWithCaptionData
ratio?: string
}

const imageSizes = '100vw'

const FullScreenHero = ({ figure }: FullImageHeroType) => {
return (
<ImgWrapper>
<Image maxWidth={2560} image={figure.image} fill sizes={imageSizes} priority />
</ImgWrapper>
)
}

const NarrowHero = ({ figure }: FullImageHeroType) => {
// 4:3 for small screens and 10:3 for large screens
const desktopUrl = useSanityLoader(figure.image, 2560, Ratios.THREE_TO_TEN)
Expand Down Expand Up @@ -60,8 +46,6 @@ export const FullImageHero = ({ ratio, figure, hideImageCaption, captionBg }: He
const getHero = () => {
if (figure)
switch (ratio) {
case 'fullScreen':
return <FullScreenHero figure={figure} />
case 'narrow':
return <NarrowHero figure={figure} />
case 'tall':
Expand Down

0 comments on commit 7188615

Please sign in to comment.