-
Notifications
You must be signed in to change notification settings - Fork 339
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
{t(type)} | ||
<Typography variant="body1"> | ||
{types.map((type) => ( | ||
<Typography variant="body1" className="value"> |
There was a problem hiding this comment.
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"> |
There was a problem hiding this comment.
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 = ( |
There was a problem hiding this comment.
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[] = []; |
There was a problem hiding this comment.
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)
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...
yarn lint
yarn && yarn changeset