Skip to content

Commit

Permalink
feat: add emoji hook for text editor
Browse files Browse the repository at this point in the history
  • Loading branch information
numandev1 committed Sep 23, 2021
1 parent c399388 commit 9fc1687
Show file tree
Hide file tree
Showing 11 changed files with 25,480 additions and 26 deletions.
52 changes: 48 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# react-native-emoji-hook
<!-- Title -->
<p align="center">
<img src="/assets/icon.png" alt="alt text" width="300"/>
</p>

write emoji by emoji code
<!-- Header -->

<p align="center">
<b>Write emoji by emoji code</b>
<br />
</p>

<p align="center">
<img height="450" src="/assets/cover.jpg">
</p>

## Installation

Expand All @@ -11,11 +23,43 @@ npm install react-native-emoji-hook
## Usage

```js
import EmojiHook from "react-native-emoji-hook";
import useEmoji from 'react-native-emoji-hook';

// ...

const result = await EmojiHook.multiply(3, 7);
const [text, setText] = useEmoji();
```

## Example Code

```
import * as React from 'react';
import { StyleSheet, View, TextInput } from 'react-native';
import useEmoji from 'react-native-emoji-hook';
export default function App() {
const [text, setText] = useEmoji();
return (
<View style={styles.container}>
<TextInput style={styles.input} value={text} onChangeText={setText} />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
input: {
width: '100%',
height: 100,
backgroundColor: 'gray',
fontSize: 30,
},
});
```

## Contributing
Expand Down
Binary file added assets/cover.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@
"react-native-web": "~0.14.9"
},
"devDependencies": {
"@babel/core": "~7.12.10",
"@babel/core": "^7.15.5",
"@babel/preset-env": "^7.15.6",
"@babel/runtime": "^7.9.6",
"babel-loader": "^8.2.2",
"babel-plugin-module-resolver": "^4.0.0",
"babel-preset-expo": "8.3.0",
"expo-cli": "^4.0.13"
"expo-cli": "^4.0.13",
"webpack": "^5.53.0"
}
}
22 changes: 9 additions & 13 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
import * as React from 'react';

import { StyleSheet, View, Text } from 'react-native';
import EmojiHook from 'react-native-emoji-hook';
import { StyleSheet, View, TextInput } from 'react-native';
import useEmoji from 'react-native-emoji-hook';

export default function App() {
const [result, setResult] = React.useState<number | undefined>();

React.useEffect(() => {
EmojiHook.multiply(3, 7).then(setResult);
}, []);

const [text, setText] = useEmoji();
return (
<View style={styles.container}>
<Text>Result: {result}</Text>
<TextInput style={styles.input} value={text} onChangeText={setText} />
</View>
);
}
Expand All @@ -23,9 +18,10 @@ const styles = StyleSheet.create({
alignItems: 'center',
justifyContent: 'center',
},
box: {
width: 60,
height: 60,
marginVertical: 20,
input: {
width: '100%',
height: 100,
backgroundColor: 'gray',
fontSize: 30,
},
});
Loading

0 comments on commit 9fc1687

Please sign in to comment.