Skip to content
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

chore: Elm theme improvement on Course Discussions #90

Open
wants to merge 7 commits into
base: 2U/develop
Choose a base branch
from

Conversation

saeedbashir
Copy link

Description:

Jira Ticket: LEARNER-10162

Config PR: https://github.com/edx/edx-mobile-config/pull/184

This PR adds some color improvements in the discussion module and changes the button corner style throughout the app.

before.mov
after.mov

@@ -68,15 +68,15 @@ public struct CommentCell: View {
onReportTap()
}, label: {
comment.abuseFlagged
? CoreAssets.reported.swiftUIImage
: CoreAssets.report.swiftUIImage
? (CoreAssets.reported.swiftUIImage.renderingMode(.template))
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we need outer brackets here?

Copy link
Author

Choose a reason for hiding this comment

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

Without these brackets the Xcode is generating the following warning Void Function in Ternary Violation: Using ternary to call Void functions should be avoided (void_function_in_ternary)

Copy link
Collaborator

@rnr rnr Oct 24, 2024

Choose a reason for hiding this comment

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

Then maybe you should heed the warning recommendation and not hide the warning but refactor the code?
Something like this:
let icon = comment.abuseFlagged ? CoreAssets.reported.swiftUIImage : CoreAssets.report.swiftUIImage icon.renderingMode(.template)
WDYT?

Copy link
Author

Choose a reason for hiding this comment

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

addressed!

.frame(width: 48, height: 48)
.cornerRadius(isThread ? 8 : 24)
.cornerRadius(24)
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this change acceptable for upstream?
Screenshot 2024-10-18 at 14 47 46

Copy link
Author

Choose a reason for hiding this comment

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

I guess so because this is the only place where the user avatar isn't circular. So after this change, the user avatar will be consistent across the app.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hello @marcotuts and @sdaitzman. Could you please confirm that this almost square avatar is not a design feature and should be the same throughout the app? Thank you

Copy link

Choose a reason for hiding this comment

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

to me the avatar being square and circle is a design inconsistency. It should either be circle everywhere or square everywhere. For 2U we have a circular approach to icons and buttons.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree with you. Just need confirmation we shouldn't add theming here.

: Theme.Colors.textSecondaryLight)
Spacer()
Button(action: {
onReportTap()
}, label: {
comments.abuseFlagged
? CoreAssets.reported.swiftUIImage
: CoreAssets.report.swiftUIImage
? (CoreAssets.reported.swiftUIImage.renderingMode(.template))
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we need outer brackets here?

Copy link
Author

Choose a reason for hiding this comment

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

@saeedbashir saeedbashir requested a review from rnr October 24, 2024 05:17
}

public final class ThemeConfig: NSObject {
public var isRoundedCorners: Bool
public var buttonCornersRadius: Double

Choose a reason for hiding this comment

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

Vertical Whitespace Violation: Limit vertical whitespace to a single empty line; currently 2 (vertical_whitespace)

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.

4 participants