PS-7112 : AKP = My profile page - completed course title goes out of …#206
PS-7112 : AKP = My profile page - completed course title goes out of …#206Tejashrimajage wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the CompletedCourse component by adding flex: 1 to a container View and flexShrink: 1 to the course name GlobalText. The review feedback recommends avoiding inline styles to prevent performance issues, suggesting they be moved to a StyleSheet.create block instead. Additionally, the feedback notes that flexShrink: 1 is redundant on the text component due to the parent container's layout constraints.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| priority={FastImage.priority.high} | ||
| /> | ||
| <View style={{ marginLeft: 10 }}> | ||
| <View style={{ marginLeft: 10, flex: 1 }}> |
There was a problem hiding this comment.
Using inline styles in React Native can lead to performance degradation because a new style object is created on every render, triggering unnecessary garbage collection and child component re-renders. It is highly recommended to move these styles to the StyleSheet.create block at the bottom of the file.
Add the following to your styles stylesheet:
textContainer: {
marginLeft: 10,
flex: 1,
},| <View style={{ marginLeft: 10, flex: 1 }}> | |
| <View style={styles.textContainer}> |
| <GlobalText | ||
| style={[globalStyles.text, { marginLeft: 5, flexShrink: 1 }]} | ||
| > |
There was a problem hiding this comment.
- Redundant Style: Since the parent
Viewnow hasflex: 1(which constrains its width) and is a column-oriented container, theGlobalTextcomponent will automatically wrap its text to fit the available width. Therefore,flexShrink: 1is redundant and can be safely removed. - Inline Styles: To improve performance and maintainability, avoid using inline style objects inside the render method. Move the remaining style to the
StyleSheet.createblock at the bottom of the file.
Add the following to your styles stylesheet:
courseName: {
marginLeft: 5,
},| <GlobalText | |
| style={[globalStyles.text, { marginLeft: 5, flexShrink: 1 }]} | |
| > | |
| <GlobalText | |
| style={[globalStyles.text, styles.courseName]} | |
| > |
|



…frame
https://prathamdigitalteam.atlassian.net/browse/PS-7112