Skip to content

PS-7112 : AKP = My profile page - completed course title goes out of …#206

Open
Tejashrimajage wants to merge 1 commit into
tekdi:release-1.0.1from
Tejashrimajage:text-overflow-issue
Open

PS-7112 : AKP = My profile page - completed course title goes out of …#206
Tejashrimajage wants to merge 1 commit into
tekdi:release-1.0.1from
Tejashrimajage:text-overflow-issue

Conversation

@Tejashrimajage

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 }}>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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,
  },
Suggested change
<View style={{ marginLeft: 10, flex: 1 }}>
<View style={styles.textContainer}>

Comment on lines +58 to +60
<GlobalText
style={[globalStyles.text, { marginLeft: 5, flexShrink: 1 }]}
>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

  1. Redundant Style: Since the parent View now has flex: 1 (which constrains its width) and is a column-oriented container, the GlobalText component will automatically wrap its text to fit the available width. Therefore, flexShrink: 1 is redundant and can be safely removed.
  2. Inline Styles: To improve performance and maintainability, avoid using inline style objects inside the render method. Move the remaining style to the StyleSheet.create block at the bottom of the file.

Add the following to your styles stylesheet:

  courseName: {
    marginLeft: 5,
  },
Suggested change
<GlobalText
style={[globalStyles.text, { marginLeft: 5, flexShrink: 1 }]}
>
<GlobalText
style={[globalStyles.text, styles.courseName]}
>

@sonarqubecloud

sonarqubecloud Bot commented Jul 2, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant