mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-16 09:31:50 +02:00
♻️ Switch to app router (#922)
This commit is contained in:
parent
41f85279bb
commit
95feb9f01a
181 changed files with 2507 additions and 2494 deletions
|
@ -11,7 +11,7 @@ import relativeTime from "dayjs/plugin/relativeTime";
|
|||
import timezone from "dayjs/plugin/timezone";
|
||||
import updateLocale from "dayjs/plugin/updateLocale";
|
||||
import utc from "dayjs/plugin/utc";
|
||||
import { useRouter } from "next/router";
|
||||
import { useParams } from "next/navigation";
|
||||
import * as React from "react";
|
||||
import { useAsync } from "react-use";
|
||||
|
||||
|
@ -189,8 +189,8 @@ export const DayjsProvider: React.FunctionComponent<{
|
|||
};
|
||||
};
|
||||
}> = ({ config, children }) => {
|
||||
const router = useRouter();
|
||||
const l = config?.locale ?? router.locale ?? "en";
|
||||
const locale = useParams()?.locale as string;
|
||||
const l = config?.locale ?? locale ?? "en";
|
||||
const state = useAsync(async () => {
|
||||
return await dayjsLocales[l].import();
|
||||
}, [l]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue