Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
2 lines
861 B
Plaintext
2 lines
861 B
Plaintext
import{useRouter as e,usePathname as t}from"next/navigation";import{useMemo as r}from"react";import{useLocale as o}from"use-intl";import n from"../shared/createSharedNavigationFns.js";import a from"../shared/syncLocaleCookie.js";import{getRoute as s}from"../shared/utils.js";import i from"./useBasePathname.js";function c(c){const{Link:u,config:m,getPathname:f,...h}=n(o,c);return{...h,Link:u,usePathname:function(){const e=i(m),t=o();return r((()=>e&&m.pathnames?s(t,e,m.pathnames):e),[t,e])},useRouter:function(){const n=e(),s=o(),i=t();return r((()=>{function e(e){return function(t,r){const{locale:o,...n}=r||{},c=[f({href:t,locale:o||s,forcePrefix:null!=o||void 0})];Object.keys(n).length>0&&c.push(n),a(m.localeCookie,i,s,o),e(...c)}}return{...n,push:e(n.push),replace:e(n.replace),prefetch:e(n.prefetch)}}),[s,i,n])},getPathname:f}}export{c as default};
|