Skip to content

Commit

Permalink
fix #370 - make black hover box go from the edge of the screen
Browse files Browse the repository at this point in the history
  • Loading branch information
rtrembecky committed May 19, 2024
1 parent e8b5664 commit b2b2b46
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/components/PageLayout/PageLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Stack} from '@mui/material'
import {Stack, SxProps} from '@mui/material'
import Grid from '@mui/material/Unstable_Grid2'
import Head from 'next/head'
import {FC, ReactNode} from 'react'
Expand All @@ -15,6 +15,7 @@ type PageLayoutProps = {
contentWidth?: number
title?: string
children: ReactNode
sx?: SxProps
}

const seminarTitle: Record<Seminar, string> = {
Expand All @@ -25,7 +26,7 @@ const seminarTitle: Record<Seminar, string> = {

// pre pouzitie len na seminarovych strankach a podstrankach - `/matik(/*)`
// ked budeme potrebovat top-level stranky ako `/ina-stranka`, budeme musiet upravit, ako sa pracuje s `useSeminarInfo`
export const PageLayout: FC<PageLayoutProps> = ({contentWidth = 2, title = '', children}) => {
export const PageLayout: FC<PageLayoutProps> = ({contentWidth = 2, title = '', children, sx}) => {
const {seminar} = useSeminarInfo()
const browserTitlePrefix = title && `${title} | `
const browserTitle = `${browserTitlePrefix}${seminarTitle[seminar]}`
Expand All @@ -44,7 +45,7 @@ export const PageLayout: FC<PageLayoutProps> = ({contentWidth = 2, title = '', c
<Grid xs={0} md={3} sx={{position: 'relative', display: {xs: 'none', md: 'block'}}}>
<StromLogo />
</Grid>
<Grid xs={12} md={contentWidth * 3} sx={{pb: 2, px: 1}}>
<Grid xs={12} md={contentWidth * 3} sx={{pb: 2, px: 1, ...sx}}>
{children}
</Grid>
</Grid>
Expand Down
5 changes: 4 additions & 1 deletion src/components/Results/ResultsRow.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
display: flex;
justify-content: flex-start;
align-items: center;
padding: 0px;
// top-level PageLayout padding je vypnuty, odsadzame to rucne tu
padding-left: 8px;
}

.nameAndSchool {
Expand Down Expand Up @@ -60,6 +61,8 @@
}

.totalScore {
// top-level PageLayout padding je vypnuty, odsadzame to rucne tu
padding-right: 8px;
display: flex;
justify-content: center;
align-items: center;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/strom/vysledky/[[...params]].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {Results} from '@/components/Results/Results'

const Vysledky: NextPage = () => {
return (
<PageLayout contentWidth={2} title="Výsledky">
<PageLayout contentWidth={2} title="Výsledky" sx={{px: 0}}>
<Results />
</PageLayout>
)
Expand Down

0 comments on commit b2b2b46

Please sign in to comment.