Migrate all pages from Grid to Box components using flexbox layout

- Migrated search page to use Box with flexbox for responsive layout
- Updated bible reader controls to use Box instead of Grid
- Converted home page hero, features, and stats sections to flexbox
- Removed Grid imports and replaced with Box components across all pages
- Maintained responsive behavior using sx breakpoints and flex properties
This commit is contained in:
andupetcu
2025-09-22 08:57:13 +03:00
parent 5cbb20e96f
commit 82ace8d145
6 changed files with 115 additions and 115 deletions

View File

@@ -596,9 +596,9 @@ export default function BibleReaderNew() {
border: `1px solid ${getThemeStyles().borderColor}` border: `1px solid ${getThemeStyles().borderColor}`
}} }}
> >
<Grid container spacing={2} alignItems="center" justifyContent="center"> <Box sx={{ display: 'flex', gap: 2, flexWrap: 'wrap', alignItems: 'center', justifyContent: 'center' }}>
{/* Books Selection */} {/* Books Selection */>
<Grid item xs={12} sm={4} md={3}> <Box sx={{ flex: { xs: '1 1 100%', sm: '1 1 auto' }, minWidth: { sm: 200, md: 250 } }}>
<FormControl fullWidth size="small"> <FormControl fullWidth size="small">
<InputLabel>{t('book')}</InputLabel> <InputLabel>{t('book')}</InputLabel>
<Select <Select
@@ -617,10 +617,10 @@ export default function BibleReaderNew() {
))} ))}
</Select> </Select>
</FormControl> </FormControl>
</Grid> </Box>
{/* Chapter Selection */} {/* Chapter Selection */}
<Grid item xs={12} sm={3} md={2}> <Box sx={{ flex: { xs: '1 1 100%', sm: '0 1 auto' }, minWidth: { sm: 120, md: 150 } }}>
<FormControl fullWidth size="small"> <FormControl fullWidth size="small">
<InputLabel>{t('chapter')}</InputLabel> <InputLabel>{t('chapter')}</InputLabel>
<Select <Select
@@ -646,10 +646,10 @@ export default function BibleReaderNew() {
))} ))}
</Select> </Select>
</FormControl> </FormControl>
</Grid> </Box>
{/* Font Size Controls */} {/* Font Size Controls */>
<Grid item xs={12} sm={3} md={2}> <Box sx={{ flex: { xs: '1 1 100%', sm: '0 1 auto' }, minWidth: { sm: 150 } }}>
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}> <Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
<IconButton <IconButton
size="small" size="small"
@@ -672,10 +672,10 @@ export default function BibleReaderNew() {
<Typography variant="h6">A</Typography> <Typography variant="h6">A</Typography>
</IconButton> </IconButton>
</Box> </Box>
</Grid> </Box>
{/* Action Buttons */} {/* Action Buttons */>
<Grid item xs={12} sm={2} md={5}> <Box sx={{ flex: { xs: '1 1 100%', sm: '1 1 auto' } }}>
<Box sx={{ display: 'flex', gap: 1, justifyContent: 'center' }}> <Box sx={{ display: 'flex', gap: 1, justifyContent: 'center' }}>
<Tooltip title={t('toggleFullscreen')}> <Tooltip title={t('toggleFullscreen')}>
<IconButton <IconButton
@@ -712,9 +712,9 @@ export default function BibleReaderNew() {
</IconButton> </IconButton>
</Tooltip> </Tooltip>
</Box> </Box>
</Grid> </Box>
</Grid> </Box>
</Paper> </Paper>
) )

View File

@@ -16,7 +16,6 @@ import {
Button, Button,
Chip, Chip,
Divider, Divider,
Grid,
IconButton, IconButton,
Alert, Alert,
CircularProgress, CircularProgress,
@@ -222,8 +221,8 @@ export default function BookmarksPage() {
</Box> </Box>
{/* Stats */} {/* Stats */}
<Grid container spacing={3} sx={{ mb: 4 }}> <Box sx={{ display: 'flex', gap: 3, flexWrap: 'wrap', mb: 4 }}>
<Grid item xs={12} sm={4}> <Box sx={{ flex: { xs: '1 1 100%', sm: '1 1 calc(33.33% - 16px)' } }}>
<Card variant="outlined"> <Card variant="outlined">
<CardContent sx={{ textAlign: 'center' }}> <CardContent sx={{ textAlign: 'center' }}>
<Typography variant="h4" color="primary"> <Typography variant="h4" color="primary">
@@ -234,8 +233,8 @@ export default function BookmarksPage() {
</Typography> </Typography>
</CardContent> </CardContent>
</Card> </Card>
</Grid> </Box>
<Grid item xs={12} sm={4}> <Box sx={{ flex: { xs: '1 1 100%', sm: '1 1 calc(33.33% - 16px)' } }}>
<Card variant="outlined"> <Card variant="outlined">
<CardContent sx={{ textAlign: 'center' }}> <CardContent sx={{ textAlign: 'center' }}>
<Typography variant="h4" color="success.main"> <Typography variant="h4" color="success.main">
@@ -246,8 +245,8 @@ export default function BookmarksPage() {
</Typography> </Typography>
</CardContent> </CardContent>
</Card> </Card>
</Grid> </Box>
<Grid item xs={12} sm={4}> <Box sx={{ flex: { xs: '1 1 100%', sm: '1 1 calc(33.33% - 16px)' } }}>
<Card variant="outlined"> <Card variant="outlined">
<CardContent sx={{ textAlign: 'center' }}> <CardContent sx={{ textAlign: 'center' }}>
<Typography variant="h4" color="warning.main"> <Typography variant="h4" color="warning.main">
@@ -258,8 +257,8 @@ export default function BookmarksPage() {
</Typography> </Typography>
</CardContent> </CardContent>
</Card> </Card>
</Grid> </Box>
</Grid> </Box>
<Divider sx={{ mb: 3 }} /> <Divider sx={{ mb: 3 }} />
@@ -309,9 +308,9 @@ export default function BookmarksPage() {
</Button> </Button>
</Box> </Box>
) : ( ) : (
<Grid container spacing={3}> <Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}>
{filteredBookmarks().map((bookmark) => ( {filteredBookmarks().map((bookmark) => (
<Grid item xs={12} key={bookmark.id}> <Box key={bookmark.id}>
<Card variant="outlined" sx={{ transition: 'all 0.2s', '&:hover': { elevation: 2 } }}> <Card variant="outlined" sx={{ transition: 'all 0.2s', '&:hover': { elevation: 2 } }}>
<CardContent> <CardContent>
<Box display="flex" justifyContent="space-between" alignItems="flex-start"> <Box display="flex" justifyContent="space-between" alignItems="flex-start">
@@ -391,9 +390,9 @@ export default function BookmarksPage() {
</Box> </Box>
</CardContent> </CardContent>
</Card> </Card>
</Grid> </Box>
))} ))}
</Grid> </Box>
)} )}
</Paper> </Paper>
</Container> </Container>

View File

@@ -1,7 +1,6 @@
'use client' 'use client'
import { import {
Container, Container,
Grid,
Card, Card,
CardContent, CardContent,
Typography, Typography,
@@ -70,8 +69,8 @@ export default function Home() {
}} }}
> >
<Container maxWidth="lg"> <Container maxWidth="lg">
<Grid container spacing={4} alignItems="center"> <Box sx={{ display: 'flex', gap: 4, flexWrap: 'wrap', alignItems: 'center' }}>
<Grid item xs={12} md={8}> <Box sx={{ flex: { xs: '1 1 100%', md: '1 1 60%' } }}>
<Typography variant="h2" component="h1" gutterBottom> <Typography variant="h2" component="h1" gutterBottom>
{t('hero.title')} {t('hero.title')}
</Typography> </Typography>
@@ -113,13 +112,13 @@ export default function Home() {
{t('hero.cta.askAI')} {t('hero.cta.askAI')}
</Button> </Button>
</Box> </Box>
</Grid> </Box>
<Grid item xs={12} md={4}> <Box sx={{ flex: { xs: '1 1 100%', md: '1 1 40%' } }}>
<Box sx={{ textAlign: 'center' }}> <Box sx={{ textAlign: 'center' }}>
<MenuBook sx={{ fontSize: 120, opacity: 0.8 }} /> <MenuBook sx={{ fontSize: 120, opacity: 0.8 }} />
</Box> </Box>
</Grid> </Box>
</Grid> </Box>
</Container> </Container>
</Box> </Box>
@@ -137,9 +136,9 @@ export default function Home() {
{t('features.subtitle')} {t('features.subtitle')}
</Typography> </Typography>
<Grid container spacing={4} justifyContent="center"> <Box sx={{ display: 'flex', gap: 4, flexWrap: 'wrap', justifyContent: 'center' }}>
{features.map((feature, index) => ( {features.map((feature, index) => (
<Grid item xs={12} md={6} key={index} sx={{ display: 'flex', justifyContent: 'center' }}> <Box key={index} sx={{ flex: { xs: '1 1 100%', md: '1 1 calc(50% - 16px)' }, display: 'flex', justifyContent: 'center' }}>
<Card <Card
sx={{ sx={{
height: '100%', height: '100%',
@@ -195,34 +194,34 @@ export default function Home() {
</Box> </Box>
</CardContent> </CardContent>
</Card> </Card>
</Grid> </Box>
))} ))}
</Grid> </Box>
</Container> </Container>
{/* Stats Section */} {/* Stats Section */}
<Paper sx={{ bgcolor: 'background.paper', py: 6, mb: 8 }}> <Paper sx={{ bgcolor: 'background.paper', py: 6, mb: 8 }}>
<Container maxWidth="lg"> <Container maxWidth="lg">
<Grid container spacing={4} textAlign="center" justifyContent="center"> <Box sx={{ display: 'flex', gap: 4, flexWrap: 'wrap', textAlign: 'center', justifyContent: 'center' }}>
<Grid item xs={12} sm={4}> <Box sx={{ flex: { xs: '1 1 100%', sm: '1 1 calc(33.33% - 24px)' } }}>
<Typography variant="h3" color="primary.main" gutterBottom> <Typography variant="h3" color="primary.main" gutterBottom>
66 66
</Typography> </Typography>
<Typography variant="h6">{t('stats.books')}</Typography> <Typography variant="h6">{t('stats.books')}</Typography>
</Grid> </Box>
<Grid item xs={12} sm={4}> <Box sx={{ flex: { xs: '1 1 100%', sm: '1 1 calc(33.33% - 24px)' } }}>
<Typography variant="h3" color="secondary.main" gutterBottom> <Typography variant="h3" color="secondary.main" gutterBottom>
31,000+ 31,000+
</Typography> </Typography>
<Typography variant="h6">{t('stats.verses')}</Typography> <Typography variant="h6">{t('stats.verses')}</Typography>
</Grid> </Box>
<Grid item xs={12} sm={4}> <Box sx={{ flex: { xs: '1 1 100%', sm: '1 1 calc(33.33% - 24px)' } }}>
<Typography variant="h3" color="success.main" gutterBottom> <Typography variant="h3" color="success.main" gutterBottom>
24/7 24/7
</Typography> </Typography>
<Typography variant="h6">{t('stats.aiAvailable')}</Typography> <Typography variant="h6">{t('stats.aiAvailable')}</Typography>
</Grid> </Box>
</Grid> </Box>
</Container> </Container>
</Paper> </Paper>

View File

@@ -12,7 +12,6 @@ import {
TextField, TextField,
Button, Button,
Avatar, Avatar,
Grid,
Card, Card,
CardContent, CardContent,
Divider, Divider,
@@ -117,9 +116,9 @@ export default function ProfilePage() {
<Divider sx={{ mb: 4 }} /> <Divider sx={{ mb: 4 }} />
{/* Profile Information */} {/* Profile Information */}
<Grid container spacing={3}> <Box sx={{ display: 'flex', gap: 3, flexWrap: 'wrap' }}>
{/* Personal Information Card */} {/* Personal Information Card */}
<Grid item xs={12} md={8}> <Box sx={{ flex: { xs: '1 1 100%', md: '1 1 calc(66.67% - 12px)' } }}>
<Card variant="outlined"> <Card variant="outlined">
<CardContent> <CardContent>
<Box display="flex" justifyContent="space-between" alignItems="center" mb={3}> <Box display="flex" justifyContent="space-between" alignItems="center" mb={3}>
@@ -189,10 +188,10 @@ export default function ProfilePage() {
)} )}
</CardContent> </CardContent>
</Card> </Card>
</Grid> </Box>
{/* Account Details Card */} {/* Account Details Card */}
<Grid item xs={12} md={4}> <Box sx={{ flex: { xs: '1 1 100%', md: '1 1 calc(33.33% - 12px)' } }}>
<Card variant="outlined"> <Card variant="outlined">
<CardContent> <CardContent>
<Typography variant="h6" component="h2" gutterBottom> <Typography variant="h6" component="h2" gutterBottom>
@@ -221,8 +220,8 @@ export default function ProfilePage() {
</Box> </Box>
</CardContent> </CardContent>
</Card> </Card>
</Grid> </Box>
</Grid> </Box>
{/* Success/Error Message */} {/* Success/Error Message */}
{message && ( {message && (

View File

@@ -13,7 +13,6 @@ import {
Paper, Paper,
Card, Card,
CardContent, CardContent,
Grid,
Chip, Chip,
List, List,
ListItem, ListItem,
@@ -654,8 +653,10 @@ export default function SearchPage() {
{/* Advanced Filters */} {/* Advanced Filters */}
<Collapse in={filtersOpen}> <Collapse in={filtersOpen}>
<Paper elevation={2} sx={{ p: 3, mb: 4, borderRadius: 2 }}> <Paper elevation={2} sx={{ p: 3, mb: 4, borderRadius: 2 }}>
<Grid container spacing={3}> <Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}>
<Grid item xs={12} sm={6} md={3}> {/* First row of filters */}
<Box sx={{ display: 'flex', gap: 3, flexWrap: 'wrap' }}>
<Box sx={{ flex: { xs: '1 1 100%', sm: '1 1 45%', md: '1 1 auto' }, minWidth: { md: 200 } }}>
<FormControl fullWidth size="small"> <FormControl fullWidth size="small">
<InputLabel>{t('filters.version')}</InputLabel> <InputLabel>{t('filters.version')}</InputLabel>
<Select <Select
@@ -670,9 +671,9 @@ export default function SearchPage() {
))} ))}
</Select> </Select>
</FormControl> </FormControl>
</Grid> </Box>
<Grid item xs={12} sm={6} md={3}> <Box sx={{ flex: { xs: '1 1 100%', sm: '1 1 45%', md: '1 1 auto' }, minWidth: { md: 200 } }}>
<FormControl fullWidth size="small"> <FormControl fullWidth size="small">
<InputLabel>Sort by</InputLabel> <InputLabel>Sort by</InputLabel>
<Select <Select
@@ -685,9 +686,9 @@ export default function SearchPage() {
<MenuItem value="reference">Reference</MenuItem> <MenuItem value="reference">Reference</MenuItem>
</Select> </Select>
</FormControl> </FormControl>
</Grid> </Box>
<Grid item xs={12} sm={6} md={3}> <Box sx={{ flex: { xs: '1 1 100%', sm: '1 1 45%', md: '1 1 auto' }, display: 'flex', alignItems: 'center' }}>
<FormControlLabel <FormControlLabel
control={ control={
<Checkbox <Checkbox
@@ -697,9 +698,11 @@ export default function SearchPage() {
} }
label="Show context" label="Show context"
/> />
</Grid> </Box>
</Box>
<Grid item xs={12}> {/* Popular searches */}
<Box>
<Typography variant="subtitle2" gutterBottom> <Typography variant="subtitle2" gutterBottom>
{t('popular.title')} {t('popular.title')}
</Typography> </Typography>
@@ -718,9 +721,10 @@ export default function SearchPage() {
/> />
))} ))}
</Box> </Box>
</Grid> </Box>
<Grid item xs={12}> {/* Book selection */}
<Box>
<Typography variant="subtitle2" gutterBottom> <Typography variant="subtitle2" gutterBottom>
{t('filters.specificBooks')} {t('filters.specificBooks')}
</Typography> </Typography>
@@ -742,14 +746,14 @@ export default function SearchPage() {
/> />
))} ))}
</Box> </Box>
</Grid> </Box>
</Grid> </Box>
</Paper> </Paper>
</Collapse> </Collapse>
<Grid container spacing={4}> <Box sx={{ display: 'flex', gap: 4, flexDirection: { xs: 'column', md: 'row' } }}>
{/* Sidebar */} {/* Sidebar */}
<Grid item xs={12} md={3}> <Box sx={{ width: { xs: '100%', md: '25%' }, flexShrink: 0 }}>
{/* Search History */} {/* Search History */}
{searchHistory.length > 0 && ( {searchHistory.length > 0 && (
<Card sx={{ mb: 3 }}> <Card sx={{ mb: 3 }}>
@@ -776,10 +780,10 @@ export default function SearchPage() {
</Card> </Card>
)} )}
</Grid> </Box>
{/* Main Results */} {/* Main Results */}
<Grid item xs={12} md={9}> <Box sx={{ flex: 1, width: { xs: '100%', md: '75%' } }}>
<Box ref={resultsRef}> <Box ref={resultsRef}>
{/* Results Header */} {/* Results Header */}
{(results.length > 0 || loading) && ( {(results.length > 0 || loading) && (
@@ -959,8 +963,8 @@ export default function SearchPage() {
</Paper> </Paper>
)} )}
</Box> </Box>
</Grid> </Box>
</Grid> </Box>
{/* Scroll to Top */} {/* Scroll to Top */}
{results.length > 5 && ( {results.length > 5 && (

View File

@@ -15,7 +15,6 @@ import {
MenuItem, MenuItem,
FormControl, FormControl,
InputLabel, InputLabel,
Grid,
Card, Card,
CardContent, CardContent,
Divider, Divider,
@@ -79,9 +78,9 @@ export default function SettingsPage() {
<Divider sx={{ mb: 4 }} /> <Divider sx={{ mb: 4 }} />
<Grid container spacing={3}> <Box sx={{ display: 'flex', gap: 3, flexWrap: 'wrap' }}>
{/* Appearance Settings */} {/* Appearance Settings */}
<Grid item xs={12} md={6}> <Box sx={{ flex: { xs: '1 1 100%', md: '1 1 calc(50% - 12px)' } }}>
<Card variant="outlined"> <Card variant="outlined">
<CardContent> <CardContent>
<Box display="flex" alignItems="center" mb={3}> <Box display="flex" alignItems="center" mb={3}>
@@ -123,10 +122,10 @@ export default function SettingsPage() {
</Box> </Box>
</CardContent> </CardContent>
</Card> </Card>
</Grid> </Box>
{/* Language & Notifications */} {/* Language & Notifications */}
<Grid item xs={12} md={6}> <Box sx={{ flex: { xs: '1 1 100%', md: '1 1 calc(50% - 12px)' } }}>
<Card variant="outlined"> <Card variant="outlined">
<CardContent> <CardContent>
<Box display="flex" alignItems="center" mb={3}> <Box display="flex" alignItems="center" mb={3}>
@@ -175,10 +174,10 @@ export default function SettingsPage() {
</Box> </Box>
</CardContent> </CardContent>
</Card> </Card>
</Grid> </Box>
{/* Security Settings */} {/* Security Settings */}
<Grid item xs={12}> <Box sx={{ flex: '1 1 100%' }}>
<Card variant="outlined"> <Card variant="outlined">
<CardContent> <CardContent>
<Box display="flex" alignItems="center" mb={3}> <Box display="flex" alignItems="center" mb={3}>
@@ -197,8 +196,8 @@ export default function SettingsPage() {
</Button> </Button>
</CardContent> </CardContent>
</Card> </Card>
</Grid> </Box>
</Grid> </Box>
{/* Save Button */} {/* Save Button */}
<Box textAlign="center" mt={4}> <Box textAlign="center" mt={4}>