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: update desmos proposals type display [web-desmos] #1310

Merged
merged 5 commits into from
Nov 1, 2023

Conversation

MonikaCat
Copy link
Contributor

@MonikaCat MonikaCat commented Nov 1, 2023

Description

Closes: #XXXX


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • ran linting via yarn lint
  • wrote tests where necessary
  • included the correct type prefix in the PR title
  • targeted the correct branch
  • provided a link to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed
  • added a changeset via yarn && yarn changeset

Copy link

vercel bot commented Nov 1, 2023

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

Name Status Preview Updated (UTC)
cosmos ✅ Ready (Inspect) Visit Preview Nov 1, 2023 10:40am

@MonikaCat MonikaCat changed the title fix: update desmos proposals type display fix: update desmos proposals type display [web-desmos] Nov 1, 2023
@MonikaCat MonikaCat marked this pull request as ready for review November 1, 2023 10:54
@MonikaCat MonikaCat added the automerge Automatically merge PR once all prerequisites pass label Nov 1, 2023
@MonikaCat MonikaCat requested a review from icfor November 1, 2023 10:56
{t(type)}
<Typography variant="body1">
{types.map((type) => (
<Typography variant="body1" className="value">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because inside of a loop, we have to add a key prop here

@@ -101,8 +109,12 @@ const Overview: FC<{ className?: string; overview: OverviewType }> = ({ classNam
<Typography variant="body1" className="label">
{t('type')}
</Typography>
<Typography variant="body1" className="value">
{t(type)}
<Typography variant="body1">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can remove this parent typography since it is already used inside the loop

}
types.forEach((type: string) => {
if (type === 'parameterChangeProposal') {
extraDetails = (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this loop will set extraDetails depending of the last value of the types array, not sure of logic but just to confirm that this is expected

R.pathOr('', [0, '@type'], overview.content) === ''
? getProposalType(R.pathOr('', ['@type'], overview.content))
: getProposalType(R.pathOr('', [0, '@type'], overview.content));
const types: string[] = [];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this is used as a dependency of the useCallback hook, I would recommend using useMemo here or the callback will be created every time (not only this line but all the types definition)

@mergify mergify bot merged commit 3b7f63b into main Nov 1, 2023
22 checks passed
@mergify mergify bot deleted the m/update-desmos-proposals-display branch November 1, 2023 11:26
@github-actions github-actions bot mentioned this pull request Nov 1, 2023
@MonikaCat MonikaCat restored the m/update-desmos-proposals-display branch November 2, 2023 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge PR once all prerequisites pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants