Skip to content

Commit 20e79ee

Browse files
authored
Revert "feat(large): Unify Persistent Footers for Mobile Optimization" (#9426)
1 parent 404f59c commit 20e79ee

19 files changed

Lines changed: 304 additions & 286 deletions

app/client/connect/ConnectView.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import BatteryStdIcon from '@mui/icons-material/BatteryStd'
1111
import BatteryAlertIcon from '@mui/icons-material/BatteryAlert'
1212
import BluetoothDisabledIcon from '@mui/icons-material/BluetoothDisabled'
1313
import HrTile from '../../../components/HrTile'
14+
import BottomNavBar from '../../../components/BottomNavBar'
1415
import WorkoutSummary from './WorkoutSummary'
1516
import UserSettings from './UserSettings'
1617
import { SignalQualityIndicator } from './SignalQualityIndicator'
@@ -117,6 +118,7 @@ export default function ConnectView({
117118
Edge, or Bluefy (on iOS).
118119
</Alert>
119120
<ResetSection onReset={handleFullReset} isResetting={isResetting} />
121+
<BottomNavBar />
120122
</Container>
121123
)
122124
}
@@ -283,6 +285,7 @@ export default function ConnectView({
283285

284286
<ResetSection onReset={handleFullReset} isResetting={isResetting} />
285287
</Container>
288+
<BottomNavBar />
286289
</>
287290
)
288291
}

app/client/mock/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Grid from '@mui/material/Grid'
1010
import TextField from '@mui/material/TextField'
1111
import Typography from '@mui/material/Typography'
1212
import { useCallback, useEffect, useState } from 'react'
13+
import BottomNavBar from '../../../components/BottomNavBar'
1314
import { useWebSocket } from '@/context/WebSocketContext'
1415
import {
1516
HrmInputMessage,
@@ -334,6 +335,7 @@ export default function MockPage() {
334335
</Box>
335336
</Card>
336337
</Container>
338+
<BottomNavBar />
337339
</>
338340
)
339341
}

app/main.tsx

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
import { AnimatePresence, motion } from 'framer-motion'
44
import { usePathname } from 'next/navigation'
5-
import Box from '@mui/material/Box'
6-
import CombinedFooter from '@/components/CombinedFooter'
5+
import BottomNavBar from '@/components/BottomNavBar'
76
import ErrorBoundary from '@/components/ErrorBoundary'
87
import ErrorFallback from '@/components/ErrorFallback'
98
import Footer from '@/components/Footer'
@@ -18,7 +17,6 @@ import { UserSettingsProvider } from '@/context/UserSettingsContext'
1817

1918
export default function Main({ children }: { children: React.ReactNode }) {
2019
const pathname = usePathname()
21-
2220
return (
2321
<ErrorBoundary fallback={<ErrorFallback />}>
2422
<ErrorProvider>
@@ -28,34 +26,27 @@ export default function Main({ children }: { children: React.ReactNode }) {
2826
<UserSettingsProvider>
2927
<TimerSoundProvider>
3028
<AnimatePresence mode="wait">
31-
<Box
32-
component={motion.main}
29+
<motion.main
3330
key={pathname}
3431
variants={pageVariants}
3532
initial="initial"
3633
animate="in"
3734
exit="out"
3835
data-testid="main-content-layout"
3936
role="main"
40-
sx={{
41-
pb: 'var(--footer-height, 56px)',
42-
minHeight: '100vh',
43-
display: 'flex',
44-
flexDirection: 'column',
45-
}}
4637
>
47-
<Box sx={{ flex: 1 }}>{children}</Box>
48-
<Footer />
49-
</Box>
38+
{children}
39+
</motion.main>
5040
</AnimatePresence>
51-
<CombinedFooter />
5241
</TimerSoundProvider>
5342
</UserSettingsProvider>
5443
</Providers>
5544
</NotificationProvider>
5645
<LoadingIndicator />
5746
</LoadingProvider>
5847
</ErrorProvider>
48+
<Footer />
49+
<BottomNavBar />
5950
</ErrorBoundary>
6051
)
6152
}

components/BottomNavBar.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,12 @@ export default function BottomNavBar() {
5858
showLabels
5959
sx={{
6060
width: '100%',
61-
position: 'static',
61+
position: 'fixed',
62+
bottom: 0,
63+
left: 0,
64+
right: 0,
6265
zIndex: 1000,
66+
boxShadow: '0px -2px 4px rgba(0, 0, 0, 0.1)',
6367
}}
6468
>
6569
{NAV_ITEMS.map((item, index) => (

components/CombinedFooter.tsx

Lines changed: 0 additions & 56 deletions
This file was deleted.

components/DashboardClient.tsx

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,26 @@ import HrmConnectionPanel from '@/components/HrmConnectionPanel'
1111
import TimerDisplay from '@/components/TimerDisplay'
1212
import { useAudio } from '@/hooks/useAudio'
1313

14+
// Dynamically import SpotifyDisplay with SSR disabled.
15+
const SpotifyDisplay = dynamic(() => import('@/components/SpotifyDisplay'), {
16+
ssr: false,
17+
loading: () => (
18+
<Box
19+
sx={{
20+
position: 'fixed',
21+
bottom: 56,
22+
left: 0,
23+
right: 0,
24+
zIndex: 1100,
25+
width: '100%',
26+
minHeight: '64px',
27+
}}
28+
>
29+
<DashboardSectionLoadingSkeleton height="64px" />
30+
</Box>
31+
),
32+
})
33+
1434
const TestErrorTrigger = dynamic(() => import('./TestErrorTrigger'), {
1535
ssr: false,
1636
})
@@ -84,7 +104,9 @@ const DashboardClient = ({
84104
}}
85105
>
86106
<Box sx={mainGridStyles}>
87-
<TimerDisplay />
107+
<Box sx={{ height: '100%' }}>
108+
<TimerDisplay />
109+
</Box>
88110
<HrmConnectionPanel />
89111
</Box>
90112
<Box sx={{ width: '100%', mt: 2 }}>
@@ -111,6 +133,8 @@ const DashboardClient = ({
111133
)}
112134
</Box>
113135
</Container>
136+
137+
<SpotifyDisplay />
114138
</Box>
115139
)
116140
}

components/HrmConnectionPanel.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const HrmConnectionPanel = () => {
2727
display: 'flex',
2828
flexWrap: 'wrap',
2929
gap: 2,
30+
height: '100%',
3031
}}
3132
>
3233
{isLoading || tileData.length === 0 ? (
@@ -38,7 +39,7 @@ const HrmConnectionPanel = () => {
3839
justifyContent: 'center',
3940
alignItems: 'center',
4041
width: { xs: '100%', sm: 'calc(50% - 8px)' },
41-
minHeight: 300,
42+
height: '100%', // Ensure the container fills the grid cell
4243
gap: 2,
4344
p: 2,
4445
border: 1,

0 commit comments

Comments
 (0)