Repository navigation
Theme switching ESLint rules #32569
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
Merged
grgia
merged 28 commits into
Expensify:main
from
margelo:@chrispader/theme-switching-eslint-rules
Jan 5, 2024
Merged
Theme switching ESLint rules #32569
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
0095fc7
update eslint
chrispader 8aa81be
add eslint ignores
chrispader 8879e2c
Merge branch 'main' into @chrispader/theme-switching-eslint-rules
26fa87e
update eslint rules
7dc7d8e
fix: storybook
b756433
fix: style util structure
157548e
fix: more imports
8db99c5
fix: illustrations type
41d4b83
remove staticStyleUtils export
35a1f1e
create FontUtils
c07f952
fix: font utils usages
de21804
Merge branch 'main' into @chrispader/theme-switching-eslint-rules
0826677
Merge branch 'main' into @chrispader/theme-switching-eslint-rules
chrispader ece565a
move FontUtils
chrispader 9920571
move again
chrispader 194160f
adapt eslint rules
chrispader 0b3e28f
fix: eslint rule
chrispader 678bfdf
fix imports
chrispader 2334531
fix: adress comments
chrispader a1ff255
Merge branch 'main' into @chrispader/theme-switching-eslint-rules
chrispader e9950ab
Merge branch 'main' into @chrispader/theme-switching-eslint-rules
chrispader 19d729b
add eslint exception for types
chrispader deb3408
Merge branch 'main' into @chrispader/theme-switching-eslint-rules
chrispader 46a49d1
Merge branch 'main' into @chrispader/theme-switching-eslint-rules
chrispader 220c545
fix merge conflicts
chrispader 32f176f
Merge branch 'main' into @chrispader/theme-switching-eslint-rules
3b0e1a4
fix: lint
99ca991
Merge branch 'main' into @chrispader/theme-switching-eslint-rules
chrispader 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
40 changes: 40 additions & 0 deletions
40
src/libs/Navigation/AppNavigator/createModalCardStyleInterpolator.ts
|
chrispader marked this conversation as resolved.
Resolved
|
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| import type {StackCardInterpolatedStyle, StackCardInterpolationProps} from '@react-navigation/stack'; | ||
| import {Animated} from 'react-native'; | ||
| import type {StyleUtilsType} from '@styles/utils'; | ||
| import variables from '@styles/variables'; | ||
|
|
||
| type ModalCardStyleInterpolator = ( | ||
| isSmallScreenWidth: boolean, | ||
| isFullScreenModal: boolean, | ||
| stackCardInterpolationProps: StackCardInterpolationProps, | ||
| outputRangeMultiplier?: number, | ||
| ) => StackCardInterpolatedStyle; | ||
| type CreateModalCardStyleInterpolator = (StyleUtils: StyleUtilsType) => ModalCardStyleInterpolator; | ||
|
|
||
| const createModalCardStyleInterpolator: CreateModalCardStyleInterpolator = | ||
| (StyleUtils) => | ||
| (isSmallScreenWidth, isFullScreenModal, {current: {progress}, inverted, layouts: {screen}}, outputRangeMultiplier = 1) => { | ||
| const translateX = Animated.multiply( | ||
| progress.interpolate({ | ||
| inputRange: [0, 1], | ||
| outputRange: [outputRangeMultiplier * (isSmallScreenWidth ? screen.width : variables.sideBarWidth), 0], | ||
| extrapolate: 'clamp', | ||
| }), | ||
| inverted, | ||
| ); | ||
|
|
||
| const cardStyle = StyleUtils.getCardStyles(screen.width); | ||
|
|
||
| if (!isFullScreenModal || isSmallScreenWidth) { | ||
| cardStyle.transform = [{translateX}]; | ||
| } | ||
|
|
||
| return { | ||
| containerStyle: { | ||
| overflow: 'hidden', | ||
| }, | ||
| cardStyle, | ||
| }; | ||
| }; | ||
|
|
||
| export default createModalCardStyleInterpolator; |
This file contains hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.