HathorNetwork / hathor-wallet-mobile

Hathor official mobile wallet
https://hathor.network/
MIT License
24 stars 24 forks source link

[ReactNative] Flatten margin styles causing "ghost" margins on FeedbackContent component #532

Closed alexruzenhack closed 2 months ago

alexruzenhack commented 2 months ago

The following component FeedbackContent uses a flatten style method to aggregate conditional styles like offmargin, as you can see bellow:

<FeedbackContent
  message={t`Loading arguments.`}
  icon={<Spinner size={48} animating />}
  offmargin
/>

The offmargin flag sets a style to marginVertical: 0, while the component has a marginTop and marginBottom properties set. The the styles are flattened, the result is:

The following image shows the gap between the title and the FeedbackContent component, while there is no margins or paddings applied:

The following image demonstrates the component's margins are zero.

By making other tests I have found a pattern:

See the following Expo snack with the tests: https://snack.expo.dev/@alexruzenhack/margin-rules-application

I have fixed this issue in the following commit: https://github.com/HathorNetwork/hathor-wallet-mobile/pull/495/commits/5e90771c43cb7c7d795c493ee22114bb2e55f3fb