Ver Fonte

create subscribeRules state

Shun Miyazawa há 4 anos atrás
pai
commit
e5defe13d1

+ 7 - 1
packages/app/src/components/Me/InAppNotificationSettings.tsx

@@ -1,4 +1,4 @@
-import React, { FC } from 'react';
+import React, { FC, useState } from 'react';
 import { useTranslation } from 'react-i18next';
 import { useTranslation } from 'react-i18next';
 
 
 import AppContainer from '~/client/services/AppContainer';
 import AppContainer from '~/client/services/AppContainer';
@@ -9,6 +9,11 @@ type Props = {
   appContainer: AppContainer,
   appContainer: AppContainer,
 };
 };
 
 
+type SubscribeRule = {
+  name: string,
+  isEnabled: boolean,
+}
+
 const defaultSubscribeRules = [
 const defaultSubscribeRules = [
   {
   {
     name: 'PAGE_CREATE',
     name: 'PAGE_CREATE',
@@ -20,6 +25,7 @@ const defaultSubscribeRules = [
 const InAppNotificationSettings: FC<Props> = (props: Props) => {
 const InAppNotificationSettings: FC<Props> = (props: Props) => {
   const { appContainer } = props;
   const { appContainer } = props;
   const { t } = useTranslation();
   const { t } = useTranslation();
+  const [subscribeRules, setSubscribeRules] = useState<SubscribeRule[]>([]);
 
 
   const isCheckedRule = () => {
   const isCheckedRule = () => {
     return;
     return;