@rownd/react-native 0.1.11 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/README.md +17 -6
  2. package/lib/commonjs/assets/images/error-icon-material.svg +1 -0
  3. package/lib/commonjs/components/AutoSigninDialog.js +29 -16
  4. package/lib/commonjs/components/AutoSigninDialog.js.map +1 -1
  5. package/lib/commonjs/components/BottomSheetTextInput/BottomSheetTextInput.js +65 -0
  6. package/lib/commonjs/components/BottomSheetTextInput/BottomSheetTextInput.js.map +1 -0
  7. package/lib/commonjs/components/BottomSheetTextInput/index.js +24 -0
  8. package/lib/commonjs/components/BottomSheetTextInput/index.js.map +1 -0
  9. package/lib/commonjs/components/BottomSheetTextInput/types.js +6 -0
  10. package/lib/commonjs/components/BottomSheetTextInput/types.js.map +1 -0
  11. package/lib/commonjs/components/DefaultContext.js.map +1 -1
  12. package/lib/commonjs/components/GlobalContext.js.map +1 -1
  13. package/lib/commonjs/components/RowndComponents.js +2 -6
  14. package/lib/commonjs/components/RowndComponents.js.map +1 -1
  15. package/lib/commonjs/components/SignIn.js +59 -42
  16. package/lib/commonjs/components/SignIn.js.map +1 -1
  17. package/lib/commonjs/components/images/ErrorIcon.js +31 -0
  18. package/lib/commonjs/components/images/ErrorIcon.js.map +1 -0
  19. package/lib/commonjs/types.js.map +1 -1
  20. package/lib/module/assets/images/error-icon-material.svg +1 -0
  21. package/lib/module/components/AutoSigninDialog.js +25 -15
  22. package/lib/module/components/AutoSigninDialog.js.map +1 -1
  23. package/lib/module/components/BottomSheetTextInput/BottomSheetTextInput.js +52 -0
  24. package/lib/module/components/BottomSheetTextInput/BottomSheetTextInput.js.map +1 -0
  25. package/lib/module/components/BottomSheetTextInput/index.js +5 -0
  26. package/lib/module/components/BottomSheetTextInput/index.js.map +1 -0
  27. package/lib/module/components/BottomSheetTextInput/types.js +2 -0
  28. package/lib/module/components/BottomSheetTextInput/types.js.map +1 -0
  29. package/lib/module/components/DefaultContext.js.map +1 -1
  30. package/lib/module/components/GlobalContext.js.map +1 -1
  31. package/lib/module/components/RowndComponents.js +2 -4
  32. package/lib/module/components/RowndComponents.js.map +1 -1
  33. package/lib/module/components/SignIn.js +58 -42
  34. package/lib/module/components/SignIn.js.map +1 -1
  35. package/lib/module/components/images/ErrorIcon.js +18 -0
  36. package/lib/module/components/images/ErrorIcon.js.map +1 -0
  37. package/lib/module/types.js.map +1 -1
  38. package/lib/package.json +3 -7
  39. package/lib/typescript/src/components/BottomSheetTextInput/BottomSheetTextInput.d.ts +4 -0
  40. package/lib/typescript/src/components/BottomSheetTextInput/index.d.ts +2 -0
  41. package/lib/typescript/src/components/BottomSheetTextInput/types.d.ts +3 -0
  42. package/lib/typescript/src/components/DefaultContext.d.ts +1 -1
  43. package/lib/typescript/src/components/GlobalContext.d.ts +2 -2
  44. package/lib/typescript/src/components/images/ErrorIcon.d.ts +4 -0
  45. package/package.json +3 -7
  46. package/src/assets/images/error-icon-material.svg +1 -0
  47. package/src/components/AutoSigninDialog.tsx +19 -13
  48. package/src/components/BottomSheetTextInput/BottomSheetTextInput.tsx +57 -0
  49. package/src/components/BottomSheetTextInput/index.ts +5 -0
  50. package/src/components/BottomSheetTextInput/types.ts +3 -0
  51. package/src/components/DefaultContext.tsx +1 -1
  52. package/src/components/GlobalContext.tsx +2 -2
  53. package/src/components/RowndComponents.tsx +1 -4
  54. package/src/components/SignIn.tsx +64 -43
  55. package/src/components/images/ErrorIcon.tsx +11 -0
  56. package/src/types.ts +1 -1
  57. package/lib/commonjs/tailwind.config.js +0 -17
  58. package/lib/commonjs/tailwind.config.js.map +0 -1
  59. package/lib/commonjs/utils/tailwind.js +0 -17
  60. package/lib/commonjs/utils/tailwind.js.map +0 -1
  61. package/lib/module/tailwind.config.js +0 -10
  62. package/lib/module/tailwind.config.js.map +0 -1
  63. package/lib/module/utils/tailwind.js +0 -5
  64. package/lib/module/utils/tailwind.js.map +0 -1
  65. package/lib/typescript/src/tailwind.config.d.ts +0 -10
  66. package/lib/typescript/src/utils/tailwind.d.ts +0 -2
  67. package/src/tailwind.config.ts +0 -9
  68. package/src/utils/tailwind.ts +0 -6
@@ -10,7 +10,7 @@ import { differenceInMinutes } from 'date-fns';
10
10
  import {
11
11
  View,
12
12
  StyleSheet,
13
- Pressable,
13
+ TouchableOpacity,
14
14
  Image,
15
15
  ActivityIndicator,
16
16
  Linking,
@@ -18,15 +18,15 @@ import {
18
18
  } from 'react-native';
19
19
  // import Text from './DarkText';
20
20
  import { SvgCssUri } from 'react-native-svg';
21
- import tw from '../utils/tailwind';
22
- import phone, { type PhoneResult } from 'phone';
21
+ import phone, { PhoneResult } from 'phone';
23
22
  import jwt_decode from 'jwt-decode';
24
23
  import {
25
24
  BottomSheetBackdrop,
26
25
  BottomSheetBackdropProps,
27
26
  BottomSheetModal,
28
- BottomSheetTextInput,
29
27
  } from '@gorhom/bottom-sheet';
28
+ import BottomSheetTextInput from './BottomSheetTextInput';
29
+ import bottomSheetMeta from '@gorhom/bottom-sheet/package.json';
30
30
 
31
31
  import { useApi, useInterval, useNav, useDeviceFingerprint } from '../hooks';
32
32
  import { useGlobalContext } from './GlobalContext';
@@ -483,17 +483,23 @@ export function SignIn() {
483
483
  []
484
484
  );
485
485
 
486
+ let extraBottomSheetProps: any = {};
487
+ if (bottomSheetMeta.version.startsWith('4')) {
488
+ extraBottomSheetProps.keyboardBehavior = 'fillParent';
489
+ extraBottomSheetProps.android_keyboardInputMode = 'adjustResize';
490
+ extraBottomSheetProps.enablePanDownToClose =
491
+ state?.nav?.options?.type === 'error';
492
+ }
493
+
486
494
  return (
487
495
  <BottomSheetModal
488
496
  snapPoints={snapPoints}
489
497
  index={1}
490
498
  backdropComponent={renderBackdrop}
491
- keyboardBehavior="fillParent"
492
- android_keyboardInputMode="adjustResize"
493
- enablePanDownToClose={true}
494
499
  onDismiss={handleClose}
495
500
  style={styles.bottomSheet}
496
501
  ref={bottomSheetModalRef}
502
+ {...extraBottomSheetProps}
497
503
  >
498
504
  <View style={styles.innerContainer}>
499
505
  {step === LoginStep.INIT && (
@@ -516,7 +522,7 @@ export function SignIn() {
516
522
  returnKeyType="go"
517
523
  enablesReturnKeyAutomatically={true}
518
524
  autoCapitalize="none"
519
- onChangeText={(text) => setUserIdentifier(text.trim())}
525
+ onChangeText={(text: string) => setUserIdentifier(text.trim())}
520
526
  onBlur={validateInput}
521
527
  value={userIdentifier}
522
528
  onSubmitEditing={initSignIn}
@@ -531,20 +537,17 @@ export function SignIn() {
531
537
  : 'onChange']: handleAddlFieldChange,
532
538
  });
533
539
  })}
534
- <Pressable
535
- style={({ pressed }: { pressed: boolean }) => [
536
- styles.button,
537
- !isValidUserIdentifier && styles.buttonDisabled,
538
- pressed && styles.buttonPressed,
539
- isSubmitting && styles.buttonSubmitting,
540
- ]}
540
+ <TouchableOpacity
541
541
  disabled={!isValidUserIdentifier || isSubmitting}
542
542
  onPress={initSignIn}
543
543
  >
544
- <Text>
545
- {isSubmitting && (
546
- <ActivityIndicator size="small" color="#efefef" />
547
- )}
544
+ <View
545
+ style={{
546
+ ...styles.button,
547
+ ...(!isValidUserIdentifier && styles.buttonDisabled),
548
+ ...(isSubmitting && styles.buttonSubmitting),
549
+ }}
550
+ >
548
551
  <View style={styles.buttonText}>
549
552
  <Text
550
553
  style={
@@ -556,11 +559,18 @@ export function SignIn() {
556
559
  }
557
560
  }
558
561
  >
562
+ {isSubmitting && (
563
+ <ActivityIndicator
564
+ size="small"
565
+ color="#efefef"
566
+ style={styles.loadingIndicator}
567
+ />
568
+ )}
559
569
  {isSubmitting ? 'Just a sec...' : 'Continue'}
560
570
  </Text>
561
571
  </View>
562
- </Text>
563
- </Pressable>
572
+ </View>
573
+ </TouchableOpacity>
564
574
  <Text style={styles.signInNoticeText}>
565
575
  By continuing, you're agreeing to the terms of service that govern
566
576
  this app and to receive email or text messages for verification
@@ -575,10 +585,10 @@ export function SignIn() {
575
585
  Thanks! Verify your{' '}
576
586
  {loginType === 'phone' ? 'phone number' : 'email'} to finish
577
587
  </Text>
578
- <Text style={tw.style('py-6')}>
588
+ <Text style={styles.py6}>
579
589
  Click the link in the message we just sent to{' '}
580
- <Text style={tw.style('italic')}>{userIdentifier}</Text> to verify
581
- and finish.
590
+ <Text style={styles.italic}>{userIdentifier}</Text> to verify and
591
+ finish.
582
592
  <Text
583
593
  style={[styles.link]}
584
594
  onPress={() => setStep(LoginStep.INIT)}
@@ -595,18 +605,15 @@ export function SignIn() {
595
605
  )}
596
606
  </View>
597
607
 
598
- <Pressable
599
- style={({ pressed }: { pressed: boolean }) => [
600
- styles.button,
601
- pressed && styles.buttonPressed,
602
- ]}
608
+ <TouchableOpacity
609
+ style={[styles.button]}
603
610
  onPress={() => setStep(LoginStep.INIT)}
604
611
  >
605
612
  <Text style={styles.buttonContent}>
606
613
  Try a different{' '}
607
614
  {loginType === 'phone' ? 'phone number' : 'email'}
608
615
  </Text>
609
- </Pressable>
616
+ </TouchableOpacity>
610
617
  </>
611
618
  )}
612
619
 
@@ -620,28 +627,28 @@ export function SignIn() {
620
627
 
621
628
  {step === LoginStep.FAILURE && (
622
629
  <>
623
- <Text style={tw.style('text-base')}>Whoops, that didn't work!</Text>
624
- <Pressable
630
+ <Text style={styles.textBase}>Whoops, that didn't work!</Text>
631
+ <TouchableOpacity
625
632
  style={styles.button}
626
633
  onPress={() => setStep(LoginStep.INIT)}
627
634
  >
628
635
  <Text style={styles.buttonContent}>Try again</Text>
629
- </Pressable>
636
+ </TouchableOpacity>
630
637
  </>
631
638
  )}
632
639
 
633
640
  {step === LoginStep.ERROR && (
634
641
  <>
635
- <Text style={tw.style('text-base')}>
642
+ <Text style={styles.textBase}>
636
643
  An error occurred while signing you in.
637
644
  </Text>
638
- {!!error && <Text style={tw.style('text-rose-800')}>{error}</Text>}
639
- <Pressable
645
+ {!!error && <Text style={styles.textRose800}>{error}</Text>}
646
+ <TouchableOpacity
640
647
  style={styles.button}
641
648
  onPress={() => setStep(LoginStep.INIT)}
642
649
  >
643
650
  <Text style={styles.buttonContent}>Try again</Text>
644
- </Pressable>
651
+ </TouchableOpacity>
645
652
  </>
646
653
  )}
647
654
  <Text>
@@ -723,9 +730,11 @@ const styles = StyleSheet.create({
723
730
  marginBottom: 30,
724
731
  elevation: 0,
725
732
  backgroundColor: '#5b0ae0',
733
+ color: '#fff',
726
734
  display: 'flex',
727
735
  alignItems: 'center',
728
736
  justifyContent: 'center',
737
+ // height: 45,
729
738
  },
730
739
  buttonDisabled: {
731
740
  backgroundColor: '#eee',
@@ -739,9 +748,10 @@ const styles = StyleSheet.create({
739
748
  color: '#fff',
740
749
  },
741
750
  buttonText: {
742
- marginLeft: 10,
743
- paddingLeft: 10,
744
- fontSize: 18,
751
+ // marginHorizontal: 10,
752
+ // paddingHorizontal: 10,
753
+ // fontSize: 18,
754
+ // color: '#fff',
745
755
  },
746
756
  buttonTextInner: {
747
757
  fontSize: 18,
@@ -754,9 +764,7 @@ const styles = StyleSheet.create({
754
764
  color: '#c7c7c7',
755
765
  },
756
766
  loadingIndicator: {
757
- textAlignVertical: 'center',
758
- padding: 20,
759
- margin: 20,
767
+ marginRight: 10,
760
768
  },
761
769
  signInNoticeText: {
762
770
  fontSize: 12,
@@ -768,4 +776,17 @@ const styles = StyleSheet.create({
768
776
  link: {
769
777
  color: '#6114e1',
770
778
  },
779
+ py6: {
780
+ paddingVertical: 6,
781
+ },
782
+ italic: {
783
+ fontStyle: 'italic',
784
+ },
785
+ textBase: {
786
+ fontSize: 16,
787
+ lineHeight: 24,
788
+ },
789
+ textRose800: {
790
+ color: 'rgb(159, 18, 57)',
791
+ },
771
792
  });
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ import Svg, { SvgProps, Path } from 'react-native-svg';
3
+ /* SVGR has dropped some elements not supported by react-native-svg: title */
4
+
5
+ const SvgComponent = (props: SvgProps) => (
6
+ <Svg width={24} height={24} xmlns="http://www.w3.org/2000/svg" {...props}>
7
+ <Path d="M0 0h48v1H0z" fill="#DA1E28" fillRule="evenodd" />
8
+ </Svg>
9
+ );
10
+
11
+ export default SvgComponent;
package/src/types.ts CHANGED
@@ -24,4 +24,4 @@ type UserContext = {
24
24
  [key: string]: any;
25
25
  };
26
26
  redacted_fields: string[];
27
- };
27
+ };
@@ -1,17 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _default = {
8
- content: ['./src/**/*.{js,jsx,ts,tsx}'],
9
- theme: {
10
- extend: {}
11
- },
12
- plugins: [],
13
- variants: ['dark'],
14
- corePlugins: require('tailwind-rn/unsupported-core-plugins')
15
- };
16
- exports.default = _default;
17
- //# sourceMappingURL=tailwind.config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["content","theme","extend","plugins","variants","corePlugins","require"],"sources":["tailwind.config.ts"],"sourcesContent":["export default {\n content: ['./src/**/*.{js,jsx,ts,tsx}'],\n theme: {\n extend: {},\n },\n plugins: [],\n variants: ['dark'],\n corePlugins: require('tailwind-rn/unsupported-core-plugins'),\n};\n"],"mappings":";;;;;;eAAe;EACbA,OAAO,EAAE,CAAC,4BAAD,CADI;EAEbC,KAAK,EAAE;IACLC,MAAM,EAAE;EADH,CAFM;EAKbC,OAAO,EAAE,EALI;EAMbC,QAAQ,EAAE,CAAC,MAAD,CANG;EAObC,WAAW,EAAEC,OAAO,CAAC,sCAAD;AAPP,C"}
@@ -1,17 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _twrnc = require("twrnc");
9
-
10
- var _tailwind = _interopRequireDefault(require("../tailwind.config"));
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
- const tw = (0, _twrnc.create)(_tailwind.default);
15
- var _default = tw;
16
- exports.default = _default;
17
- //# sourceMappingURL=tailwind.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["tw","create","twConfig"],"sources":["tailwind.ts"],"sourcesContent":["import { create } from 'twrnc';\nimport twConfig from '../tailwind.config';\n\nconst tw = create(twConfig);\n\nexport default tw;\n"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEA,MAAMA,EAAE,GAAG,IAAAC,aAAA,EAAOC,iBAAP,CAAX;eAEeF,E"}
@@ -1,10 +0,0 @@
1
- export default {
2
- content: ['./src/**/*.{js,jsx,ts,tsx}'],
3
- theme: {
4
- extend: {}
5
- },
6
- plugins: [],
7
- variants: ['dark'],
8
- corePlugins: require('tailwind-rn/unsupported-core-plugins')
9
- };
10
- //# sourceMappingURL=tailwind.config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["content","theme","extend","plugins","variants","corePlugins","require"],"sources":["tailwind.config.ts"],"sourcesContent":["export default {\n content: ['./src/**/*.{js,jsx,ts,tsx}'],\n theme: {\n extend: {},\n },\n plugins: [],\n variants: ['dark'],\n corePlugins: require('tailwind-rn/unsupported-core-plugins'),\n};\n"],"mappings":"AAAA,eAAe;EACbA,OAAO,EAAE,CAAC,4BAAD,CADI;EAEbC,KAAK,EAAE;IACLC,MAAM,EAAE;EADH,CAFM;EAKbC,OAAO,EAAE,EALI;EAMbC,QAAQ,EAAE,CAAC,MAAD,CANG;EAObC,WAAW,EAAEC,OAAO,CAAC,sCAAD;AAPP,CAAf"}
@@ -1,5 +0,0 @@
1
- import { create } from 'twrnc';
2
- import twConfig from '../tailwind.config';
3
- const tw = create(twConfig);
4
- export default tw;
5
- //# sourceMappingURL=tailwind.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["create","twConfig","tw"],"sources":["tailwind.ts"],"sourcesContent":["import { create } from 'twrnc';\nimport twConfig from '../tailwind.config';\n\nconst tw = create(twConfig);\n\nexport default tw;\n"],"mappings":"AAAA,SAASA,MAAT,QAAuB,OAAvB;AACA,OAAOC,QAAP,MAAqB,oBAArB;AAEA,MAAMC,EAAE,GAAGF,MAAM,CAACC,QAAD,CAAjB;AAEA,eAAeC,EAAf"}
@@ -1,10 +0,0 @@
1
- declare const _default: {
2
- content: string[];
3
- theme: {
4
- extend: {};
5
- };
6
- plugins: never[];
7
- variants: string[];
8
- corePlugins: any;
9
- };
10
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const tw: import("twrnc").TailwindFn;
2
- export default tw;
@@ -1,9 +0,0 @@
1
- export default {
2
- content: ['./src/**/*.{js,jsx,ts,tsx}'],
3
- theme: {
4
- extend: {},
5
- },
6
- plugins: [],
7
- variants: ['dark'],
8
- corePlugins: require('tailwind-rn/unsupported-core-plugins'),
9
- };
@@ -1,6 +0,0 @@
1
- import { create } from 'twrnc';
2
- import twConfig from '../tailwind.config';
3
-
4
- const tw = create(twConfig);
5
-
6
- export default tw;