File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
src/components/UI/backButton Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 1- // import { useNavigate } from "react-router-dom";
1+ import { useNavigate } from "react-router-dom" ;
22import tabarrow from "../../../assets/icons/tabarrowback.svg" ;
33import mobarrow from "../../../assets/icons/arrowback.svg" ;
44import css from "./BackButton.module.css" ;
55import { useMediaQuery } from "react-responsive" ;
66
77export default function BackButton ( { loc } ) {
88 const isTablet = useMediaQuery ( { minWidth : "768px" } ) ;
9- // const navigate = useNavigate();
9+ const navigate = useNavigate ( ) ;
1010 return (
11- < div className = { css . wrapper } aria-label = { loc } >
11+ < div className = { css . wrapper } aria-label = { loc } onClick = { ( ) => navigate ( - 1 ) } >
1212 < img src = { isTablet ? tabarrow : mobarrow } alt = "Arrow image" />
1313 < p > Назад</ p >
1414 </ div >
1515 ) ;
1616}
17- // onClick={() => navigate(-1)}
You can’t perform that action at this time.
0 commit comments