Yohei-Shiina пре 4 година
родитељ
комит
f481f7ba7b

+ 6 - 6
packages/app/src/components/LikeButtons.tsx

@@ -9,7 +9,7 @@ import AppContainer from '~/client/services/AppContainer';
 import { useSWRPageInfo } from '../stores/page';
 import { IUser } from '../interfaces/user';
 
-type LegacyLikeButtonsProps = {
+type LikeButtonsProps = {
   appContainer: AppContainer,
   likerIds: string[],
   sumOfLikers: number,
@@ -22,7 +22,7 @@ type LegacyLikeButtonsProps = {
 
 // TODO : user image not displayed in search page. Fix it.
 // task : https://estoc.weseek.co.jp/redmine/issues/81110
-const LegacyLikeButtons: FC<LegacyLikeButtonsProps> = (props: LegacyLikeButtonsProps) => {
+const LikeButtons: FC<LikeButtonsProps> = (props: LikeButtonsProps) => {
   const [isPopoverOpen, setIsPopoverOpen] = useState(false);
   const { data: pageInfo } = useSWRPageInfo(props.pageId);
 
@@ -78,10 +78,10 @@ const LegacyLikeButtons: FC<LegacyLikeButtonsProps> = (props: LegacyLikeButtonsP
 /**
  * Wrapper component for using unstated
  */
-const LegacyLikeButtonsWrapper = withUnstatedContainers(LegacyLikeButtons, [AppContainer]);
+const LikeButtonsUnstatedWrapper = withUnstatedContainers(LikeButtons, [AppContainer]);
 
-const LikeButtons = (props) => {
-  return <LegacyLikeButtonsWrapper {...props}></LegacyLikeButtonsWrapper>;
+const LikeButtonsWrapper = (props) => {
+  return <LikeButtonsUnstatedWrapper {...props}></LikeButtonsUnstatedWrapper>;
 };
 
-export default withTranslation()(LikeButtons);
+export default withTranslation()(LikeButtonsWrapper);

+ 1 - 1
packages/app/src/components/PageReactionButtons.tsx

@@ -8,7 +8,7 @@ type Props = {
   likerIds: string[],
   isLiked: boolean,
   likers: IUser[],
-  onLikeClicked: (isLiked : boolean)=>void,
+  onLikeClicked?: ()=>void,
 }