-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27660 from fabioh8010/ts/style/styles-refactor
[No QA] [TS migration] Review and clean up Styles files
- Loading branch information
Showing
57 changed files
with
4,674 additions
and
4,180 deletions.
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
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,6 @@ | ||
import FontFamilyBoldStyles from './types'; | ||
|
||
const singleBold: FontFamilyBoldStyles = 'ExpensifyNeue-Bold'; | ||
const multiBold: FontFamilyBoldStyles = 'ExpensifyNeue-Bold'; | ||
|
||
export {singleBold, multiBold}; |
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,6 @@ | ||
import FontFamilyBoldStyles from './types'; | ||
|
||
const singleBold: FontFamilyBoldStyles = 'ExpensifyNeue-Regular'; | ||
const multiBold: FontFamilyBoldStyles = 'ExpensifyNeue-Regular'; | ||
|
||
export {singleBold, multiBold}; |
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,6 @@ | ||
import FontFamilyBoldStyles from './types'; | ||
|
||
const singleBold: FontFamilyBoldStyles = 'ExpensifyNeue-Regular'; | ||
const multiBold: FontFamilyBoldStyles = 'ExpensifyNeue-Regular, Segoe UI Emoji, Noto Color Emoji'; | ||
|
||
export {singleBold, multiBold}; |
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 = () => ({ | ||
// 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.