Skip to content

Commit

Permalink
docs: docs edit
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin committed Nov 7, 2023
1 parent d9d2fb9 commit 5907987
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# React Native Text Highlighter
# React Native Text Touch Highlighter

React Native Text Highlighter is a versatile and user-friendly component that allows you to implement text highlighting and selection functionality in your React Native applications. This package simplifies the integration of text selection and annotation features, making it an ideal solution for mobile apps that require text manipulation or document annotation.
React Native Text Touch Highlighter is a versatile and user-friendly component that allows you to implement text highlighting and selection functionality in your React Native applications. This package simplifies the integration of text selection and annotation features, making it an ideal solution for mobile apps that require text manipulation or document annotation.

<p align="center">
<img src="src/assets/example.gif" alt="example" height="300" width="380"/>
Expand Down
19 changes: 13 additions & 6 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';

import { StyleSheet, View } from 'react-native';
import { Button, StyleSheet, View } from 'react-native';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { HighlightText } from 'rn-text-touch-highlight';

Expand All @@ -11,21 +11,28 @@ export default function App() {
const data = highlightRef.current?.getHighlightedData();
console.log(data);
};
const deleteFun = (id) => {
const deleteFun = (id: number) => {
highlightRef.current?.deleteHighlight(id);
};

return (
<GestureHandlerRootView style={{ flex: 1 }}>

Check warning on line 19 in example/src/App.tsx

View workflow job for this annotation

GitHub Actions / lint

Inline style: { flex: 1 }
<Button title="Get highlight data" onPress={getHighlightData} />
<Button
title="Delete highlight"
onPress={() => {
deleteFun(1);
}}
/>
<View style={styles.container}>
<HighlightText
ref={highlightRef}
clearHighlightOnTap={true}
highlightInitialDelay={500}
// initialHighlightData={[
// { end: 24, start: 10 },
// { end: 40, start: 30 },
// ]}
initialHighlightData={[
{ end: 24, start: 10 },
{ end: 40, start: 30 },
]}
lineSpace={5}
lineBreakHeight={5}
textColor={'black'}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "rn-text-touch-highlight",
"version": "0.1.0",
"description": "React Native Text Highlighter is a versatile and user-friendly component that allows you to implement text highlighting and selection functionality in your React Native applications",
"description": "React Native Text Touch Highlighter is a versatile and user-friendly component that allows you to implement text highlighting and selection functionality in your React Native applications",
"main": "lib/commonjs/index",
"module": "lib/module/index",
"types": "lib/typescript/src/index.d.ts",
Expand Down

0 comments on commit 5907987

Please sign in to comment.