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

index: Fix layout break on smaller viewports. #1592

Merged
merged 10 commits into from
Sep 15, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useMemo } from 'react'
import { useTranslation, i18n } from 'next-i18next'
import { CampaignResponse } from 'gql/campaigns'

import { Box, CardMedia } from '@mui/material'
import { Box } from '@mui/material'

import { routes } from 'common/routes'
import { campaignListPictureUrl } from 'common/util/campaignImageUrls'
Expand Down
2 changes: 1 addition & 1 deletion src/components/client/campaigns/CampaignProgress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function CampaignProgress({ campaignId, raised, target }: Props)
labelSize={theme.spacing(1.5)}
labelAlignment={percentageRound < 10 ? 'left' : 'right'}
customLabelStyles={{ fontWeight: 400 }}
animateOnRender={true}
transitionDuration={'0s'}
/>
)
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useTranslation, i18n } from 'next-i18next'
import { CampaignResponse } from 'gql/campaigns'

import { Box, CardMedia } from '@mui/material'
import { Box } from '@mui/material'

import Link from 'components/common/Link'
import CampaignProgress from 'components/client/campaigns/CampaignProgress'
Expand Down Expand Up @@ -39,16 +39,11 @@ export default function ActiveCampaignCard({ campaign, index }: Props) {
<Box
position={'relative'}
sx={{
// aspectRatio: 4 / 3,
// [theme.breakpoints.up('lg')]: {
// aspectRatio: 0,
// height: index === 0 ? theme.spacing(71.6) : theme.spacing(27.85),
// },
width: '100%',
aspectRatio: 1.5,
[theme.breakpoints.up('lg')]: {
maxHeight: index === 0 ? theme.spacing(71.6) : theme.spacing(27.85),
aspectRatio: index === 0 ? 1.24 : 1.55,
maxHeight: index === 0 ? theme.spacing(71.2) : theme.spacing(27.65),
aspectRatio: index === 0 ? 0.9 : 1,
},
}}>
<Image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default function CompletedCampaignsSection() {
<CompletedCampaignLink
onMouseDown={onLinkMouseDown}
href={routes.campaigns.viewCampaignBySlug(campaign.slug)}
sx={{ position: 'relative', aspectRatio: 1, height: (theme) => theme.spacing(37.5) }}>
sx={{ position: 'relative', width: '100%', aspectRatio: 1 }}>
<Image
fill
alt={campaign.title}
Expand Down
2 changes: 1 addition & 1 deletion src/components/client/layout/AppNavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Link from 'next/link'
import { useRouter } from 'next/router'
import { Menu } from '@mui/icons-material'
import useScrollTrigger from '@mui/material/useScrollTrigger'
import { AppBar, Toolbar, IconButton, Grid, Hidden, ButtonBase } from '@mui/material'
import { AppBar, Toolbar, IconButton, Grid, ButtonBase } from '@mui/material'

import { routes } from 'common/routes'
import PodkrepiLogo from 'components/common/brand/PodkrepiLogo'
Expand Down
2 changes: 1 addition & 1 deletion src/components/client/layout/Footer/LogoSocialIcons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Grid } from '@mui/material'
import { routes } from 'common/routes'
import PodkrepiLogo from 'components/common/brand/PodkrepiLogo'
import { SocialIcons } from './SocialIcons'
import { SubscribeBtn } from './SubscribeBtn'
// import { SubscribeBtn } from './SubscribeBtn'

export const LogoSocialIcons = () => {
const { locale } = useRouter()
Expand Down
2 changes: 1 addition & 1 deletion src/components/client/layout/nav/DonationMenuMobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function DonationMenuMobile() {
<AccordionSummary
className={classes.accordionSummary}
expandIcon={<ExpandMoreIcon />}
aria-controls="panel1a-content">
aria-controls="campaign-panel-content">
{t('nav.campaigns.index')}
</AccordionSummary>
<AccordionDetails>
Expand Down
6 changes: 3 additions & 3 deletions src/components/client/layout/nav/MobileNav/MobileNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useRouter } from 'next/router'
import { useTranslation } from 'next-i18next'
import Link from 'next/link'

import { SwipeableDrawer, Hidden, Grid } from '@mui/material'
import { SwipeableDrawer, Grid } from '@mui/material'
import FavoriteIcon from '@mui/icons-material/Favorite'

import PodkrepiLogo from 'components/common/brand/PodkrepiLogo'
Expand Down Expand Up @@ -44,7 +44,7 @@ export default function MobileNav({ mobileOpen, setMobileOpen }: NavDeckProps) {
}, [])

return (
<Hidden mdUp implementation="css">
<Grid sx={{ display: { xs: 'flex', md: 'none' } }}>
<SwipeableDrawer
anchor="right"
open={mobileOpen}
Expand Down Expand Up @@ -80,6 +80,6 @@ export default function MobileNav({ mobileOpen, setMobileOpen }: NavDeckProps) {
</Grid>
</NavMenuWrapper>
</SwipeableDrawer>
</Hidden>
</Grid>
)
}
2 changes: 1 addition & 1 deletion src/components/client/layout/nav/ProjectMenuMobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function ProjectMenuMobile() {
<StyledAccordion className={classes.accordionWrapper}>
<AccordionSummary
expandIcon={<ExpandMoreIcon />}
aria-controls="panel1a-content"
aria-controls="aboutus-panel-content"
className={classes.accordionSummary}>
{t('nav.about.about-us')}
</AccordionSummary>
Expand Down
1 change: 1 addition & 0 deletions src/components/client/layout/nav/PublicMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export default function PublicMenu() {
onClick={handleMenu}
size="medium"
color="inherit"
aria-label="authentication"
classes={{ endIcon: classes.dropdownArrowIcon }}
endIcon={
open ? <ArrowDropUpIcon color="primary" /> : <ArrowDropDownIcon color="primary" />
Expand Down
Loading