From ceca5188874c5c97c1b3f21aa50df101419f3f2f Mon Sep 17 00:00:00 2001 From: Yauheni Pasiukevich Date: Thu, 24 Aug 2023 16:57:44 +0200 Subject: [PATCH 1/2] migrate 'getPopOverVerticalOffset' style to ts --- .../{index.desktop.js => index.desktop.ts} | 11 +++++------ src/styles/getPopOverVerticalOffset/index.js | 1 - src/styles/getPopOverVerticalOffset/index.ts | 5 +++++ src/styles/getPopOverVerticalOffset/types.ts | 5 +++++ 4 files changed, 15 insertions(+), 7 deletions(-) rename src/styles/getPopOverVerticalOffset/{index.desktop.js => index.desktop.ts} (51%) delete mode 100644 src/styles/getPopOverVerticalOffset/index.js create mode 100644 src/styles/getPopOverVerticalOffset/index.ts create mode 100644 src/styles/getPopOverVerticalOffset/types.ts diff --git a/src/styles/getPopOverVerticalOffset/index.desktop.js b/src/styles/getPopOverVerticalOffset/index.desktop.ts similarity index 51% rename from src/styles/getPopOverVerticalOffset/index.desktop.js rename to src/styles/getPopOverVerticalOffset/index.desktop.ts index bd58266d0bd0..5572bf535357 100644 --- a/src/styles/getPopOverVerticalOffset/index.desktop.js +++ b/src/styles/getPopOverVerticalOffset/index.desktop.ts @@ -1,13 +1,12 @@ import CONST from '../../CONST'; +import GetPopOverVerticalOffset from './types'; -/** - * Adds the header padding with vertical offset on desktop - * @param {Number} vertical - * @returns {Object} - */ -export default (vertical) => ({ +// Adds the header padding with vertical offset on desktop +const getPopOverVerticalOffset: GetPopOverVerticalOffset = (vertical) => ({ // We add CONST.DESKTOP_HEADER_GAP on desktop which we // need to add to vertical offset to have proper vertical // offset on desktop vertical: vertical + CONST.DESKTOP_HEADER_PADDING, }); + +export default getPopOverVerticalOffset; diff --git a/src/styles/getPopOverVerticalOffset/index.js b/src/styles/getPopOverVerticalOffset/index.js deleted file mode 100644 index 2e7c4fbc07ff..000000000000 --- a/src/styles/getPopOverVerticalOffset/index.js +++ /dev/null @@ -1 +0,0 @@ -export default (vertical) => ({vertical}); diff --git a/src/styles/getPopOverVerticalOffset/index.ts b/src/styles/getPopOverVerticalOffset/index.ts new file mode 100644 index 000000000000..854653766cd2 --- /dev/null +++ b/src/styles/getPopOverVerticalOffset/index.ts @@ -0,0 +1,5 @@ +import GetPopOverVerticalOffset from './types'; + +const getPopOverVerticalOffset: GetPopOverVerticalOffset = (vertical: number) => ({vertical}); + +export default getPopOverVerticalOffset; diff --git a/src/styles/getPopOverVerticalOffset/types.ts b/src/styles/getPopOverVerticalOffset/types.ts new file mode 100644 index 000000000000..ba8b322faf26 --- /dev/null +++ b/src/styles/getPopOverVerticalOffset/types.ts @@ -0,0 +1,5 @@ +type GetPopOverVerticalOffset = (vertical: number) => { + vertical: number; +}; + +export default GetPopOverVerticalOffset; From dec8f403fd866701c1408fccb2c7289ec6d2f7da Mon Sep 17 00:00:00 2001 From: Yauheni Pasiukevich Date: Mon, 28 Aug 2023 15:35:56 +0200 Subject: [PATCH 2/2] fix comment for getPopOverVerticalOffset --- src/styles/getPopOverVerticalOffset/index.desktop.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/styles/getPopOverVerticalOffset/index.desktop.ts b/src/styles/getPopOverVerticalOffset/index.desktop.ts index 5572bf535357..d7c02f95b169 100644 --- a/src/styles/getPopOverVerticalOffset/index.desktop.ts +++ b/src/styles/getPopOverVerticalOffset/index.desktop.ts @@ -1,7 +1,7 @@ import CONST from '../../CONST'; import GetPopOverVerticalOffset from './types'; -// Adds the header padding with vertical offset on desktop +/** Adds the header padding with vertical offset on desktop */ const getPopOverVerticalOffset: GetPopOverVerticalOffset = (vertical) => ({ // We add CONST.DESKTOP_HEADER_GAP on desktop which we // need to add to vertical offset to have proper vertical