Skip to content

Commit

Permalink
Handle 9 tracks by showing "mobile" layout up to 1024px (lg breakpoint)
Browse files Browse the repository at this point in the history
  • Loading branch information
bplowry committed Jul 17, 2022
1 parent a289fb4 commit e431fcd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
7 changes: 4 additions & 3 deletions components/Agenda/Agenda.styled.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { breakpoint, breakpointBetween, breakpointMax } from 'components/utils/styles/breakpoints'
import { calcRem } from 'components/utils/styles/calcRem'
import styled from '@emotion/styled'
import { tableLayoutBreakpointFrom } from './layout'

const rowBackgroundColor = '#f9f9f9'
const cellBorder = '1px solid #ddd'
Expand Down Expand Up @@ -40,7 +41,7 @@ export const StyledAgendaRow = styled('section')<StyledAgendaRowProps>(({ tracks
},
},

[breakpointBetween('xs', 'sm')]: {
[breakpointBetween('xs', tableLayoutBreakpointFrom)]: {
[`& > section:nth-child(${Math.floor(tracks / 2)}n+1)`]: {
borderRight: 0,
},
Expand All @@ -54,7 +55,7 @@ export const StyledAgendaRow = styled('section')<StyledAgendaRowProps>(({ tracks
gridTemplateColumns: `repeat(${Math.floor(tracks / 2)}, 1fr)`,
},

[breakpoint('sm')]: {
[breakpoint(tableLayoutBreakpointFrom)]: {
gridTemplateColumns: `${calcRem(90)} repeat(auto-fit, minmax(${calcRem(80)}, 1fr))`,
'& > div:not(:last-child)': {
borderRight: cellBorder,
Expand All @@ -80,7 +81,7 @@ export const StyledAgendaRowList = styled('ul')(({ theme }) => ({
textAlign: 'center',
},

[breakpoint('sm')]: {
[breakpoint(tableLayoutBreakpointFrom)]: {
display: 'grid',
gridTemplateColumns: `${calcRem(90)} repeat(auto-fit, minmax(${calcRem(80)}, 1fr))`,
gridGap: calcRem(1),
Expand Down
5 changes: 3 additions & 2 deletions components/Agenda/AgendaSession.styled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { breakpoint, breakpointMax } from 'components/utils/styles/breakpoints'
import { calcRem } from 'components/utils/styles/calcRem'
import styled from '@emotion/styled'
import { zIndex } from 'components/utils/styles/zindex'
import { tableLayoutBreakpointFrom } from './layout'

interface StyledSectionProps {
fullWidth?: boolean
Expand All @@ -11,7 +12,7 @@ interface StyledSectionProps {
export const StyledSection = styled('section')<StyledSectionProps>(({ fullWidth, session }) => ({
padding: session ? undefined : calcRem(20, 8),

[breakpointMax('sm')]: {
[breakpointMax(tableLayoutBreakpointFrom)]: {
gridColumn: fullWidth ? '1 / -1' : 'auto',
},
}))
Expand Down Expand Up @@ -95,7 +96,7 @@ export const StyledRoom = styled('span')<StyledRoomProps>(({ theme, showOnMobile
fontWeight: theme.weights.semiBold,
textAlign: showOnMobile ? 'center' : undefined,

[breakpoint('sm')]: {
[breakpoint(tableLayoutBreakpointFrom)]: {
display: showOnMobile ? 'none' : undefined,
},
}))
Expand Down
3 changes: 2 additions & 1 deletion components/Agenda/Agendatime.styled.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { breakpoint } from 'components/utils/styles/breakpoints'
import { calcRem } from 'components/utils/styles/calcRem'
import styled from '@emotion/styled'
import { tableLayoutBreakpointFrom } from './layout'

export const StyledAgendaTime = styled('div')(({ theme }) => ({
gridColumn: `1 / -1`,
Expand All @@ -9,7 +10,7 @@ export const StyledAgendaTime = styled('div')(({ theme }) => ({
color: '#fff',
fontWeight: theme.weights.semiBold,

[breakpoint('sm')]: {
[breakpoint(tableLayoutBreakpointFrom)]: {
gridColumn: 'auto',
backgroundColor: 'transparent',
color: 'inherit',
Expand Down
1 change: 1 addition & 0 deletions components/Agenda/layout.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const tableLayoutBreakpointFrom = 'lg'

0 comments on commit e431fcd

Please sign in to comment.