Mao 4 лет назад
Родитель
Сommit
362616f492

+ 1 - 1
packages/app/src/components/LikeButtons.jsx

@@ -68,7 +68,7 @@ class LikeButtons extends React.Component {
         <button
           type="button"
           id="like-button"
-          onClick={async() => { await this.handleClick() }}
+          onClick={this.handleClick}
           className={`btn btn-like border-0
             ${isLiked ? 'active' : ''} ${isGuestUser ? 'disabled' : ''}`}
         >

+ 5 - 2
packages/app/src/components/PageReactionButtons.tsx

@@ -8,9 +8,12 @@ type Props = {
   currentUserId: string,
 }
 
+const LikeButtonsWrapper = (props) => {
+  return <LikeButtons {...props}></LikeButtons>;
+};
+
 const PageReactionButtons : FC<Props> = (props: Props) => {
   const { pageId, currentUserId } = props;
-  const LikeButtonsTypeAny: any = LikeButtons;
 
 
   const [sumOflikers, setSumOfLikers] = useState(0);
@@ -39,7 +42,7 @@ const PageReactionButtons : FC<Props> = (props: Props) => {
   return (
     <>
       <span>
-        <LikeButtonsTypeAny onChangeInvoked={likeInvoked} pageId={pageId} likers={likers} sumOfLikers={sumOflikers} isLiked={isLiked}></LikeButtonsTypeAny>
+        <LikeButtonsWrapper onChangeInvoked={likeInvoked} pageId={pageId} likers={likers} sumOfLikers={sumOflikers} isLiked={isLiked}></LikeButtonsWrapper>
       </span>
       <span>
         {/*

+ 4 - 1
packages/app/src/components/SearchPage/SearchResultContent.tsx

@@ -4,10 +4,13 @@ import RevisionLoader from '../Page/RevisionLoader';
 import AppContainer from '../../client/services/AppContainer';
 import SearchResultContentSubNavigation from './SearchResultContentSubNavigation';
 
+// TODO : set focusedPage type to ?IPageSearchResultData once #80214 is merged
+// PR: https://github.com/weseek/growi/pull/4649
+
 type Props ={
   appContainer: AppContainer,
   searchingKeyword:string,
-  focusedPage : null | any,
+  focusedPage: null | any,
 }
 const SearchResultContent: FC<Props> = (props: Props) => {
   const page = props.focusedPage;

+ 5 - 2
packages/app/src/components/SearchPage/SearchResultContentSubNavigation.tsx

@@ -12,11 +12,14 @@ type Props = {
   isCompactMode?: boolean,
 }
 
+const SearchResultSubNavButtonWrapper = (props) => {
+  return <SearchResultSubNavButton {...props}></SearchResultSubNavButton>;
+};
+
 const SearchResultContentSubNavigation: FC<Props> = (props : Props) => {
   const {
     appContainer, pageId, path, isCompactMode, isSignleLineMode,
   } = props;
-  const SearchResultSubNavButtonTypeAny: any = SearchResultSubNavButton;
   const { isSharedUser } = appContainer;
   return (
     <div className={`grw-subnav container-fluid d-flex align-items-center justify-content-between ${isCompactMode ? 'grw-subnav-compact d-print-none' : ''}`}>
@@ -36,7 +39,7 @@ const SearchResultContentSubNavigation: FC<Props> = (props : Props) => {
       </div>
       {/* Right side */}
       <div className="d-flex">
-        <SearchResultSubNavButtonTypeAny pageId={pageId} isCompactMode={isCompactMode}></SearchResultSubNavButtonTypeAny>
+        <SearchResultSubNavButtonWrapper pageId={pageId} isCompactMode={isCompactMode}></SearchResultSubNavButtonWrapper>
       </div>
     </div>
   );