Bladeren bron

fix tsc errors

Yuki Takei 3 jaren geleden
bovenliggende
commit
3a68cf27de

+ 2 - 2
packages/app/src/components/Navbar/GlobalSearch.tsx

@@ -18,11 +18,11 @@ import SearchForm from '../SearchForm';
 import styles from './GlobalSearch.module.scss';
 import styles from './GlobalSearch.module.scss';
 
 
 
 
-type Props = {
+export type GlobalSearchProps = {
   dropup?: boolean,
   dropup?: boolean,
 }
 }
 
 
-export const GlobalSearch = (props: Props): JSX.Element => {
+export const GlobalSearch = (props: GlobalSearchProps): JSX.Element => {
   const { t } = useTranslation();
   const { t } = useTranslation();
 
 
   const { dropup } = props;
   const { dropup } = props;

+ 2 - 1
packages/app/src/components/Navbar/GrowiNavbar.tsx

@@ -21,6 +21,7 @@ import GrowiLogo from '../Icons/GrowiLogo';
 import PersonalDropdown from './PersonalDropdown';
 import PersonalDropdown from './PersonalDropdown';
 
 
 import styles from './GrowiNavbar.module.scss';
 import styles from './GrowiNavbar.module.scss';
+import { GlobalSearchProps } from './GlobalSearch';
 
 
 
 
 const ShowSkeltonInSSR = memo(({ children }: HasChildren): JSX.Element => {
 const ShowSkeltonInSSR = memo(({ children }: HasChildren): JSX.Element => {
@@ -130,7 +131,7 @@ Confidential.displayName = 'Confidential';
 
 
 export const GrowiNavbar = (): JSX.Element => {
 export const GrowiNavbar = (): JSX.Element => {
 
 
-  const GlobalSearch = dynamic(() => import('./GlobalSearch').then(mod => mod.GlobalSearch), { ssr: false });
+  const GlobalSearch = dynamic<GlobalSearchProps>(() => import('./GlobalSearch').then(mod => mod.GlobalSearch), { ssr: false });
 
 
   const { data: appTitle } = useAppTitle();
   const { data: appTitle } = useAppTitle();
   const { data: confidential } = useConfidential();
   const { data: confidential } = useConfidential();

+ 1 - 1
packages/app/src/interfaces/page-grant.ts

@@ -5,7 +5,7 @@ export type IDataApplicableGroup = {
 }
 }
 
 
 export type IDataApplicableGrant = null | IDataApplicableGroup;
 export type IDataApplicableGrant = null | IDataApplicableGroup;
-export type IRecordApplicableGrant = Record<PageGrant, IDataApplicableGrant>
+export type IRecordApplicableGrant = Partial<Record<PageGrant, IDataApplicableGrant>>
 export type IResApplicableGrant = {
 export type IResApplicableGrant = {
   data?: IRecordApplicableGrant
   data?: IRecordApplicableGrant
 }
 }

+ 1 - 2
packages/app/src/pages/[[...path]].page.tsx

@@ -166,10 +166,9 @@ const GrowiPage: NextPage<Props> = (props: Props) => {
   // useIsTrashPage(_isTrashPage(props.currentPagePath));
   // useIsTrashPage(_isTrashPage(props.currentPagePath));
   // useShared();
   // useShared();
   // useShareLinkId(props.shareLinkId);
   // useShareLinkId(props.shareLinkId);
-  useIsSharedUser(props.currentUser == null); // '/shared' is not routed this page
+  useIsSharedUser(false); // this page cann't be routed for '/share'
   useIsIdenticalPath(false); // TODO: need to initialize from props
   useIsIdenticalPath(false); // TODO: need to initialize from props
   // useIsAbleToDeleteCompletely(props.isAbleToDeleteCompletely);
   // useIsAbleToDeleteCompletely(props.isAbleToDeleteCompletely);
-  useIsSharedUser(false); // this page cann't be routed for '/share'
   useIsEnabledStaleNotification(props.isEnabledStaleNotification);
   useIsEnabledStaleNotification(props.isEnabledStaleNotification);
   useIsBlinkedHeaderAtBoot(false);
   useIsBlinkedHeaderAtBoot(false);
 
 

+ 2 - 2
packages/app/src/stores/context.tsx

@@ -106,8 +106,8 @@ export const useTemplateTagData = (initialData?: Nullable<string>): SWRResponse<
   return useStaticSWR<Nullable<string>, Error>('templateTagData', initialData);
   return useStaticSWR<Nullable<string>, Error>('templateTagData', initialData);
 };
 };
 
 
-export const useIsSharedUser = (initialData?: Nullable<boolean>): SWRResponse<Nullable<boolean>, Error> => {
-  return useStaticSWR<Nullable<boolean>, Error>('isSharedUser', initialData);
+export const useIsSharedUser = (initialData?: boolean): SWRResponse<boolean, Error> => {
+  return useStaticSWR<boolean, Error>('isSharedUser', initialData);
 };
 };
 
 
 export const useShareLinksNumber = (initialData?: Nullable<any>): SWRResponse<Nullable<any>, Error> => {
 export const useShareLinksNumber = (initialData?: Nullable<any>): SWRResponse<Nullable<any>, Error> => {