From f889d63dea398edaa2b3ee454c0e9af8cc3fea6a Mon Sep 17 00:00:00 2001 From: Bartosz Grajdek Date: Thu, 24 Aug 2023 15:21:47 +0200 Subject: [PATCH 1/2] [TS migration] Migrate 'italic' style to TypeScript --- src/styles/italic/index.android.js | 3 --- src/styles/italic/index.android.ts | 5 +++++ src/styles/italic/index.js | 3 --- src/styles/italic/index.ts | 5 +++++ src/styles/italic/types.ts | 3 +++ 5 files changed, 13 insertions(+), 6 deletions(-) delete mode 100644 src/styles/italic/index.android.js create mode 100644 src/styles/italic/index.android.ts delete mode 100644 src/styles/italic/index.js create mode 100644 src/styles/italic/index.ts create mode 100644 src/styles/italic/types.ts diff --git a/src/styles/italic/index.android.js b/src/styles/italic/index.android.js deleted file mode 100644 index 92f6d65241bb..000000000000 --- a/src/styles/italic/index.android.js +++ /dev/null @@ -1,3 +0,0 @@ -const italic = 'normal'; - -export default italic; diff --git a/src/styles/italic/index.android.ts b/src/styles/italic/index.android.ts new file mode 100644 index 000000000000..bbd9deb8cf8d --- /dev/null +++ b/src/styles/italic/index.android.ts @@ -0,0 +1,5 @@ +import ItalicStyles from './types'; + +const italic: ItalicStyles = 'normal'; + +export default italic; diff --git a/src/styles/italic/index.js b/src/styles/italic/index.js deleted file mode 100644 index 8e8433c7cc05..000000000000 --- a/src/styles/italic/index.js +++ /dev/null @@ -1,3 +0,0 @@ -const italic = 'italic'; - -export default italic; diff --git a/src/styles/italic/index.ts b/src/styles/italic/index.ts new file mode 100644 index 000000000000..02d6c46423f6 --- /dev/null +++ b/src/styles/italic/index.ts @@ -0,0 +1,5 @@ +import ItalicStyles from './types'; + +const italic: ItalicStyles = 'italic'; + +export default italic; diff --git a/src/styles/italic/types.ts b/src/styles/italic/types.ts new file mode 100644 index 000000000000..834a78db0fc8 --- /dev/null +++ b/src/styles/italic/types.ts @@ -0,0 +1,3 @@ +type ItalicStyles = 'normal' | 'italic'; + +export default ItalicStyles; From 91571eaad89ec30e65e2cf55be022980ab0d465d Mon Sep 17 00:00:00 2001 From: Bartosz Grajdek Date: Thu, 24 Aug 2023 16:17:20 +0200 Subject: [PATCH 2/2] Support for native & web styles --- src/styles/italic/types.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/styles/italic/types.ts b/src/styles/italic/types.ts index 834a78db0fc8..61e0328e52b6 100644 --- a/src/styles/italic/types.ts +++ b/src/styles/italic/types.ts @@ -1,3 +1,6 @@ -type ItalicStyles = 'normal' | 'italic'; +import {CSSProperties} from 'react'; +import {TextStyle} from 'react-native'; + +type ItalicStyles = (TextStyle | CSSProperties)['fontStyle']; export default ItalicStyles;