-
Notifications
You must be signed in to change notification settings - Fork 152
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
Adapt every UI component to auto scale in size #195
Comments
Hi, I ran into a problem trying to use
However, The suggested solution is to use |
Hey @fmitjans , Thanks for implicitly taking over this task! I will be giving it a try to get around this issue with the dependencies and get done one example in the following days. I'm sure there must be a way around this problem :) Hope it is not tricky to find! |
Hey @fmitjans , Indeed, there does not seem to be any clear solution. MaterialUI v5 seems to have dropped support for The package import { useTheme } from '@mui/material/styles';
function DeepChild() {
const theme = useTheme();
return <span>{`spacing ${theme.spacing}`}</span>;
} However for the few class components left on the RoboSats app (the main big pages e.g. UserGenPage, OrderPage...), we need to find a workaround. I thought we could keep the I gave a try to this idea and created a new branch: main...demo-scale-ui-theme-size On the first commit I created a simple "Zoom out button", when pressed it updates the state variable As a demo of how we fix the hardcoded pixel sizes, I made the Robot avatar in the landing page scale in size with I hope this demo clears the way for the work needed to solve this issue. I believe most functional components will be easy to adapt using the Let me know if I can further help in some way. |
Hey @fmitjans , I wonder whether you are looking into this task. Should I assign you (no pressure, drop out if you want) so other devs can see someone is on top of this task already? |
Sure, sign me up. Is it ok if I continue working on the demo branch? |
Please continue working over it :) |
I have a few question about the botom bar, which right now has fixed width and position:
Something similar should happen with other fixed components such as UnsafeAlert |
I guess at some point when increasing size, the Desktop BottomBar must be replaced by the Mobile one that is more sparse and has no text. Do you think this is possible?
I guess we will set a limit so the size cannot be increased much (Maybe 16?). Anyway, the scaling feature is for users to have some freedom to adapt to their needs, if they break the usability by increasing the size... maybe they went too far. Freedom brings responsibility :D |
Hello, I am thankful of having had the opportunity to contribute to this project, but unfortunately my circumstances have changed and I can't spare the time to complete this issue. I write this thinking it may be better to change the status of this issue in the rewards pannel, so as to avoid confusion. |
Hey @fmitjans , thank you very much for letting us know and for having taken the time some time back to start this task. After the full redo of the frontend, this task is, in fact, already finished. Every UI component can be changed in size using the UI size slider on the Settings tab. Once again thank you for your contribution! Closing this issue. |
Is your feature request related to a problem? Please describe.
Most MUI components we are using can be scale in size up or down simply by changing the value of
theme.typography.fontSize
. However, the frontend currently has many hardcodedwidth
andheight
props that we have implemented. If these were also relative tofontSize
, it would trivial to adjust the size of the app, highly increasing the usability on phones with small screens. This enhancement will also help us reuse a few of the components in RoboSats PRO frontend (it will have a default smaller fontSize in order to pack more data in the screen).Describe the solution you'd like
The default
theme.typography.fontSize
is 14, so for example if we change it to 12 the app will be zoomed out to ~85%.https://github.com/Reckless-Satoshi/robosats/blob/aad87e7d98be30bbbb814b91534e0709724c2bc4/frontend/src/components/App.js#L26
However, when changing the size of elements this way, many of the hard-coded icons/images/boxes will remain the same size (... bad practices in our initial implementation). The result is a clunky looking frontend.
It would be great to make all of the hardcoded values automatically scale relative to
props.theme.typography.fontSize
. For that we will have to usewithTheme
in the class components anduseTheme
in the functional components. In addition, some of these values are directly hard-coded instatic/index.css
(for example the size of some Robot Avatars), ideally we should only rely on MUI theming.This is a simple task, yet there might be dozens of hard-coded sizes all throughout the frontend. It will take reviewing and editing almost every file in
/frontend/src/components
then testing that the changes do actually lead to scalable components.Additional context
This task is ⚡rewarded with 300K Sats⚡ . Drop a comment if you want to be assigned.
The text was updated successfully, but these errors were encountered: