-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
31695 theme switching composer #31831
Merged
grgia
merged 11 commits into
Expensify:main
from
lukemorawski:31695-theme_switching_composer
Nov 29, 2023
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7f18651
refactor/move to dynamic styling hooks for composer related files
lukemorawski 61186b0
updateNumberOfLines.native
lukemorawski 358436d
referaldetailspage undo
lukemorawski 01a8727
removed comment
lukemorawski ac58fda
import fix
lukemorawski ca64c3c
fixes
lukemorawski 6c20add
simplified deps array for renderItem callback in EmojiPickerMenu
lukemorawski f1b036a
added ContainerComposeStyles type declaration
lukemorawski ec09469
types
lukemorawski 4406ba3
Merge branch 'main' into 31695-theme_switching_composer
lukemorawski a775123
containerComposeStyles param name change
lukemorawski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import {NativeSyntheticEvent, TextInputContentSizeChangeEventData} from 'react-native'; | ||
import ComposerProps from '@libs/ComposerUtils/types'; | ||
import themeStyles from '@styles/styles'; | ||
|
||
type UpdateNumberOfLines = (props: ComposerProps, event: NativeSyntheticEvent<TextInputContentSizeChangeEventData>) => void; | ||
type UpdateNumberOfLines = (props: ComposerProps, event: NativeSyntheticEvent<TextInputContentSizeChangeEventData>, styles: typeof themeStyles) => void; | ||
|
||
export default UpdateNumberOfLines; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import styles from '@styles/styles'; | ||
import ContainerComposeStyles from './types'; | ||
|
||
const containerComposeStyles: ContainerComposeStyles = [styles.textInputComposeSpacing]; | ||
const containerComposeStyles: ContainerComposeStyles = (styles) => [styles.textInputComposeSpacing]; | ||
|
||
export default containerComposeStyles; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
import styles from '@styles/styles'; | ||
import ContainerComposeStyles from './types'; | ||
|
||
// We need to set paddingVertical = 0 on web to avoid displaying a normal pointer on some parts of compose box when not in focus | ||
const containerComposeStyles: ContainerComposeStyles = [styles.textInputComposeSpacing, {paddingVertical: 0}]; | ||
const containerComposeStyles: ContainerComposeStyles = (styles) => [styles.textInputComposeSpacing, {paddingVertical: 0}]; | ||
|
||
export default containerComposeStyles; |
lukemorawski marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import {ViewStyle} from 'react-native'; | ||
import themeStyles from '@styles/styles'; | ||
|
||
type ContainerComposeStyles = ViewStyle[]; | ||
type ContainerComposeStyles = (styles: typeof themeStyles) => ViewStyle[]; | ||
|
||
export default ContainerComposeStyles; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I'm seeing the following error after I synced with main
Shouldn't this be
There doesn't seem to be a named export called
useTheme
here: src/styles/themes/useTheme.tsThere 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.
I'm seeing the same thing. @lukemorawski why are there no testing steps and no screenshots on this PR?
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.
Maybe because QA team cannot test this PR without switching to light theme which is not enabled yet.
But it would have been better to test in all platforms though this is very simple PR. Or have C+ review and test - should the bug have been caught earlier before merge.
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.
sorry, wrong auto import! fixed now
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.
Is there a PR that fixes this already?
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.
#32237
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.
ah perfect, thanks!
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.
I understand this PR doesn't enable or change any functionality, but it does refactor theming in several components. We should always test these changes even if the test is a super simple "view each component and verify styling is still working". That would have been enough to catch small errors. QA regression testing should catch anything more complex.
@lukemorawski please don't cut corners and test on all platforms even for the simple stuff. I know it's annoying, but it's worth the time 🙇.
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.
should have catched this in the review as well, sorry for that! 🫠
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.
totally agree, sorry again for that