-
Notifications
You must be signed in to change notification settings - Fork 363
Conversation
CLA Assistant Lite All Contributors have signed the CLA. |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
@lukasschor thank you for your suggestions! I was still working on the old link change, as it had some deeper changes 😉 but all the others were useful! Once the build is ready all those will be done. I still have to add, if is still requested the "upgrade" badge that we had (red dot in Safe Details button when a smart contract upgrade is available) Or maybe we can remove it from scope and create a new ticket in order to add some more standard bubble that can be used for a more generic notification system for any menu entry WDYT? |
badge: needsUpdate && granted, | ||
icon: <ListIcon type="info" />, | ||
selected: safeAction === 'settings' && safeSubaction === 'details', | ||
href: `${matchSafeWithAddress?.url}/settings/details`, |
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.
There's a bit of duplication in this config. I would suggest defining a more static config and build this one from it.
Like so:
const makeItem = (config) => ({
label: config.label,
badge: needsUpdate && granted,
icon: <ListIcon type={config.id} />,
selected: safeAction === config.sectionId && safeSubaction === config.id,
href: `${matchSafeWithAddress?.url}/${config.sectionId}/${config.id}`,
})
makeItem({
label: ''Safe Details',
id: 'details',
sectionId: 'settings'
}),
makeItem({
...
}),
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.
I'm not sure that this change has a big impact. Will only save us from writting <ListIcon />
and matchSafeWithAddress?.url/
. config.id
abstraction done here is not correct, Icon type doesn't always match with subSection name. Worst case we will always need the same number of properties to write this:
makeItem({
label: 'Safe Details',
badge: (true or false, needs to be parametrized for each case)
icon: 'settingsTool',
sectionId: 'settings',
subSectionId: 'subSection'
})
render={() => <SpendingLimitSettings />} | ||
></Route> | ||
<Route | ||
path={`${SAFELIST_ADDRESS}/${address}/settings/advanced`} |
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.
These URLs are duplicated here and in the menu. Ideally they should come from the same enum, and the menu should use generatePath
.
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.
With current implementation I can only do a partial refactor for this suggestion. I won't be able to use generatePath
, as SAFELIST_ADDRESS include a /
character and generatePath escape those values.
To improve this we should either go for a tech debt ticket because it won't make sense to change it only here or to define two SAFELIST_ADDRESS
values in src/routes/routes
meanwhile we can't do the full migration
Reset collapse state when changing safe
Screen.Recording.2021-07-12.at.17.30.00.movThis bouncing behavior seems weird. It happens when you click a category that is already selected. |
The bouncer behavior and the issue with the "back" button in browsers were solved. It looks good to me |
@dasanra , is the information about the opened tab is missed or skipped ? |
What it solves
Resolves #1295
How this PR fixes it
This PR adds subtabs menu for ASSETS and SETTINGS, making easier to discover collectibles and making the view for the settings bigger
How to test it
Just load a safe and navigate using the sidebar menu. Check for the expected behavior when clicking around
Screenshots
Notification badge example for current PR