Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Adding errorState in useFetchProfile #1745

Merged
merged 2 commits into from
Nov 8, 2021

Conversation

henrypalacios
Copy link
Contributor

@henrypalacios henrypalacios commented Oct 29, 2021

Summary

Closes #1698

Proposal:

  • Include a NotificationBanner component inside the Profile Overview Card.

To Test

const lastUpdated = useTimeAgo(profileData?.lastUpdated)

const renderNotificationMessages = () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This could improve the readability to group the other notifications, what do you think @ramirotw?

Copy link
Contributor

Choose a reason for hiding this comment

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

I like the approach. I'm wondering though what happens if both banners are displayed, not sure if that's possible from a state perspective

Copy link
Contributor Author

Choose a reason for hiding this comment

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

while I'm aware that it is currently not possible to show both statuses at the same time now (because errors are only consulted when it is mainnet).

If you think it is better than this without grouping, let me know.

@github-actions
Copy link
Contributor

  • 🔭 GP Swap: Gnosis Protocol v2 Swap UI

@henrypalacios henrypalacios requested review from ramirotw, alongoni and elena-zh and removed request for elena-zh October 29, 2021 23:00
@henrypalacios
Copy link
Contributor Author

@elena-zh, @ramirotw
I have a doubt, how the user can try again?

Selection_327
☝️ Will this button restart the reading?

@elena-zh
Copy link

elena-zh commented Nov 1, 2021

I have a doubt, how the user can try again?
Selection_327
☝️ Will this button restart the reading?

Hi @henrypalacios , no, the icon is supposed to be static (discussed in #1376 (comment), see the 4th point)

'Try again' message is displayed everywhere for error messages in different web and mobile applications. Sometimes they are accompanied with an action, sometimes not. In our case a user is able to reload the page using browser's action button/pull down the screen in a mobile device.

I'd only add 'later' to the 'Please try again' message to sound it more accomplished...

@elena-zh
Copy link

elena-zh commented Nov 1, 2021

Hey @henrypalacios , I have taken a look into the PR.
I have to leave all the notes I reported in more or less similar task #1714 (comment) related to adding a banner:

  1. As the banner is displayed inside, so it would be nice to remove close icon (as it is not a banner), just a warning
  2. Important: profile data sections are missing in the mobile view
    image
  3. It would be nice to add a boarder radius to the banner: reported as a separate issue [Profile] implement boarder radius for info banner #1738

Also, when the PR is finished, it would be good to me to test it in a 'real' situation and check whether this banner appears only when https://protocol-mainnet.dev.gnosisdev.com/api/v1/profile/.... fails.

Thanks!

@henrypalacios henrypalacios marked this pull request as ready for review November 1, 2021 21:01
@elena-zh
Copy link

elena-zh commented Nov 2, 2021

Hey @henrypalacios , I still see messing profile sections in the mobile view when error message is displayed.
Could you please fix it?
image
image

@henrypalacios
Copy link
Contributor Author

@elena-zh It should be solved.

Regarding the banner border, this will be covered in PR-#1703, since I'm using an instance of the component that Agustin is updating in that.

Copy link
Contributor

@ramirotw ramirotw left a comment

Choose a reason for hiding this comment

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

looking good, still needs to be rebased to clear some commits

const lastUpdated = useTimeAgo(profileData?.lastUpdated)

const renderNotificationMessages = () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I like the approach. I'm wondering though what happens if both banners are displayed, not sure if that's possible from a state perspective

src/custom/hooks/useFetchProfile.ts Outdated Show resolved Hide resolved
@henrypalacios henrypalacios force-pushed the 1698-warn-when-loading-error branch 2 times, most recently from 29a93b5 to 0ae32f3 Compare November 2, 2021 20:23
@henrypalacios henrypalacios changed the base branch from develop to release/1.4.0 November 2, 2021 20:39
@elena-zh
Copy link

elena-zh commented Nov 3, 2021

Hey @henrypalacios , changes LGTM now!
However, you have merged @ramirotw PR #1753 into yours, so now I see shimming effect for fields/date all the time when a user is not connected/is in another network.
image

I think , I will need retest this once again when it will be fixed there and merged here once again...

@henrypalacios henrypalacios changed the base branch from release/1.4.0 to develop November 3, 2021 15:24
@henrypalacios
Copy link
Contributor Author

henrypalacios commented Nov 3, 2021

@elena-zh I have left only what concerns this problem from #1753.

Copy link
Contributor

@alfetopito alfetopito left a comment

Choose a reason for hiding this comment

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

Nipick comments on the code, the behaviour looks good

src/custom/hooks/useFetchProfile.ts Outdated Show resolved Hide resolved
src/custom/pages/Profile/index.tsx Outdated Show resolved Hide resolved
@elena-zh
Copy link

elena-zh commented Nov 4, 2021

Changes LGTM now!

@ramirotw ramirotw added the Protofire Handled by Protofire development team label Nov 5, 2021
@henrypalacios henrypalacios requested review from ramirotw and removed request for ramirotw November 5, 2021 16:17
@henrypalacios henrypalacios merged commit 7e08a83 into develop Nov 8, 2021
@henrypalacios henrypalacios deleted the 1698-warn-when-loading-error branch November 8, 2021 12:56
ramirotw pushed a commit that referenced this pull request Nov 10, 2021
* Adding errorState in useFetchProfile
ramirotw pushed a commit that referenced this pull request Nov 10, 2021
* Adding errorState in useFetchProfile
@ramirotw ramirotw mentioned this pull request Nov 10, 2021
nenadV91 pushed a commit that referenced this pull request Nov 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Protofire Handled by Protofire development team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Profile] Warn a user when there is an error loading a profile data
4 participants