Skip to content

Commit

Permalink
fix: removed unnecessary files and migrate setShouldShowComposeInputK…
Browse files Browse the repository at this point in the history
…eyboardAware to TS
  • Loading branch information
kubabutkiewicz committed Sep 22, 2023
1 parent 15fcc55 commit 7d66a6b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 20 deletions.

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions src/libs/setShouldShowComposeInputKeyboardAware/index.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import {Keyboard} from 'react-native';
import {EmitterSubscription, Keyboard} from 'react-native';
import * as Composer from '../actions/Composer';
import SetShouldShowComposeInputKeyboardAware from './types';

let keyboardDidHideListener = null;
export default (shouldShow) => {
let keyboardDidHideListener: EmitterSubscription | null = null;
const setShouldShowComposeInputKeyboardAware: SetShouldShowComposeInputKeyboardAware = (shouldShow) => {
if (keyboardDidHideListener) {
keyboardDidHideListener.remove();
keyboardDidHideListener = null;
Expand All @@ -21,6 +22,8 @@ export default (shouldShow) => {

keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', () => {
Composer.setShouldShowComposeInput(true);
keyboardDidHideListener.remove();
keyboardDidHideListener?.remove();
});
};

export default setShouldShowComposeInputKeyboardAware;
8 changes: 8 additions & 0 deletions src/libs/setShouldShowComposeInputKeyboardAware/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import * as Composer from '../actions/Composer';
import SetShouldShowComposeInputKeyboardAware from './types';

const setShouldShowComposeInputKeyboardAware: SetShouldShowComposeInputKeyboardAware = (shouldShow) => {
Composer.setShouldShowComposeInput(shouldShow);
};

export default setShouldShowComposeInputKeyboardAware;
3 changes: 3 additions & 0 deletions src/libs/setShouldShowComposeInputKeyboardAware/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type SetShouldShowComposeInputKeyboardAware = (shouldShow: boolean) => void;

export default SetShouldShowComposeInputKeyboardAware;

0 comments on commit 7d66a6b

Please sign in to comment.