Skip to content

Commit 1fe495a

Browse files
FreyaXu399sguming
andauthored
Dis 133 mobile adaption blogs page (#193)
* fix:banner style and gap * fix: blog card style * fix: blog list layout * fix: adjust buttom position * fix: subscription section margin * fix: filterBar style problem * fix: next button style * fix: next button style * fix: empty value problem --------- Co-authored-by: Depeng Sun <[email protected]>
1 parent f475278 commit 1fe495a

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

src/app/(public)/blogs/components/BlogFilterBar.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,10 @@ const SearchBox = styled(Box)(() => ({
4444
}));
4545

4646
const StyledSearchIcon = styled(SearchIcon)(({ theme }) => ({
47-
color: '#BDBDBD',
47+
color: 'black',
4848
marginRight: theme.spacing(1),
49+
marginLeft: theme.spacing(1),
4950
display: 'inline-flex',
50-
[theme.breakpoints.down('sm')]: {
51-
display: 'none',
52-
},
5351
}));
5452

5553
const StyledInput = styled(TextField)(() => ({
@@ -115,7 +113,8 @@ export default function BlogFilterBar() {
115113
const params = new URLSearchParams();
116114

117115
if (debouncedKeyword.trim()) params.set('keyword', debouncedKeyword.trim());
118-
if (debouncedTopic) params.set('topic', debouncedTopic);
116+
if (debouncedTopic && debouncedTopic !== 'all')
117+
params.set('topic', debouncedTopic);
119118

120119
router.replace(`/blogs?${params.toString()}`, { scroll: false });
121120
};
@@ -149,9 +148,15 @@ export default function BlogFilterBar() {
149148
}}
150149
disableUnderline
151150
displayEmpty
151+
renderValue={selected => {
152+
if (!selected) {
153+
return <span style={{ color: '#BDBDBD' }}>Please Select</span>;
154+
}
155+
return selected;
156+
}}
152157
sx={{ flex: 1, fontSize: 13 }}
153158
>
154-
<MenuItem value="">All</MenuItem>
159+
<MenuItem value="all">All</MenuItem>
155160
<MenuItem value="Small And Medium Businesses">
156161
Small And Medium Businesses
157162
</MenuItem>

src/app/(public)/blogs/components/BlogList.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
'use client';
2+
import ArrowForwardIcon from '@mui/icons-material/ArrowForward';
23
import { Box, Button, Grid, Snackbar, styled, Typography } from '@mui/material';
34
import axios from 'axios';
45
import type { AppRouterInstance } from 'next/dist/shared/lib/app-router-context.shared-runtime';
56
import { useRouter, useSearchParams } from 'next/navigation';
6-
import { useEffect, useRef, useState } from 'react';
7+
import { useEffect, useState } from 'react';
78

89
import theme from '@/theme';
910
import type { Blog } from '@/types/blog';
@@ -23,6 +24,8 @@ const NextButton = styled(Button)(() => ({
2324
'&:hover': { background: '#222', boxShadow: 'none' },
2425
[theme.breakpoints.down('md')]: {
2526
margin: '20px 10px 50px',
27+
borderRadius: 16,
28+
fontSize: '16px',
2629
},
2730
}));
2831

@@ -174,7 +177,10 @@ export default function BlogList() {
174177
void handleNextPage();
175178
}}
176179
>
177-
Next →
180+
Next
181+
<ArrowForwardIcon
182+
sx={{ width: '20px', height: '18px', marginLeft: '6px' }}
183+
/>
178184
</NextButton>
179185
)}
180186
</Box>

src/app/(public)/blogs/components/SubscriptionSection.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ export const StyledInput = styled(TextField)({
3232
backgroundColor: '#fff',
3333
},
3434
'& .MuiInputBase-input': {
35-
padding: '6px 16px', // 控制输入框内边距
35+
padding: '6px 16px',
3636
},
3737
'& .MuiOutlinedInput-notchedOutline': {
38-
border: '1px solid #d5d5d5', // 默认边框
38+
border: '1px solid #d5d5d5',
3939
},
4040
});
4141

0 commit comments

Comments
 (0)