Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: show real date and remember survey list orientation #2108

Merged
merged 2 commits into from
Feb 21, 2024

Conversation

jobenjada
Copy link
Member

fix: show real date and remember survey list orientation

Copy link

vercel bot commented Feb 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
formbricks-cloud ⬜️ Ignored (Inspect) Visit Preview Feb 21, 2024 0:47am
formbricks-com ⬜️ Ignored (Inspect) Visit Preview Feb 21, 2024 0:47am

Copy link
Contributor

github-actions bot commented Feb 21, 2024

Thank you for following the naming conventions for pull request titles! 🙏

Copy link
Contributor

packages/ui/SurveysList/components/SurveyCard.tsx

Instead of using multiple if-else statements, you can use a switch statement to improve the readability and performance of your code. Switch statements are faster than if-else statements when there are more than two conditions to be evaluated.
Create Issue
See the diff
Checkout the fix

    const surveyStatusLabel = useMemo(() => {
      switch(survey.status) {
        case "inProgress":
          return "Active";
        case "completed":
          return "Completed";
        case "draft":
          return "Draft";
        case "paused":
          return "Paused";
        default:
          return "";
      }
    }, [survey]);
git fetch origin && git checkout -b ReviewBot/Impro-m7lhax8 origin/ReviewBot/Impro-m7lhax8

Since the SurveyTypeIndicator component is a pure component (its output is solely determined by its props), you can use React.memo to avoid unnecessary re-renders when the props do not change. This can improve the performance of your application, especially when rendering large lists.
Create Issue
See the diff
Checkout the fix

    const SurveyTypeIndicator = React.memo(({ type }: { type: string }) => (
      <div className="flex items-center space-x-2 text-sm text-slate-600">
        {type === "web" ? (
          <>
            <Code className="h-4 w-4" />
            <span> In-app</span>
          </>
        ) : (
          <>
            <Link2Icon className="h-4 w-4" />
            <span> Link</span>
          </>
        )}
      </div>
    ));
git fetch origin && git checkout -b ReviewBot/Impro-ks1f4lx origin/ReviewBot/Impro-ks1f4lx

Since the SurveyCard component is a pure component (its output is solely determined by its props), you can use React.memo to avoid unnecessary re-renders when the props do not change. This can improve the performance of your application, especially when rendering large lists.
Create Issue
See the diff
Checkout the fix

    const SurveyCard = React.memo(({...props}: SurveyCardProps) => {
      // existing component code
    });
git fetch origin && git checkout -b ReviewBot/Impro-5310649 origin/ReviewBot/Impro-5310649

@mattinannt mattinannt added this pull request to the merge queue Feb 21, 2024
Merged via the queue into main with commit be14678 Feb 21, 2024
13 checks passed
@mattinannt mattinannt deleted the tweaks-survey-list branch February 21, 2024 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants