-
-
Notifications
You must be signed in to change notification settings - Fork 24
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(speakers_catalog): fix speakers catalog – mobile edits #3359
fix(speakers_catalog): fix speakers catalog – mobile edits #3359
Conversation
Task linked: CU-86c0wm5a6 [FIX] Speakers catalog – mobile edits |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThis pull request focuses on enhancing the responsiveness of several components across the persons and speakers catalog features. The changes primarily introduce a new Changes
Sequence DiagramsequenceDiagram
participant User
participant Component
participant Breakpoints
User->>Breakpoints: Resize screen
Breakpoints->>Component: Trigger tablet600Down state
Component->>Component: Adjust layout
Component->>Component: Modify button positioning
Component->>User: Render responsive UI
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (7)
src/features/persons/date_history/index.tsx (1)
56-56
: Consider extracting button styles to a shared constant.The button styling properties are duplicated between delete and add buttons. Consider extracting these common styles to reduce duplication:
+ const mobileButtonStyles = { + height: '32px', + minHeight: '32px !important', + width: tablet600Down ? 'fit-content' : 'auto', + }; <Button variant="small" color="red" startIcon={<IconDelete />} - sx={{ - height: '32px', - minHeight: '32px !important', - width: tablet600Down ? 'fit-content' : 'auto', - }} + sx={mobileButtonStyles} onClick={() => onDelete(id)} >Also applies to: 59-71
src/features/persons/speakers_catalog/other_congregations/header/index.tsx (1)
45-83
: Extract duplicate IconExpand component.The IconExpand component and its styles are duplicated. Consider extracting it into a reusable component:
+ const ExpandButton = ({ expanded, onClick }) => ( + <IconButton onClick={onClick}> + <IconExpand + color="var(--black)" + sx={{ + transform: expanded ? 'rotate(180deg)' : 'rotate(0deg)', + transition: 'transform 0.3s', + }} + /> + </IconButton> + ); {tablet600Down && ( - <IconButton onClick={() => onExpandChange(cong_number)}> - <IconExpand - color="var(--black)" - sx={{ - transform: expanded ? 'rotate(180deg)' : 'rotate(0deg)', - transition: 'transform 0.3s', - }} - /> - </IconButton> + <ExpandButton expanded={expanded} onClick={() => onExpandChange(cong_number)} /> )}src/features/persons/speakers_catalog/other_congregations/congregation_item/index.tsx (1)
1-1
: Remove unnecessary eslint disable comment.The
@typescript-eslint/no-unused-vars
disable comment appears to be unnecessary as all imported variables are used in the component.src/features/persons/speakers_catalog/my_congregation/header/index.tsx (2)
55-103
: Consider breaking down the mobile layout into smaller components.The mobile layout section is quite large and contains nested conditional rendering. Consider extracting the mobile actions into a separate component for better maintainability:
const MobileActions = ({ editMode, onEditModeChange, expanded, onExpandChange, congAccountConnected, handleOpenAccess }) => { const { t } = useAppTranslation(); const { isPublicTalkCoordinator } = useCurrentUser(); return ( <Box sx={{ display: 'flex', alignItems: 'center', gap: '8px' }}> {/* ... extracted mobile actions ... */} </Box> ); };
140-170
: Extract duplicate action buttons logic.The action buttons logic is duplicated between mobile and desktop layouts. Consider creating a shared component:
const ActionButtons = ({ editMode, onEditModeChange, expanded, onExpandChange, congAccountConnected, handleOpenAccess }) => { // ... shared action buttons logic };src/features/persons/speakers_catalog/other_congregations/speakers_list/edit/index.tsx (2)
56-56
: Consider consolidating breakpoint usage for consistency.The component uses both
tabletDown
andtablet600Down
breakpoints. Consider using a single breakpoint consistently throughout the component to maintain uniform responsive behavior.
234-247
: Consider consolidating duplicate button styles.The songs button shares identical styling with the delete button. Consider extracting the common styles into a shared style object or component to reduce duplication.
+ const commonButtonStyle = { + height: '32px', + minHeight: '32px !important', + width: tablet600Down ? 'fit-content' : 'auto', + }; <Button variant="small" color="red" startIcon={<IconDelete />} - sx={{ - height: '32px', - minHeight: '32px !important', - justifySelf: 'flex-end', - width: tablet600Down ? 'fit-content' : 'auto', - }} + sx={{ + ...commonButtonStyle, + justifySelf: 'flex-end', + }} onClick={() => handleDeleteSpeaker(speaker.person_uid)} > {t('tr_delete')} </Button> {selectedTalks.length > 0 && ( <Button variant="small" startIcon={<IconSong />} - sx={{ - height: '32px', - minHeight: '32px !important', - width: tablet600Down ? 'fit-content' : 'auto', - }} + sx={commonButtonStyle} onClick={handleOpenSpeakerDetails} > {t('tr_songs')} </Button> )}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
src/features/persons/date_history/index.tsx
(2 hunks)src/features/persons/speakers_catalog/my_congregation/header/index.tsx
(4 hunks)src/features/persons/speakers_catalog/my_congregation/index.tsx
(1 hunks)src/features/persons/speakers_catalog/other_congregations/congregation_item/index.tsx
(3 hunks)src/features/persons/speakers_catalog/other_congregations/header/index.tsx
(2 hunks)src/features/persons/speakers_catalog/other_congregations/speakers_list/edit/index.tsx
(4 hunks)
✅ Files skipped from review due to trivial changes (1)
- src/features/persons/speakers_catalog/my_congregation/index.tsx
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Summary
🔇 Additional comments (5)
src/features/persons/date_history/index.tsx (1)
21-21
: LGTM! Good breakpoint organization.The addition of
tablet600Down
alongside existing breakpoints provides better granular control for mobile layouts.src/features/persons/speakers_catalog/other_congregations/header/index.tsx (1)
86-113
: LGTM! Good responsive design pattern.The conditional rendering based on
tablet600Down
effectively organizes the UI elements for different screen sizes.src/features/persons/speakers_catalog/other_congregations/congregation_item/index.tsx (1)
66-96
: LGTM! Well-structured mobile layout.The mobile button container is well-organized with proper spacing and alignment. Good use of the Button component's variant prop for consistent styling.
src/features/persons/speakers_catalog/other_congregations/speakers_list/edit/index.tsx (2)
213-214
: LGTM! Improved mobile layout handling.The flexWrap adjustment ensures a consistent horizontal button layout on mobile devices.
228-228
: LGTM! Appropriate button width adjustment for mobile.The width adjustment to 'fit-content' on mobile screens helps optimize space usage.
organized-app
|
Project |
organized-app
|
Branch Review |
main
|
Run status |
|
Run duration | 00m 05s |
Commit |
|
Committer | Max Makaluk |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
0
|
|
0
|
|
0
|
|
0
|
|
1
|
View all changes introduced in this branch ↗︎ |
🎉 This PR is included in version 3.6.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Description
[FIX] Speakers catalog – mobile edits https://app.clickup.com/t/86c0wm5a6
Card icon-buttons adjustment https://app.clickup.com/t/86c0wm5e3
Speaker's action buttons as horizontal flexbox https://app.clickup.com/t/86c0wm5jc
Type of change
Please delete options that are not relevant.
Checklist: