소스 검색

81110 remove unnecessary vars

Yohei-Shiina 4 년 전
부모
커밋
58d8c47dd5
2개의 변경된 파일3개의 추가작업 그리고 11개의 파일을 삭제
  1. 0 4
      packages/app/src/components/Navbar/SubNavButtons.tsx
  2. 3 7
      packages/app/src/components/PageReactionButtons.tsx

+ 0 - 4
packages/app/src/components/Navbar/SubNavButtons.tsx

@@ -47,16 +47,12 @@ const SubNavButtons: FC<SubNavButtonsProps> = (props: SubNavButtonsProps) => {
   if (pageInfoError != null || pageInfo == null) {
   if (pageInfoError != null || pageInfo == null) {
     return <></>;
     return <></>;
   }
   }
-  const { sumOfLikers, likerIds, isLiked } = pageInfo;
 
 
   return (
   return (
     <>
     <>
       {isViewMode && (
       {isViewMode && (
         <PageReactionButtons
         <PageReactionButtons
           pageId={pageId}
           pageId={pageId}
-          sumOfLikers={sumOfLikers}
-          likerIds={likerIds || []}
-          isLiked={isLiked}
           onLikeClicked={likeClickhandler}
           onLikeClicked={likeClickhandler}
         >
         >
         </PageReactionButtons>
         </PageReactionButtons>

+ 3 - 7
packages/app/src/components/PageReactionButtons.tsx

@@ -1,26 +1,22 @@
-import React, { FC, useState, useEffect } from 'react';
+import React, { FC } from 'react';
 import LikeButtons from './LikeButtons';
 import LikeButtons from './LikeButtons';
 
 
 
 
 type Props = {
 type Props = {
   pageId: string,
   pageId: string,
-  sumOfLikers: number,
-  likerIds: string[],
-  isLiked: boolean,
   onLikeClicked: (isLiked : boolean)=>void,
   onLikeClicked: (isLiked : boolean)=>void,
 }
 }
 
 
 
 
 const PageReactionButtons : FC<Props> = (props: Props) => {
 const PageReactionButtons : FC<Props> = (props: Props) => {
   const {
   const {
-    pageId, sumOfLikers, likerIds, isLiked, onLikeClicked,
+    pageId, onLikeClicked,
   } = props;
   } = props;
 
 
-
   return (
   return (
     <>
     <>
       <span>
       <span>
-        <LikeButtons onLikeClicked={onLikeClicked} pageId={pageId} likerIds={likerIds} sumOfLikers={sumOfLikers} isLiked={isLiked}></LikeButtons>
+        <LikeButtons onLikeClicked={onLikeClicked} pageId={pageId}></LikeButtons>
       </span>
       </span>
       <span>
       <span>
         {/*
         {/*