Skip to content

Commit 57c73f1

Browse files
authored
Merge pull request #1 from iyegoroff/master
Merge pull request #1 from iyegoroff/master
2 parents 12fef0f + 4c29e8e commit 57c73f1

File tree

86 files changed

+11027
-7540
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+11027
-7540
lines changed

README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ React-Native text gradient component for iOS & Android.
2323
2424
## Status
2525

26-
- iOS - component works as drop-in replacement for standard `Text` component, e.g. it is possible to have nested gradients;
27-
- Android - currently only basic 'wrapper'-like behavior without nesting is supported, [WIP](https://github.com/iyegoroff/react-native-text-gradient/tree/android-nested-gradient);
26+
- Component works as drop-in replacement for standard `Text` component and it is possible to have nested gradients.
2827
- React-Native:
2928
- with rn >= 0.56.0 use latest version and [patch](#usage-with-rn--0560);
3029
- with rn >= 0.55.0 use 0.0.9;
@@ -114,9 +113,3 @@ When mixing several text gradients and `Text`s top component always should be te
114113
```
115114

116115
This is necessary because only top text component is 'mapped' to actual native node and its children are 'virtual' from the native perspective.
117-
118-
## FAQ
119-
120-
#### Is it ready for production?
121-
122-
- Yes, I use it in production
File renamed without changes.

example/.flowconfig renamed to TextGradientExample/.flowconfig

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@
2424
[libs]
2525
node_modules/react-native/Libraries/react-native/react-native-interface.js
2626
node_modules/react-native/flow/
27-
node_modules/react-native/flow-github/
2827

2928
[options]
3029
emoji=true
3130

31+
esproposal.optional_chaining=enable
32+
esproposal.nullish_coalescing=enable
33+
3234
module.system=haste
3335
module.system.haste.use_name_reducers=true
3436
# get basename
@@ -64,4 +66,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
6466
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
6567

6668
[version]
67-
^0.75.0
69+
^0.92.0
File renamed without changes.
File renamed without changes.
File renamed without changes.

example/App.js renamed to TextGradientExample/App.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import React, {Component} from 'react';
1010
import {Platform, StyleSheet, Text, View} from 'react-native';
11-
import {LinearTextGradient} from 'react-native-text-gradient';
11+
import {LinearTextGradient} from 'react-native-text-gradient'
1212

1313
const instructions = Platform.select({
1414
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
@@ -17,19 +17,23 @@ const instructions = Platform.select({
1717
'Shake or press menu button for dev menu',
1818
});
1919

20-
export default class App extends Component {
20+
type Props = {};
21+
export default class App extends Component<Props> {
2122
render() {
2223
return (
2324
<View style={styles.container}>
2425
<LinearTextGradient
2526
style={styles.welcome}
2627
locations={[0, 1]}
27-
colors={['red', 'blue']}
28+
colors={['blue', 'red']}
2829
start={{ x: 0, y: 0 }}
2930
end={{ x: 1, y: 0 }}
31+
// useViewFrame={true}
3032
>
3133
Welcome to React Native!
3234
</LinearTextGradient>
35+
<Text style={styles.instructions}>To get started, edit App.js</Text>
36+
<Text style={styles.instructions}>{instructions}</Text>
3337
</View>
3438
);
3539
}
@@ -44,7 +48,14 @@ const styles = StyleSheet.create({
4448
},
4549
welcome: {
4650
fontSize: 20,
47-
textAlign: 'center',
51+
// width: '100%',
52+
// textAlign: 'right',
53+
// backgroundColor: 'lightgray',
4854
margin: 10,
49-
}
55+
},
56+
instructions: {
57+
textAlign: 'center',
58+
color: '#333333',
59+
marginBottom: 5,
60+
},
5061
});

example/Dockerfile renamed to TextGradientExample/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM iyegoroff/fable-android:1
22

33
RUN mkdir /package
44
COPY . /package
5-
WORKDIR /package/example
5+
WORKDIR /package/TextGradientExample
66

77
RUN npm i --unsafe-perm
88
RUN npm run generate:android:bundle

TextGradientExample/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
### Run debug version
2+
- Go to example folder `cd react-native-text-gradient/TextGradientExample`
3+
- Run `npm i && npm run run:android`
4+
5+
### Build signed release apk with Docker
6+
- Go to TextGradientExample folder `cd react-native-text-gradient/TextGradientExample`
7+
- Generate keystore `npm run generate:android:signing-key`
8+
- Open `TextGradientExample/android/gradle.properties` file and replace `qwerty`s with your passwords
9+
- Run `npm run build:release:docker` - upon script completion apk will be copied to `TextGradientExample/text-gradient.apk` file
File renamed without changes.

0 commit comments

Comments
 (0)