push-protocol / push-dapp

The Push Protocol Dapp
https://app.push.org
Other
42 stars 36 forks source link

Twitter Integration in the rewards #1672

Closed abhishek-01k closed 1 week ago

abhishek-01k commented 1 week ago

Pull Request Template

Ticket Number

Not any particular but it needs to be merged in the rewardsV1 branch for twitter flow

Description

Type of Change

Checklist

Frontend Guidelines

Build & Testing

Screenshots/Video with Explanation

Additional Context

Review & Approvals

Notes

We need to change the config to the Push's One right now it has my personal config for testing purpose only.

github-actions[bot] commented 1 week ago

In the file src/modules/rewards/components/ActivityButton.tsx:

  1. There is a typo in the import statement for 'ActivityType'. It should be import { ActivityType } from 'queries'; instead of import { ActvityType } from 'queries';.
  2. In the switch statement, there are missing return statements for cases 'follow_push_on_twitter' and the default case. They should be corrected as follows:
    case 'follow_push_on_twitter':
     componentToRender = (
       <TwitterActivityButton
         userId={userId}
         activityTypeId={activityTypeId}
         refetchActivity={refetchActivity}
         setErrorMessage={setErrorMessage}
       />
     );
     break;
    default:
     componentToRender = (
       <DefaultActivityButton />
     );
     break;
  3. There is a missing closing curly brace } after the switch statement to properly close the component declaration.

Corrected Code:

import { FC } from 'react';
import DiscordActivityButton from './DiscordActivityButton';
import TwitterActivityButton from './TwitterActivityButton';
import DefaultActivityButton from './DefaultActivityButton';
import { ActivityType } from 'queries';

type ActivityButtonProps = {
  userId: string;
  activityTypeId: string;
  activityType: ActivityType;
  refetchActivity: () => void;
  setErrorMessage: (errorMessage: string) => void;
};
const ActivityButton: FC<ActivityButtonProps> = ({
  userId,
  activityTypeId,
  refetchActivity,
  activityType,
  setErrorMessage
}) => {
  let componentToRender;
  switch (activityType) {
    case 'follow_push_on_discord':
      componentToRender = (
        <DiscordActivityButton
          userId={userId}
          activityTypeId={activityTypeId}
          refetchActivity={refetchActivity}
          setErrorMessage={setErrorMessage}
        />
      );
      break;
    case 'follow_push_on_twitter':
      componentToRender = (
        <TwitterActivityButton
          userId={userId}
          activityTypeId={activityTypeId}
          refetchActivity={refetchActivity}
          setErrorMessage={setErrorMessage}
        />
      );
      break;
    default:
      componentToRender = (
        <DefaultActivityButton />
      );
      break;
  }
  return <div>{componentToRender}</div>;
};
export default ActivityButton;

All looks good.

github-actions[bot] commented 1 week ago

In Rewards.tsx:

  1. Line 31, missing comma after 'gap="s6"'.

  2. Line 32 and 38, incorrect placement of style properties inside Text component.

  3. Line 34, missing closing tag for Text component.

  4. Line 36, missing opening tag for Text component.

  5. Line 42, missing closing curly brace after 'ReferralSection />'.

  6. Line 52, missing closing curly brace for the component.

  7. Line 54, missing closing parentheses for the function.

In ActivityButton.tsx:

  1. Line 23, incorrect syntax for rendering component based on the switch case.

In DiscordActivityButton.tsx:

  1. Line 30, missing closing curly brace for the function.

In RewardsActivitiesList.tsx:

  1. No issues found.

In RewardsTabsContainer.tsx:

  1. Line 21, missing closing curly brace for the first useEffect.

In TwitterActivityButton.tsx:

  1. Various sections marked with '...' need to be revisited and checked for potential errors.

These are the issues found in the specified files.

github-actions[bot] commented 1 week ago

In the Rewards.tsx file:

  1. Line 31: The closing curly braces for the useEffect hook is missing. It should be added before the next conditional block.
  2. Line 49: There is a missing closing curly brace for the if (!isWalletConnected) block. It should be added before the next conditional block.
  3. Line 52: There is a missing closing curly brace for the if (!caip10WalletAddress || !userPushSDKInstance || !userError || !isWalletConnected) block. It should be added before the next conditional block.

In the ActivityButton.tsx file:

  1. Line 79: The <DefaultActivityButton /> component is missing the closing angle bracket >. It should be corrected to <DefaultActivityButton />;.
  2. Line 87: The ActivityButton component is missing the closing curly brace }. It should be added at the end of the component definition.

In the DefaultActivityButton.tsx file:

  1. Line 26: The closing curly brace } is missing for the DefaultActivityButton component. It should be added at the end of the component definition.

In the DiscordActivityButton.tsx file:

  1. Line 177: The return statement inside the handleVerify function is missing a closing curly brace }. It should be added before the return statement.
  2. Line 184: The return statement inside the DiscordActivityButton component is missing a closing curly brace }. It should be added at the end of the component.

All other files seem to be fine.

All looks good.

github-actions[bot] commented 1 week ago

In Rewards.tsx:

  1. In the useEffect hook, the closing curly braces are missing for the conditionals. Add closing braces after the return statements.
  2. In the JSX, RewardsTabsContainer component is missing the closing tag />.

In DefaultActivityButton.tsx:

  1. In the DefaultActivityButton component, the closing brace at the end is missing. Add } before exporting.

In RewardsActivityIcon.tsx:

  1. In the RewardsActivityIcon component, there is a missing closing brace for the if (type === 'follow_push_on_twitter') block. Add a closing brace before the return <RewardsActivity />;.

It seems the code snippets provided are not complete, but these are the issues that stand out based on the sections shown.

All looks good.