@sudobility/building_blocks_rn 0.0.28 → 0.0.29

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.
@@ -1,11 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { View, Text, ScrollView, I18nManager } from 'react-native';
3
3
  import { createThemedStyles } from '../../utils/styles';
4
- const rtlText = I18nManager.isRTL
5
- ? { writingDirection: 'rtl' }
6
- : undefined;
4
+ function useRTLText() {
5
+ return I18nManager.isRTL ? { writingDirection: 'rtl' } : undefined;
6
+ }
7
7
  function TextSectionView({ section, level = 2, }) {
8
8
  const styles = useStyles();
9
+ const rtlText = useRTLText();
9
10
  return (_jsxs(View, { style: styles.section, children: [_jsx(Text, { style: [
10
11
  level === 2 ? styles.sectionTitle : styles.subsectionTitle,
11
12
  rtlText,
@@ -13,6 +14,7 @@ function TextSectionView({ section, level = 2, }) {
13
14
  }
14
15
  export function AppTextScreen({ text, lastUpdatedDate, ScreenWrapper, style, }) {
15
16
  const styles = useStyles();
17
+ const rtlText = useRTLText();
16
18
  const lastUpdated = text.lastUpdated
17
19
  ? text.lastUpdated.replace('{{date}}', lastUpdatedDate ?? '')
18
20
  : lastUpdatedDate
@@ -14,13 +14,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
14
  */
15
15
  import { useState } from 'react';
16
16
  import { View, Text, Pressable, Modal, FlatList, SafeAreaView, I18nManager, } from 'react-native';
17
- const rtlText = I18nManager.isRTL
18
- ? { writingDirection: 'rtl' }
19
- : undefined;
17
+ function useRTLText() {
18
+ return I18nManager.isRTL ? { writingDirection: 'rtl' } : undefined;
19
+ }
20
20
  import { DEFAULT_LANGUAGES } from '../../constants/languages';
21
21
  import { createThemedStyles } from '../../utils/styles';
22
22
  export function LanguagePicker({ languages = DEFAULT_LANGUAGES, currentLanguage = 'en', onLanguageChange, label, style, }) {
23
23
  const styles = useStyles();
24
+ const rtlText = useRTLText();
24
25
  const [modalVisible, setModalVisible] = useState(false);
25
26
  const currentLang = languages.find(l => l.code === currentLanguage);
26
27
  const handleSelect = (code) => {
@@ -1,11 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { View, Text, Pressable, ScrollView, I18nManager } from 'react-native';
3
3
  import { createThemedStyles } from '../../utils/styles';
4
- const rtlText = I18nManager.isRTL
5
- ? { writingDirection: 'rtl' }
6
- : undefined;
4
+ function useRTLText() {
5
+ return I18nManager.isRTL ? { writingDirection: 'rtl' } : undefined;
6
+ }
7
7
  export function SettingsListScreen({ sections, onSectionPress, title = 'Settings', style, onTrack, }) {
8
8
  const styles = useStyles();
9
+ const rtlText = useRTLText();
9
10
  const handlePress = (section) => {
10
11
  onTrack?.({
11
12
  eventType: 'navigation',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sudobility/building_blocks_rn",
3
- "version": "0.0.28",
3
+ "version": "0.0.29",
4
4
  "description": "Higher-level shared UI building blocks for Sudobility React Native apps",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",