diff --git a/apps/web/app/future/settings/(settings)/my-account/appearance/page.tsx b/apps/web/app/settings/(settings-layout)/my-account/appearance/page.tsx similarity index 100% rename from apps/web/app/future/settings/(settings)/my-account/appearance/page.tsx rename to apps/web/app/settings/(settings-layout)/my-account/appearance/page.tsx diff --git a/apps/web/app/future/settings/(settings)/my-account/calendars/page.tsx b/apps/web/app/settings/(settings-layout)/my-account/calendars/page.tsx similarity index 100% rename from apps/web/app/future/settings/(settings)/my-account/calendars/page.tsx rename to apps/web/app/settings/(settings-layout)/my-account/calendars/page.tsx diff --git a/apps/web/app/future/settings/(settings)/my-account/conferencing/page.tsx b/apps/web/app/settings/(settings-layout)/my-account/conferencing/page.tsx similarity index 100% rename from apps/web/app/future/settings/(settings)/my-account/conferencing/page.tsx rename to apps/web/app/settings/(settings-layout)/my-account/conferencing/page.tsx diff --git a/apps/web/app/future/settings/(settings)/my-account/general/page.tsx b/apps/web/app/settings/(settings-layout)/my-account/general/page.tsx similarity index 78% rename from apps/web/app/future/settings/(settings)/my-account/general/page.tsx rename to apps/web/app/settings/(settings-layout)/my-account/general/page.tsx index c6ef48a09bc118..a53fd802ef1637 100644 --- a/apps/web/app/future/settings/(settings)/my-account/general/page.tsx +++ b/apps/web/app/settings/(settings-layout)/my-account/general/page.tsx @@ -1,5 +1,6 @@ import { _generateMetadata } from "app/_utils"; import { getFixedT } from "app/_utils"; +import { revalidatePath } from "next/cache"; import { getServerSessionForAppDir } from "@calcom/feature-auth/lib/get-server-session-for-app-dir"; import SettingsHeader from "@calcom/features/settings/appDir/SettingsHeader"; @@ -16,9 +17,14 @@ const Page = async () => { const session = await getServerSessionForAppDir(); const t = await getFixedT(session?.user.locale || "en"); + const revalidatePage = async () => { + "use server"; + revalidatePath("settings/my-account/general"); + }; + return ( - + ); }; diff --git a/apps/web/app/future/settings/(settings)/my-account/out-of-office/page.tsx b/apps/web/app/settings/(settings-layout)/my-account/out-of-office/page.tsx similarity index 100% rename from apps/web/app/future/settings/(settings)/my-account/out-of-office/page.tsx rename to apps/web/app/settings/(settings-layout)/my-account/out-of-office/page.tsx diff --git a/apps/web/app/future/settings/(settings)/my-account/profile/page.tsx b/apps/web/app/settings/(settings-layout)/my-account/profile/page.tsx similarity index 100% rename from apps/web/app/future/settings/(settings)/my-account/profile/page.tsx rename to apps/web/app/settings/(settings-layout)/my-account/profile/page.tsx diff --git a/apps/web/modules/settings/my-account/general-view.tsx b/apps/web/modules/settings/my-account/general-view.tsx index da82bbecc858e3..2902ee8a5fcd94 100644 --- a/apps/web/modules/settings/my-account/general-view.tsx +++ b/apps/web/modules/settings/my-account/general-view.tsx @@ -68,9 +68,14 @@ interface GeneralViewProps { localeProp: string; user: RouterOutputs["viewer"]["me"]; travelSchedules: RouterOutputs["viewer"]["getTravelSchedules"]; + revalidatePage: GeneralQueryViewProps["revalidatePage"]; } -const GeneralQueryView = () => { +type GeneralQueryViewProps = { + revalidatePage: () => Promise; +}; + +const GeneralQueryView = ({ revalidatePage }: GeneralQueryViewProps) => { const { t } = useLocale(); const { data: user, isPending } = trpc.viewer.me.useQuery(); @@ -82,10 +87,17 @@ const GeneralQueryView = () => { if (!user) { throw new Error(t("something_went_wrong")); } - return ; + return ( + + ); }; -const GeneralView = ({ localeProp, user, travelSchedules }: GeneralViewProps) => { +const GeneralView = ({ localeProp, user, travelSchedules, revalidatePage }: GeneralViewProps) => { const utils = trpc.useContext(); const { t, @@ -105,6 +117,7 @@ const GeneralView = ({ localeProp, user, travelSchedules }: GeneralViewProps) => if (res.locale) { window.calNewLocale = res.locale; } + await revalidatePage(); }, onError: () => { showToast(t("error_updating_settings"), "error"); @@ -177,7 +190,7 @@ const GeneralView = ({ localeProp, user, travelSchedules }: GeneralViewProps) =>
{ + handleSubmit={async (values) => { setIsUpdateBtnLoading(true); mutation.mutate({ ...values, diff --git a/apps/web/next.config.js b/apps/web/next.config.js index 30355a8d3b77b1..6ddbb5b32f0eff 100644 --- a/apps/web/next.config.js +++ b/apps/web/next.config.js @@ -178,6 +178,7 @@ const nextConfig = { serverComponentsExternalPackages: ["next-i18next"], optimizePackageImports: ["@calcom/ui"], instrumentationHook: true, + serverActions: true, }, i18n: { ...i18n, diff --git a/apps/web/pages/settings/my-account/appearance.tsx b/apps/web/pages/settings/my-account/appearance.tsx deleted file mode 100644 index 9fbe4f4adffde1..00000000000000 --- a/apps/web/pages/settings/my-account/appearance.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; -import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { Meta } from "@calcom/ui"; - -import PageWrapper from "@components/PageWrapper"; - -import AppearancePage from "~/settings/my-account/appearance-view"; - -const Page = () => { - const { t } = useLocale(); - - return ( - <> - - - - ); -}; - -Page.getLayout = getLayout; -Page.PageWrapper = PageWrapper; - -export default Page; diff --git a/apps/web/pages/settings/my-account/calendars.tsx b/apps/web/pages/settings/my-account/calendars.tsx deleted file mode 100644 index 2dfa7cb2959d39..00000000000000 --- a/apps/web/pages/settings/my-account/calendars.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; -import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { Meta } from "@calcom/ui"; - -import PageWrapper from "@components/PageWrapper"; -import { CalendarListContainer } from "@components/apps/CalendarListContainer"; - -import AddCalendarButton from "~/settings/my-account/components/AddCalendarButton"; - -const Page = () => { - const { t } = useLocale(); - - return ( - <> - } - borderInShellHeader={false} - /> -
- -
- - ); -}; - -Page.getLayout = getLayout; -Page.PageWrapper = PageWrapper; - -export default Page; diff --git a/apps/web/pages/settings/my-account/conferencing.tsx b/apps/web/pages/settings/my-account/conferencing.tsx deleted file mode 100644 index d4f749cff66fd5..00000000000000 --- a/apps/web/pages/settings/my-account/conferencing.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; -import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { Button, Meta } from "@calcom/ui"; - -import PageWrapper from "@components/PageWrapper"; - -import ConferencingView from "~/settings/my-account/conferencing-view"; - -const Page = () => { - const { t } = useLocale(); - - const AddConferencingButton = () => { - return ( - - ); - }; - - return ( - <> - } - borderInShellHeader={true} - /> - - - ); -}; - -Page.getLayout = getLayout; -Page.PageWrapper = PageWrapper; - -export default Page; diff --git a/apps/web/pages/settings/my-account/general.tsx b/apps/web/pages/settings/my-account/general.tsx deleted file mode 100644 index 37eb99532c5e46..00000000000000 --- a/apps/web/pages/settings/my-account/general.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; -import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { Meta } from "@calcom/ui"; - -import PageWrapper from "@components/PageWrapper"; - -import GeneralQueryView from "~/settings/my-account/general-view"; - -const Page = () => { - const { t } = useLocale(); - - return ( - <> - - - - ); -}; - -Page.getLayout = getLayout; -Page.PageWrapper = PageWrapper; - -export default Page; diff --git a/apps/web/pages/settings/my-account/out-of-office/index.tsx b/apps/web/pages/settings/my-account/out-of-office/index.tsx deleted file mode 100644 index 89dbb3fdb69c1c..00000000000000 --- a/apps/web/pages/settings/my-account/out-of-office/index.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; -import CreateNewOutOfOfficeEntryButton from "@calcom/features/settings/outOfOffice/CreateNewOutOfOfficeEntryButton"; -import { OutOfOfficeEntriesList } from "@calcom/features/settings/outOfOffice/OutOfOfficeEntriesList"; -import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { trpc } from "@calcom/trpc/react"; -import { Meta, SkeletonText } from "@calcom/ui"; - -import PageWrapper from "@components/PageWrapper"; - -const Page = () => { - const { t } = useLocale(); - - const { isPending } = trpc.viewer.outOfOfficeReasonList.useQuery(); - - return ( - <> - : } - /> - - - ); -}; - -Page.getLayout = getLayout; -Page.PageWrapper = PageWrapper; - -export default Page; diff --git a/apps/web/pages/settings/my-account/profile.tsx b/apps/web/pages/settings/my-account/profile.tsx deleted file mode 100644 index 9539cec4b4b72e..00000000000000 --- a/apps/web/pages/settings/my-account/profile.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; -import { APP_NAME } from "@calcom/lib/constants"; -import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { Meta } from "@calcom/ui"; - -import PageWrapper from "@components/PageWrapper"; - -import ProfileView from "~/settings/my-account/profile-view"; - -const Page = () => { - const { t } = useLocale(); - return ( - <> - - - - ); -}; - -Page.getLayout = getLayout; -Page.PageWrapper = PageWrapper; - -export default Page;