mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-11-16 21:08:33 +05:30
fix: tools by category page title
This commit is contained in:
parent
706212a445
commit
9a4e589bb5
1 changed files with 8 additions and 5 deletions
|
|
@ -13,6 +13,7 @@ import { ArrowBack } from '@mui/icons-material';
|
||||||
import BackButton from '@components/BackButton';
|
import BackButton from '@components/BackButton';
|
||||||
import ArrowBackIcon from '@mui/icons-material/ArrowBack';
|
import ArrowBackIcon from '@mui/icons-material/ArrowBack';
|
||||||
import SearchIcon from '@mui/icons-material/Search';
|
import SearchIcon from '@mui/icons-material/Search';
|
||||||
|
import { Helmet } from 'react-helmet';
|
||||||
|
|
||||||
export default function ToolsByCategory() {
|
export default function ToolsByCategory() {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
@ -20,6 +21,9 @@ export default function ToolsByCategory() {
|
||||||
const mainContentRef = React.useRef<HTMLDivElement>(null);
|
const mainContentRef = React.useRef<HTMLDivElement>(null);
|
||||||
const { categoryName } = useParams();
|
const { categoryName } = useParams();
|
||||||
const [searchTerm, setSearchTerm] = React.useState<string>('');
|
const [searchTerm, setSearchTerm] = React.useState<string>('');
|
||||||
|
const rawTitle = getToolsByCategory().find(
|
||||||
|
(category) => category.type === categoryName
|
||||||
|
)!.rawTitle;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (mainContentRef.current) {
|
if (mainContentRef.current) {
|
||||||
|
|
@ -29,6 +33,9 @@ export default function ToolsByCategory() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box sx={{ backgroundColor: 'background.default' }}>
|
<Box sx={{ backgroundColor: 'background.default' }}>
|
||||||
|
<Helmet>
|
||||||
|
<title>{`${rawTitle} Tools`}</title>
|
||||||
|
</Helmet>
|
||||||
<Box
|
<Box
|
||||||
padding={{ xs: 1, md: 3, lg: 5 }}
|
padding={{ xs: 1, md: 3, lg: 5 }}
|
||||||
display={'flex'}
|
display={'flex'}
|
||||||
|
|
@ -49,11 +56,7 @@ export default function ToolsByCategory() {
|
||||||
<Typography
|
<Typography
|
||||||
fontSize={22}
|
fontSize={22}
|
||||||
color={theme.palette.primary.main}
|
color={theme.palette.primary.main}
|
||||||
>{`All ${
|
>{`All ${rawTitle} Tools`}</Typography>
|
||||||
getToolsByCategory().find(
|
|
||||||
(category) => category.type === categoryName
|
|
||||||
)!.rawTitle
|
|
||||||
} Tools`}</Typography>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
<TextField
|
<TextField
|
||||||
placeholder={'Search'}
|
placeholder={'Search'}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue