Skip to content

Commit

Permalink
refactor: remove replicas (#358)
Browse files Browse the repository at this point in the history
## 📜 Description

Removed replicas from the package.

## 💡 Motivation and Context

Initially when I started to work on this package I thought to add
replicas for iOS or Android if I can not derive values from a native
code. Turned out I can actually derive them, so replicas are kind of not
useful anymore.

These methods were not documented anywhere, but I see that people are
constantly trying to find these methods in documentation:

<img width="577" alt="image"
src="https://github.com/kirillzyusko/react-native-keyboard-controller/assets/22820318/1ad9b20a-2d33-40cf-9db3-5e5094826e93">

Since these methods were never a part of official API of this library -
I'm removing them 😎

Also this change can be considered as optimization, because I'm removing
code and thus reduce size of the package.

## 📢 Changelog

<!-- High level overview of important changes -->
<!-- For example: fixed status bar manipulation; added new types
declarations; -->
<!-- If your changes don't affect one of platform/language below - then
remove this platform/language -->

### JS

- removed `replicas`

## 🤔 How Has This Been Tested?

Tested manually on iPhone 15 Pro and Pixel 2.

## 📝 Checklist

- [x] CI successfully passed
- [x] I added new mocks and corresponding unit-tests if library API was
changed
  • Loading branch information
kirillzyusko committed Feb 13, 2024
1 parent 490b712 commit 7d2d0a2
Show file tree
Hide file tree
Showing 16 changed files with 2 additions and 183 deletions.
15 changes: 1 addition & 14 deletions FabricExample/src/components/KeyboardAnimation/index.tsx
@@ -1,15 +1,11 @@
import React from "react";
import { Animated, TextInput, View } from "react-native";
import {
useKeyboardAnimation,
useKeyboardAnimationReplica,
} from "react-native-keyboard-controller";
import { useKeyboardAnimation } from "react-native-keyboard-controller";

import styles from "./styles";

export default function KeyboardAnimation() {
const { height, progress } = useKeyboardAnimation();
const { height: heightReplica } = useKeyboardAnimationReplica();

return (
<View style={styles.container}>
Expand Down Expand Up @@ -51,15 +47,6 @@ export default function KeyboardAnimation() {
transform: [{ translateY: height }],
}}
/>
<Animated.View
style={{
width: 50,
height: 50,
backgroundColor: "blue",
borderRadius: 25,
transform: [{ translateY: heightReplica }],
}}
/>
</View>
</View>
</View>
Expand Down
Binary file modified e2e/kit/assets/android/e2e_emulator/DisabledKeyboardIsHidden.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/kit/assets/android/e2e_emulator/DisabledKeyboardIsShown.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/kit/assets/android/e2e_emulator/EnabledKeyboardIsHidden.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/kit/assets/android/e2e_emulator/EnabledKeyboardIsShown.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/kit/assets/ios/iPhone 15 Pro/DisabledKeyboardIsHidden.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/kit/assets/ios/iPhone 15 Pro/DisabledKeyboardIsShown.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/kit/assets/ios/iPhone 15 Pro/EnabledKeyboardIsHidden.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/kit/assets/ios/iPhone 15 Pro/EnabledKeyboardIsShown.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 1 addition & 14 deletions example/src/components/KeyboardAnimation/index.tsx
@@ -1,15 +1,11 @@
import React from "react";
import { Animated, TextInput, View } from "react-native";
import {
useKeyboardAnimation,
useKeyboardAnimationReplica,
} from "react-native-keyboard-controller";
import { useKeyboardAnimation } from "react-native-keyboard-controller";

import styles from "./styles";

export default function KeyboardAnimation() {
const { height, progress } = useKeyboardAnimation();
const { height: heightReplica } = useKeyboardAnimationReplica();

return (
<View style={styles.container}>
Expand Down Expand Up @@ -51,15 +47,6 @@ export default function KeyboardAnimation() {
transform: [{ translateY: height }],
}}
/>
<Animated.View
style={{
width: 50,
height: 50,
backgroundColor: "blue",
borderRadius: 25,
transform: [{ translateY: heightReplica }],
}}
/>
</View>
</View>
</View>
Expand Down
1 change: 0 additions & 1 deletion src/index.ts
@@ -1,6 +1,5 @@
export * from "./bindings";
export * from "./animated";
export * from "./replicas";
export * from "./context";
export * from "./hooks";
export * from "./constants";
Expand Down
154 changes: 0 additions & 154 deletions src/replicas.ts

This file was deleted.

0 comments on commit 7d2d0a2

Please sign in to comment.