react-native-boxes 1.4.78 → 1.4.80

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.
package/README.md CHANGED
@@ -487,6 +487,9 @@ Install your favorite js library.
487
487
  en: {
488
488
  watchlist: {
489
489
  hello: 'Hello!'
490
+ },
491
+ home:{
492
+ title:'Hello %{name} !'
490
493
  }
491
494
  },
492
495
  hi: {
@@ -505,6 +508,7 @@ Install your favorite js library.
505
508
  }
506
509
  }
507
510
  });
511
+ I18nProvider.locale = 'hi'
508
512
  I18nProvider.missingBehavior = "guess";
509
513
 
510
514
 
@@ -546,6 +550,30 @@ Install your favorite js library.
546
550
  }
547
551
  </details>
548
552
 
553
+ For Skipping localization, you can add create custom middleware like below and wrap your string with `{{YOUR STRING}}`, this will directly output your string.
554
+ ```
555
+ let tOriginal = I18nProvider.t.bind(I18nProvider)
556
+ I18nProvider.t = (scope, options) => {
557
+ if (scope == undefined)
558
+ return ''
559
+ if (typeof scope == 'string') {
560
+ if (scope.startsWith("{{") && scope.endsWith("}}")) {
561
+ return scope.replace("{{", "").replace("}}", "")
562
+ }
563
+ }
564
+ return tOriginal(scope, options)
565
+ }
566
+ ```
567
+
568
+ ```
569
+ <TextView text={`{{This String will not be localized. Nope}}`} />
570
+ ```
571
+
572
+ For using placeholders in your locales,
573
+
574
+ ```
575
+ <TextView text={`{{ ${theme.i18n.t('home.title',{ name: 'Shivesh Navin' })} }}` />
576
+ ```
549
577
 
550
578
 
551
579
  ### Analytics
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-boxes",
3
- "version": "1.4.78",
3
+ "version": "1.4.80",
4
4
  "description": "A react native library for rapid development of UI using boxes",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/Bar.tsx CHANGED
@@ -92,7 +92,7 @@ export function SimpleToolbar(props: SimpleToolbarProps) {
92
92
  theme.onTrack(TrackingActionType.CLICK, TrackingViewType.TOOLBAR, 'back')
93
93
  props.onHomePress && props.onHomePress()
94
94
  }}>
95
- {HomeIcon && <HomeIcon color={props.forgroundColor || theme.colors.invert.text} />}
95
+ {HomeIcon && <HomeIcon color={props.forgroundColor || theme.colors.text} />}
96
96
  </PressableView>
97
97
  </Center>
98
98
  <HBox style={{
package/src/Styles.tsx CHANGED
@@ -46,9 +46,10 @@ export const Colors = {
46
46
  critical: '#F44336',
47
47
  invert: {
48
48
  text: '#fff',
49
- caption: '#fff',
50
- heading: '#fff',
51
- background: '#1a1a1c'
49
+ caption: '#565656',
50
+ heading: '#dddddd',
51
+ background: '#212121',
52
+ forground: '#191919',
52
53
  }
53
54
  }
54
55
 
@@ -70,10 +71,11 @@ export const DarkColors = {
70
71
  warning: '#FFA726',
71
72
  critical: '#F44336',
72
73
  invert: {
73
- text: '#fff',
74
- caption: '#fff',
75
- heading: '#fff',
76
- background: '#E6E6E6'
74
+ heading: '#222222',
75
+ text: '#444444',
76
+ caption: '#A9A9A9',
77
+ background: '#E6E6E6',
78
+ forground: '#fff',
77
79
  }
78
80
  }
79
81