Skip to content

Commit 71e771a

Browse files
committed
Merge branch 'master' into release
2 parents eb67794 + 68471e8 commit 71e771a

Some content is hidden

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

74 files changed

+703
-415
lines changed

.github/ISSUE_TEMPLATE/bug-report.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,42 @@ assignees: ''
77

88
---
99

10-
**Describe the bug**
10+
### Describe the bug
11+
<!--
1112
A clear and concise description of what the bug is.
13+
-->
1214

13-
**To Reproduce**
15+
### To Reproduce
16+
<!--
1417
Steps to reproduce the behavior:
1518
1. Go to '...'
1619
2. Click on '....'
1720
3. Scroll down to '....'
1821
4. See error
22+
-->
1923

20-
**Expected behavior**
24+
### Expected behavior
25+
<!--
2126
A clear and concise description of what you expected to happen.
27+
-->
2228

23-
**Code snippet**
29+
### Code snippet
30+
<!--
2431
A code snippet that reproduce the issue.
32+
-->
2533

26-
**Screenshots**
34+
### Screenshots
35+
<!--
2736
If applicable, add screenshots to help explain your problem.
37+
-->
2838

29-
**Device (please complete the following information):**
39+
### Device (please complete the following information)
40+
<!--
3041
- Device: [e.g. iPhone6]
3142
- OS: [e.g. iOS8.1]
43+
-->
3244

33-
**Additional context**
45+
### Additional context
46+
<!--
3447
Add any other context about the problem here.
48+
-->

.github/ISSUE_TEMPLATE/docs-issue.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@ assignees: ''
77

88
---
99

10-
**Describe the bug**
10+
### Describe the bug
11+
<!--
1112
A clear and concise description of what the issue with the docs is.
13+
-->
1214

13-
**Component?**
15+
### Component?
16+
<!--
1417
Are there missing docs for a component? Which component?
18+
-->
1519

16-
**Is there a general issue with the docs site?**
20+
### Is there a general issue with the docs site?
1721

18-
**Is there an issue with the Expo snack app?**
22+
### Is there an issue with the Expo snack app?

.github/ISSUE_TEMPLATE/feature-request.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,17 @@ assignees: ''
77

88
---
99

10-
**Which component?**
10+
### Which component?
11+
<!--
12+
Which component is the feature is for?
13+
-->
1114

12-
**What is the new feature?**
15+
### What is the new feature?
16+
<!--
1317
A clear and concise description of what the required feature
18+
-->
1419

15-
**Code snippet**
20+
### Code snippet
21+
<!--
1622
How you would have use this feature? How the API will look like?
23+
-->

.github/ISSUE_TEMPLATE/question.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ assignees: ''
77

88
---
99

10-
## Ask us any question
10+
### Ask us any question
1111

1212
<!--
1313
Having trouble with using RNUILIB? Curious about a feature? Wondering about are future plans?

.github/ISSUE_TEMPLATE/typescript-issue.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ assignees: ''
77

88
---
99

10-
**Component**
10+
### Component
11+
<!--
1112
Which component has a missing or invalid typings?
13+
-->
1214

13-
**What's the issue?**
15+
### What's the issue?
16+
<!--
17+
Add relevant details
18+
-->

demo/src/screens/MenuStructure.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ export const navigationData = {
149149
title: 'Incubator (Experimental)',
150150
screens: [
151151
{title: 'Native TouchableOpacity', tags: 'touchable native', screen: 'unicorn.incubator.TouchableOpacityScreen'},
152-
{title: '(New) TextField', tags: 'text field input', screen: 'unicorn.components.IncubatorTextFieldScreen'}
152+
{title: '(New) TextField', tags: 'text field input', screen: 'unicorn.components.IncubatorTextFieldScreen'},
153+
{title: 'WheelPicker (Incubator)', tags: 'wheel picker spinner experimental', screen: 'unicorn.incubator.WheelPickerScreen'}
153154
]
154155
},
155156
Inspirations: {
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import React, {useCallback} from 'react';
2+
import {View, Text, Incubator, Colors, Typography} from 'react-native-ui-lib';
3+
import _ from 'lodash';
4+
import {ItemProps} from 'src/incubator/WheelPicker/Item';
5+
6+
// Months
7+
const months = [
8+
'January',
9+
'February',
10+
'March',
11+
'April',
12+
'May',
13+
'June',
14+
'July',
15+
'August',
16+
'September',
17+
'October',
18+
'November',
19+
'December'
20+
];
21+
22+
// Years
23+
const years = _.times(2020, i => i);
24+
25+
export default () => {
26+
27+
const onChange = useCallback((index: number, item?: ItemProps) => {
28+
console.log(item, index);
29+
}, []);
30+
31+
return (
32+
<View flex padding-page>
33+
<Text h1>Wheel Picker</Text>
34+
<View flex centerV centerH paddingT-page>
35+
<Text h3>Months</Text>
36+
<Incubator.WheelPicker
37+
onChange={onChange}
38+
activeTextColor={Colors.primary}
39+
inactiveTextColor={Colors.grey20}
40+
items={_.map(months, i => ({text: i, value: i}))}
41+
textStyle={{...Typography.text60R}}
42+
/>
43+
44+
<Text h3 marginT-s5>Years</Text>
45+
<Incubator.WheelPicker onChange={onChange} items={_.map(years, i => ({text: '' + i, value: i}))} />
46+
</View>
47+
</View>
48+
);
49+
};

demo/src/screens/incubatorScreens/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@ import {gestureHandlerRootHOC} from 'react-native-gesture-handler';
22

33
export function registerScreens(registrar) {
44
registrar('unicorn.incubator.TouchableOpacityScreen', () =>
5-
gestureHandlerRootHOC(require('./TouchableOpacityScreen').default));
5+
gestureHandlerRootHOC(require('./TouchableOpacityScreen').default)
6+
);
7+
registrar('unicorn.incubator.WheelPickerScreen', () =>
8+
gestureHandlerRootHOC(require('./WheelPickerScreen').default)
9+
);
610
}

eslint-rules/lib/rules/no-direct-import.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ module.exports = {
3131
try {
3232
const origin = context.options[0].origin;
3333
const destination = context.options[0].destination;
34-
const msg = `Do not import directly from '${origin}'. Please use '${destination}' (autofix available).`;
34+
const message = `Do not import directly from '${origin}'. Please use '${destination}' (autofix available).`;
3535
context.report({
3636
node,
37-
message: `${msg}`,
37+
message,
3838
fix(fixer) {
3939
if (node && destination) {
4040
return fixer.replaceText(node.source, `'${destination}'`);
@@ -46,7 +46,7 @@ module.exports = {
4646
}
4747
}
4848

49-
function checkImportDeclaretion(node) {
49+
function checkImportDeclaration(node) {
5050
const origin = context.options[0].origin;
5151
const source = node.source.value;
5252
if (source && origin && source === origin) {
@@ -55,7 +55,7 @@ module.exports = {
5555
}
5656

5757
return {
58-
ImportDeclaration: node => checkImportDeclaretion(node),
58+
ImportDeclaration: checkImportDeclaration
5959
};
6060
},
6161
};

eslint-rules/tests/lib/rules/no-direct-import.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,21 @@ RuleTester.setDefaultConfig({
1010

1111
const ruleTester = new RuleTester();
1212

13-
const valideExample = `import {Component} from 'another-module';`;
14-
const invalideExample = `import {Component} from 'some-module';`;
13+
const validExample = `import {Component} from 'another-module';`;
14+
const invalidExample = `import {Component} from 'some-module';`;
1515

1616
ruleTester.run('no-direct-import', rule, {
1717
valid: [
1818
{
1919
options: ruleOptions,
20-
code: valideExample,
20+
code: validExample,
2121
},
2222
],
2323
invalid: [
2424
{
2525
options: ruleOptions,
26-
code: invalideExample,
26+
code: invalidExample,
27+
output: `import {Component} from 'another-module';`,
2728
errors: [
2829
{ message: `Do not import directly from 'some-module'. Please use 'another-module' (autofix available).` },
2930
],

0 commit comments

Comments
 (0)