-
Notifications
You must be signed in to change notification settings - Fork 237
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
Adjusted the sidebar width to cover the entire width for small screens #630
Adjusted the sidebar width to cover the entire width for small screens #630
Conversation
@Spiral-Memory I have made the Sidebar responsive |
@@ -75,7 +75,7 @@ export const getMessageDividerStyles = (theme) => { | |||
line-height: 1rem; | |||
position: relative; | |||
display: flex; | |||
z-index: 1000; | |||
z-index: 1; |
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.
Is there any specific reason for changing this? The current structure uses a specific set of z-index values for different elements, so it behaves correctly during integration. Is it necessary to change it? Please look for ways to avoid this change
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.
The z-Index is made 1 so that the date for the messages does not appear over sidebar menu when it gets adjusted to Full Screen
setIsSmallScreen(window.innerWidth <= 780); | ||
}; | ||
|
||
window.addEventListener('resize', handleResize); |
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 suggest using media queries instead. In my opinion, a resize event listener is not needed at all. Consider how mobile devices work—will they be resizing their screens?
return () => window.removeEventListener('resize', handleResize); | ||
}, []); | ||
|
||
const viewComponentStyle = isSmallScreen |
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.
Please don't define styles here. There is nothing wrong with it, but we follow a specific structure where all major styles are in the component.style.js file, and only inline styles should be applied in the component.js file. Look at other components and please follow the same pattern.
setIsSmallScreen(window.innerWidth <= 780); | ||
}; | ||
|
||
window.addEventListener('resize', handleResize); |
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.
Same comment as above !
return () => window.removeEventListener('resize', handleResize); | ||
}, []); | ||
|
||
const viewComponentStyle = isSmallScreen |
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.
Same comment as above !
setIsSmallScreen(window.innerWidth <= 780); | ||
}; | ||
|
||
window.addEventListener('resize', handleResize); |
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.
Same comment as above !
Thank you so much, @abirc8010 ! However, I’ve suggested a few changes. Please go through them. Thanks! |
@Spiral-Memory then can I change these styles to inline styles ? |
Nope, there are many styles that you have applied for. Please follow the 'component.styles.js' approach like in other components to keep things consistent. |
@Spiral-Memory, I have |
Looks good to me on an initial review, please update your 'after' videos showcasing how it behaves now after the change. I'll review it thoroughly and let you know Awesome work 👏🎉 @abirc8010 |
Hey @abirc8010 Please fix this lint issue and make sure you've formatted everything with prettier:
|
@Spiral-Memory I have fixed the linting issue and updated the after video |
In the video, you haven't shown, whether it behaves like before in normal screen sizes. |
I've updated it now |
Hey @abirc8010 , Some issues include:
These are the issues I noticed after the PR was deployed, but there could be more. Please address them and thoroughly test PRs under multiple conditions to prevent such issues from recurring. Thanks for your help. |
About the alignment , I think it can be better managed , if I can apply the inline styling to Viewcomponent and maintain a isSmallScreen variable For rest of the issues, I will address them by today |
@Spiral-Memory Could you please tell me why a high value of z-index is chosen here : and how to reproduce this : |
The zIndex values have been in place since the start of the project. Changing one value can disrupt the project in multiple areas. To prevent this, I have designed other elements with respect to these values, ensuring nothing is affected. It is recommended to follow this pattern. However, if you do change it, you must thoroughly test everything under all possible conditions to ensure it works as expected. To reproduce the issue, open the sidebar on a standard laptop screen and hover over the message. |
Brief Title
This PR ensures the sidebar behaves responsively by making it occupy the full screen on devices with a screen width of 780px or smaller. For larger screens, the sidebar retains its original layout.
Acceptance Criteria fulfillment
Fixes # (issue)
#629
Video/Screenshots
Before:
Before.webm
After:
Screencast.from.2024-10-01.00-44-23.webm