Skip to content

Commit

Permalink
Merge pull request #26162 from software-mansion-labs/ts-migration/get…
Browse files Browse the repository at this point in the history
…-window-height-adjustment

[No QA] [TS migration] Migrate 'getWindowHeightAdjustment' lib to TypeScript
  • Loading branch information
arosiclair authored Aug 31, 2023
2 parents e168aeb + e1e67ae commit aae355b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
4 changes: 0 additions & 4 deletions src/libs/getWindowHeightAdjustment/index.android.js

This file was deleted.

6 changes: 6 additions & 0 deletions src/libs/getWindowHeightAdjustment/index.android.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import GetWindowHeightAdjustment from './types';

// On Android the window height does not include the status bar height, so we need to add it manually.
const getWindowHeightAdjustment: GetWindowHeightAdjustment = (insets) => insets?.top ?? 0;

export default getWindowHeightAdjustment;
4 changes: 0 additions & 4 deletions src/libs/getWindowHeightAdjustment/index.js

This file was deleted.

6 changes: 6 additions & 0 deletions src/libs/getWindowHeightAdjustment/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import GetWindowHeightAdjustment from './types';

// Some platforms need to adjust the window height.
const getWindowHeightAdjustment: GetWindowHeightAdjustment = () => 0;

export default getWindowHeightAdjustment;
5 changes: 5 additions & 0 deletions src/libs/getWindowHeightAdjustment/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import {EdgeInsets} from 'react-native-safe-area-context';

type GetWindowHeightAdjustment = (insets: EdgeInsets | null) => number;

export default GetWindowHeightAdjustment;

0 comments on commit aae355b

Please sign in to comment.