-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[No QA] [TS migration] Review and clean up Styles files #27660
Merged
hayata-suenaga
merged 44 commits into
Expensify:main
from
fabioh8010:ts/style/styles-refactor
Oct 13, 2023
Merged
Changes from 32 commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
ba8a3c1
First version of styles refactor
fabioh8010 b1ee74b
Add more typings
fabioh8010 f967e37
Merge branch 'main' into ts/style/styles-refactor
fabioh8010 4aef004
Remove more CSSProperties usage from styles
fabioh8010 58d4a25
Add more props and styles
fabioh8010 c3fc096
Merge remote-tracking branch 'origin/main' into ts/style/styles-refactor
fabioh8010 091104e
Refactor styles and implement missing ones
fabioh8010 c7d0164
Merge branch 'main' into ts/style/styles-refactor
blazejkustra e4a3313
Migrate styles.ts
blazejkustra b8d36f7
Remove unused imports
blazejkustra 24f363b
Fix return types in styles.ts
blazejkustra 88bb36f
Merge remote-tracking branch 'origin/main' into ts/style/styles-refactor
fabioh8010 1be0bf5
Minor fixes in styles.ts
fabioh8010 1338157
Add stricter types to styles.ts
fabioh8010 5feb1fe
Isolate some web-only styles
fabioh8010 98e5d4a
Merge remote-tracking branch 'origin/main' into ts/style/styles-refactor
fabioh8010 b223759
Merge remote-tracking branch 'origin/main' into ts/style/styles-refactor
fabioh8010 dc0722d
Merge branch 'main' into ts/style/styles-refactor
fabioh8010 05a58d8
Address review comments
fabioh8010 d60c00d
Improve some StyleUtils functions
fabioh8010 0f44880
Merge branch 'main' into ts/style/styles-refactor
fabioh8010 dfdf05f
Merge branch 'main' into ts/style/styles-refactor
fabioh8010 b9e14d7
Minor fix in theme files
fabioh8010 ad14917
Merge branch 'main' into ts/style/styles-refactor
fabioh8010 e381128
Merge branch 'main' into ts/style/styles-refactor
fabioh8010 bcd1a65
Minor fixes
fabioh8010 6005765
Fix findUnusedKeys to look for the correct styles file
fabioh8010 c0239e2
added a new condition to handle inner function with returning object …
gedu 8ee979d
Merge pull request #1 from gedu/ts/style/styles-refactor
fabioh8010 b4f158e
Merge branch 'main' into ts/style/styles-refactor
fabioh8010 7188a33
Merge branch 'main' into ts/style/styles-refactor
fabioh8010 ce0c277
Merge branch 'main' into ts/style/styles-refactor
fabioh8010 f3fc5a5
Merge branch 'main' into ts/style/styles-refactor
kubabutkiewicz a8d62d0
fix: added proper color to receiptDropUIBG
kubabutkiewicz f4f6501
fix: lint and type errors
kubabutkiewicz a2914cd
fix: use theme colors instead of hardcoded
kubabutkiewicz 76b7336
Merge branch 'main' into ts/style/styles-refactor
kubabutkiewicz 2450338
Merge branch 'main' into ts/style/styles-refactor
kubabutkiewicz 96e9ce7
fix: fix lottie type
kubabutkiewicz 947f024
fix: lint problem
kubabutkiewicz 94bb435
Merge branch 'main' of github.com:fabioh8010/expensify-app into ts/st…
kubabutkiewicz f9ed59f
fix: typo
kubabutkiewicz bfc8c1b
Merge branch 'main' of github.com:fabioh8010/expensify-app into ts/st…
kubabutkiewicz 3477ee7
Merge branch 'main' of github.com:fabioh8010/expensify-app into ts/st…
kubabutkiewicz 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,6 @@ import Log from '../../libs/Log'; | |
import OptionsListSkeletonView from '../OptionsListSkeletonView'; | ||
import useActiveElement from '../../hooks/useActiveElement'; | ||
import BaseListItem from './BaseListItem'; | ||
import themeColors from '../../styles/themes/default'; | ||
import ArrowKeyFocusManager from '../ArrowKeyFocusManager'; | ||
|
||
const propTypes = { | ||
|
@@ -424,7 +423,7 @@ function BaseSelectionList({ | |
onScrollBeginDrag={onScrollBeginDrag} | ||
keyExtractor={(item) => item.keyForList} | ||
extraData={focusedIndex} | ||
indicatorStyle={themeColors.selectionListIndicatorColor} | ||
indicatorStyle="white" | ||
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. why did you hard code the color? |
||
keyboardShouldPersistTaps="always" | ||
showsVerticalScrollIndicator={showScrollIndicator} | ||
initialNumToRender={12} | ||
|
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
Large diffs are not rendered by default.
Oops, something went wrong.
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 {CSSProperties} from 'react'; | ||
import {TextStyle} from 'react-native'; | ||
|
||
type AddOutlineWidth = (obj: TextStyle | CSSProperties, val?: number, error?: boolean) => TextStyle | CSSProperties; | ||
type AddOutlineWidth = (obj: TextStyle, val?: number, hasError?: boolean) => TextStyle; | ||
|
||
export default AddOutlineWidth; |
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 {CSSProperties} from 'react'; | ||
import {ViewStyle} from 'react-native'; | ||
|
||
type GetCardStyles = (screenWidth: number) => Partial<Pick<CSSProperties | ViewStyle, 'position' | 'width' | 'height'>>; | ||
type GetCardStyles = (screenWidth: number) => ViewStyle; | ||
|
||
export default GetCardStyles; |
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,8 +1,7 @@ | ||
import {CSSProperties} from 'react'; | ||
import {TextStyle, ViewStyle} from 'react-native'; | ||
|
||
type CodeWordWrapperStyles = ViewStyle | CSSProperties; | ||
type CodeWordStyles = TextStyle | CSSProperties; | ||
type CodeTextStyles = TextStyle | CSSProperties; | ||
type CodeWordWrapperStyles = ViewStyle; | ||
type CodeWordStyles = TextStyle; | ||
type CodeTextStyles = TextStyle; | ||
|
||
export type {CodeWordWrapperStyles, CodeWordStyles, CodeTextStyles}; | ||
export type {CodeTextStyles, CodeWordStyles, CodeWordWrapperStyles}; |
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,6 @@ | ||
import {StyleProp, ViewStyle} from 'react-native'; | ||
import styles from '../styles'; | ||
import ContainerComposeStyles from './types'; | ||
|
||
const containerComposeStyles: StyleProp<ViewStyle> = [styles.textInputComposeSpacing]; | ||
const containerComposeStyles: ContainerComposeStyles = [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,7 @@ | ||
import {StyleProp, ViewStyle} from 'react-native'; | ||
import styles from '../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: StyleProp<ViewStyle> = [styles.textInputComposeSpacing, {paddingVertical: 0}]; | ||
const containerComposeStyles: ContainerComposeStyles = [styles.textInputComposeSpacing, {paddingVertical: 0}]; | ||
|
||
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import {ViewStyle} from 'react-native'; | ||
|
||
type ContainerComposeStyles = ViewStyle[]; | ||
|
||
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,10 @@ | ||
import EditedLabelStyles from './types'; | ||
import display from '../utilities/display'; | ||
import flex from '../utilities/flex'; | ||
import EditedLabelStyles from './types'; | ||
|
||
const editedLabelStyles: EditedLabelStyles = {...display.dInlineFlex, ...flex.alignItemsBaseline}; | ||
const editedLabelStyles: EditedLabelStyles = { | ||
...display.dInlineFlex, | ||
...flex.alignItemsBaseline, | ||
}; | ||
|
||
export default editedLabelStyles; |
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 {CSSProperties} from 'react'; | ||
import {TextStyle} from 'react-native'; | ||
|
||
type EditedLabelStyles = CSSProperties | TextStyle; | ||
type EditedLabelStyles = TextStyle; | ||
|
||
export default EditedLabelStyles; |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import FontFamilyBoldStyles from './types'; | ||
|
||
const bold: FontFamilyBoldStyles = 'ExpensifyNeue-Bold'; | ||
|
||
export default bold; |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import FontFamilyBoldStyles from './types'; | ||
|
||
const bold: FontFamilyBoldStyles = 'ExpensifyNeue-Regular'; | ||
|
||
export default bold; |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import FontFamilyBoldStyles from './types'; | ||
|
||
const bold: FontFamilyBoldStyles = 'ExpensifyNeue-Regular, Segoe UI Emoji, Noto Color Emoji'; | ||
|
||
export default bold; |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import {TextStyle} from 'react-native'; | ||
|
||
type FontFamilyBoldStyles = NonNullable<TextStyle['fontFamily']>; | ||
|
||
export default FontFamilyBoldStyles; |
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 {CSSProperties} from 'react'; | ||
import {TextStyle} from 'react-native'; | ||
|
||
type FontWeightBoldStyles = (TextStyle | CSSProperties)['fontWeight']; | ||
type FontWeightBoldStyles = NonNullable<TextStyle['fontWeight']>; | ||
|
||
export default FontWeightBoldStyles; |
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
10 changes: 8 additions & 2 deletions
10
...avigationModalCardStyles/index.desktop.js → ...avigationModalCardStyles/index.desktop.ts
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,10 +1,16 @@ | ||
export default () => ({ | ||
import positioning from '../utilities/positioning'; | ||
import GetNavigationModalCardStyles from './types'; | ||
|
||
const getNavigationModalCardStyles: GetNavigationModalCardStyles = () => ({ | ||
hayata-suenaga marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// position: fixed is set instead of position absolute to workaround Safari known issues of updating heights in DOM. | ||
// Safari issues: | ||
// https://github.com/Expensify/App/issues/12005 | ||
// https://github.com/Expensify/App/issues/17824 | ||
// https://github.com/Expensify/App/issues/20709 | ||
width: '100%', | ||
height: '100%', | ||
position: 'fixed', | ||
|
||
...positioning.pFixed, | ||
}); | ||
|
||
export default getNavigationModalCardStyles; |
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,3 +1,7 @@ | ||
export default () => ({ | ||
import GetNavigationModalCardStyles from './types'; | ||
|
||
const getNavigationModalCardStyles: GetNavigationModalCardStyles = () => ({ | ||
height: '100%', | ||
}); | ||
|
||
export default getNavigationModalCardStyles; |
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,9 +1,7 @@ | ||
import {CSSProperties} from 'react'; | ||
import {ViewStyle} from 'react-native'; | ||
import {Merge} from 'type-fest'; | ||
|
||
type GetNavigationModalCardStylesParams = {isSmallScreenWidth: number}; | ||
|
||
type GetNavigationModalCardStyles = (params: GetNavigationModalCardStylesParams) => Merge<ViewStyle, Pick<CSSProperties, 'position'>>; | ||
type GetNavigationModalCardStyles = (params: GetNavigationModalCardStylesParams) => ViewStyle; | ||
|
||
export default GetNavigationModalCardStyles; |
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
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.
do you know what is the purpose of this file?
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.
What I understand its a script used in gh action for removing unused styles