forked from github/plane
f27efb80e1
* dev: create email notification preference model * dev: intiate models * dev: user notification preferences * dev: create notification logs for the user. * dev: email notification stacking and sending logic * feat: email notification preference settings page. * dev: delete subscribers * dev: issue update ui implementation in email notification * chore: integrate email notification endpoint. * chore: remove toggle switch. * chore: added labels part * fix: refactored base design with tables * dev: email notification templates * dev: template updates * dev: update models * dev: update template for labels and new migrations * fix: profile settings preference sidebar. * dev: update preference endpoints * dev: update the schedule to 5 minutes * dev: update template with priority data * dev: update templates * chore: enable `issue subscribe` button for all users. * chore: notification handling for external api * dev: update origin request --------- Co-authored-by: Prateek Shourya <prateekshourya29@gmail.com> Co-authored-by: LAKHAN BAHETI <lakhanbaheti9@gmail.com> Co-authored-by: Ramesh Kumar Chandra <rameshkumar2299@gmail.com> Co-authored-by: NarayanBavisetti <narayan3119@gmail.com>
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import { ReactElement } from "react";
|
|
import useSWR from "swr";
|
|
// layouts
|
|
import { ProfilePreferenceSettingsLayout } from "layouts/settings-layout/profile/preferences";
|
|
// components
|
|
import { EmailNotificationForm } from "components/profile/preferences";
|
|
// services
|
|
import { UserService } from "services/user.service";
|
|
// type
|
|
import { NextPageWithLayout } from "lib/types";
|
|
|
|
// services
|
|
const userService = new UserService();
|
|
|
|
const ProfilePreferencesThemePage: NextPageWithLayout = () => {
|
|
// fetching user email notification settings
|
|
const { data } = useSWR("CURRENT_USER_EMAIL_NOTIFICATION_SETTINGS", () =>
|
|
userService.currentUserEmailNotificationSettings()
|
|
);
|
|
|
|
if (!data) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<div className="mx-auto mt-8 h-full w-full overflow-y-auto px-6 lg:px-20 pb-8">
|
|
<EmailNotificationForm data={data} />
|
|
</div>
|
|
);
|
|
};
|
|
|
|
ProfilePreferencesThemePage.getLayout = function getLayout(page: ReactElement) {
|
|
return <ProfilePreferenceSettingsLayout>{page}</ProfilePreferenceSettingsLayout>;
|
|
};
|
|
|
|
export default ProfilePreferencesThemePage;
|