-
Notifications
You must be signed in to change notification settings - Fork 323
fixed issue where .clear was being used in place of mainBG when image… #279
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,11 +27,11 @@ | |
| // Define keys only for older versions | ||
| #if swift(<6.0) | ||
| @preconcurrency public struct ChatThemeKey: EnvironmentKey { | ||
| public static let defaultValue = ChatTheme() | ||
|
Check warning on line 30 in Sources/ExyteChat/Theme/ChatTheme.swift
|
||
| } | ||
|
|
||
| public struct GiphyConfigurationKey: EnvironmentKey { | ||
| public static let defaultValue = GiphyConfiguration() | ||
|
Check warning on line 34 in Sources/ExyteChat/Theme/ChatTheme.swift
|
||
| } | ||
| #endif | ||
|
|
||
|
|
@@ -58,20 +58,18 @@ | |
| public let images: ChatTheme.Images | ||
| public let style: ChatTheme.Style | ||
|
|
||
| public var contentBG: Color { | ||
| images.background != nil ? .clear : colors.mainBG | ||
| } | ||
|
|
||
| public init( | ||
| colors: ChatTheme.Colors = .init(), | ||
| images: ChatTheme.Images = .init(), | ||
| style: ChatTheme.Style = .init() | ||
| ) { | ||
| self.style = style | ||
| self.images = images | ||
|
|
||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code was initially included so that the image background correctly was the background for input view, it worked but had the side effect that other components (recording button) that used mainBg also had there color set to clear |
||
| // if background images have been set then override the mainBG color to be clear | ||
| self.colors = if images.background != nil { | ||
| ChatTheme.Colors(copy: colors, mainBG: .clear) | ||
| } else { | ||
| colors | ||
| } | ||
| self.colors = colors | ||
| } | ||
|
|
||
| internal init(accentColor: Color, images: ChatTheme.Images) { | ||
|
|
||
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.
this allows the .clear to be used instead of mainBG where needed, the InputView and UIList