add readme, update info
This commit is contained in:
@@ -0,0 +1,33 @@
|
|||||||
|
# Expo Selectable Text
|
||||||
|
|
||||||
|
This module creates a wrapper `<SelectableText>` for React Native's `<Text>` component. Text components are
|
||||||
|
parsed and rendered using UITextView instead of UILabel, allowing for text selection.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
In most cases, you can simply use like so:
|
||||||
|
|
||||||
|
```tsx
|
||||||
|
<SelectableText selectable style={{color: '#000000', fontSize: 20}}>
|
||||||
|
Here is some text.
|
||||||
|
</SelectableText>
|
||||||
|
```
|
||||||
|
|
||||||
|
You may also have nested `<Text>` components inside the `<SelectableText>` block. For example:
|
||||||
|
```tsx
|
||||||
|
<SelectableText selectable style={{color: '#000000', fontSize: 20}}>
|
||||||
|
Here is some text. <Text style={{color: 'lightblue'}} onPress={() => {Alert.alert('Press!')}}>And this is a link.</Text>
|
||||||
|
</SelectableText>
|
||||||
|
```
|
||||||
|
|
||||||
|
Note that nested components should always use `<Text>` and not `<SelectableText>`. Only the outermost `<Text>` should
|
||||||
|
be replaced with `<SelectableText>`.
|
||||||
|
|
||||||
|
Like `<Text>` styles given to `<SelectableText>` will be passed to each child `<Text>` component unless specified in the
|
||||||
|
child's style. All the base [React Native Text styles](https://reactnative.dev/docs/text-style-props) are supported
|
||||||
|
(with the same iOS limitations, of course).
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
Using inside of this project should not require any installation. The podfile should automatically find and locate the
|
||||||
|
podspec inside of this directory.
|
||||||
@@ -1,9 +1,6 @@
|
|||||||
{
|
{
|
||||||
"platforms": ["ios", "android", "web"],
|
"platforms": ["ios"],
|
||||||
"ios": {
|
"ios": {
|
||||||
"modules": ["ExpoSelectableTextModule"]
|
"modules": ["ExpoSelectableTextModule"]
|
||||||
},
|
|
||||||
"android": {
|
|
||||||
"modules": ["expo.modules.selectabletext.ExpoSelectableTextModule"]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
Pod::Spec.new do |s|
|
Pod::Spec.new do |s|
|
||||||
s.name = 'ExpoSelectableText'
|
s.name = 'ExpoSelectableText'
|
||||||
s.version = '1.0.0'
|
s.version = '1.0.0'
|
||||||
s.summary = 'A sample project summary'
|
s.summary = 'Simple wrapper for RN Text to use UITextView instead of UILabel'
|
||||||
s.description = 'A sample project description'
|
s.description = 'Simple wrapper for RN Text to use UITextView instead of UILabel'
|
||||||
s.author = ''
|
s.author = ''
|
||||||
s.homepage = 'https://docs.expo.dev/modules/'
|
s.homepage = 'https://github.com/bluesky-social/social-app/modules/expo-selectable-text'
|
||||||
s.platform = :ios, '13.0'
|
s.platform = :ios, '13.0'
|
||||||
s.source = { git: '' }
|
s.source = { git: '' }
|
||||||
s.static_framework = true
|
s.static_framework = true
|
||||||
|
|||||||
Reference in New Issue
Block a user