-
Notifications
You must be signed in to change notification settings - Fork 3
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: fix avatar size constant #247
Conversation
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.
Thank you for the quick fix, it solves the issue.
However I think this only fixes the surface of the problem and the core can still be subject to breakage when changing/refactoring the code. Let me explain:
- There are 3 constants in the app that somehow relate to sizing the big profile picture:
- AVATAR_SIZE (previously 256, now 200)
- THUMBNAIL_SETTING_MAX_HEIGHT/WIDTH (200)
- THUMBNAIL_DIMENSION (200)
- The
AvatarUploader
component allows to setavatarSize
via an optional prop. This component is used only once, and is passed a prop value foravatarSize
coming from the AVATAR_SIZE constant, so the THUMBNAIL_DIMENSION is actually never used. - Different parts of the AvatarUploader UI are sized with different constants, it works if they have the same value, but breaks if one of them is changed.
In the light of these elements can you reconsider the fix and make it less fragile to changes. I think reducing the number or constants that affect the same values should be considered as well as ensuring that the elements that should be the same size depend on the same variable instead of different ones that hold the same value.
Let me know if something is not clear. Also please take this as a nitpicking comment from my side, that tries to improve the current code, instead of duck taping it 😄
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.
Nice !
01ffd55
to
efc62ae
Compare
|
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
fix #246