feat: checkbox component (#3603)
* feat: custom checkbox component. * improvement: checkbox component implementation in email notification settings. * improvement: add loader in email notification settings page.
This commit is contained in:
parent
b86c6c906a
commit
1927fdd437
4 changed files with 91 additions and 30 deletions
|
|
@ -2,6 +2,8 @@ import { ReactElement } from "react";
|
|||
import useSWR from "swr";
|
||||
// layouts
|
||||
import { ProfilePreferenceSettingsLayout } from "layouts/settings-layout/profile/preferences";
|
||||
// ui
|
||||
import { Loader } from "@plane/ui";
|
||||
// components
|
||||
import { EmailNotificationForm } from "components/profile/preferences";
|
||||
// services
|
||||
|
|
@ -14,10 +16,20 @@ const userService = new UserService();
|
|||
|
||||
const ProfilePreferencesThemePage: NextPageWithLayout = () => {
|
||||
// fetching user email notification settings
|
||||
const { data } = useSWR("CURRENT_USER_EMAIL_NOTIFICATION_SETTINGS", () =>
|
||||
const { data, isLoading } = useSWR("CURRENT_USER_EMAIL_NOTIFICATION_SETTINGS", () =>
|
||||
userService.currentUserEmailNotificationSettings()
|
||||
);
|
||||
|
||||
if (isLoading) {
|
||||
return (
|
||||
<Loader className="space-y-4 mt-8 px-6 lg:px-20">
|
||||
<Loader.Item height="40px" />
|
||||
<Loader.Item height="40px" />
|
||||
<Loader.Item height="40px" />
|
||||
</Loader>
|
||||
);
|
||||
}
|
||||
|
||||
if (!data) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue