plane/web/pages/profile/preferences/email.tsx
Ramesh Kumar Chandra 709d3a115b
[WEB-711] style: profile and its settings pages responsiveness (#4022)
* [WEB-711] style: profile and its settings pages responsiveness

* chore: linting issues fix

* fix: mobile-view padding

---------

Co-authored-by: LAKHAN BAHETI <lakhanbaheti9@gmail.com>
2024-04-29 12:59:49 +05:30

43 lines
1.3 KiB
TypeScript

import { ReactElement } from "react";
import useSWR from "swr";
// layouts
import { PageHead } from "@/components/core";
import { EmailNotificationForm } from "@/components/profile/preferences";
import { EmailSettingsLoader } from "@/components/ui";
import { ProfilePreferenceSettingsLayout } from "@/layouts/settings-layout/profile/preferences";
// ui
// components
// services
import { NextPageWithLayout } from "@/lib/types";
import { UserService } from "@/services/user.service";
// type
// services
const userService = new UserService();
const ProfilePreferencesThemePage: NextPageWithLayout = () => {
// fetching user email notification settings
const { data, isLoading } = useSWR("CURRENT_USER_EMAIL_NOTIFICATION_SETTINGS", () =>
userService.currentUserEmailNotificationSettings()
);
if (!data || isLoading) {
return <EmailSettingsLoader />;
}
return (
<>
<PageHead title="Profile - Email Preference" />
<div className="mx-auto mt-8 h-full w-full md:px-6 px-4 lg:px-20 pb-8 vertical-scrollbar scrollbar-md">
<EmailNotificationForm data={data} />
</div>
</>
);
};
ProfilePreferencesThemePage.getLayout = function getLayout(page: ReactElement) {
return <ProfilePreferenceSettingsLayout>{page}</ProfilePreferenceSettingsLayout>;
};
export default ProfilePreferencesThemePage;