Skip to content

Commit

Permalink
fix: changed all router.aspath to router.pathname
Browse files Browse the repository at this point in the history
  • Loading branch information
0tuedon authored and Extheoisah committed Nov 17, 2023
1 parent 182dce8 commit f511765
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/hooks/useNoContainerLimit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { UI_CONFIG } from "@/config/ui-config";

const useNoContainerLimit = () => {
const router = useRouter();
const path = router.asPath?.split("/")[1] ?? "";
const path = router.pathname?.split("/")[1] ?? "";
const noRestriction = UI_CONFIG.FULL_WIDTH_ROUTES.includes(path);
const homeRestriction = UI_CONFIG.FULL_NAV_ROUTES.includes(path);
return { noRestriction, homeRestriction };
Expand Down
4 changes: 2 additions & 2 deletions src/layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const Layout = ({ children }: { children: React.ReactNode }) => {
const [isReviewSite, setIsReviewSite] = useState(false);
const { noRestriction } = useNoContainerLimit();
const router = useRouter();
const isHomePage = router.asPath === "/";
const isHomeRouter = router.asPath === "/home";
const isHomePage = router.pathname === "/";
const isHomeRouter = router.pathname === "/home";

useEffect(() => {
setIsReviewSite(window.location.href.includes(config.prod_url));
Expand Down

0 comments on commit f511765

Please sign in to comment.