@towsila/expo-ui-library 2.1.0 → 2.2.0
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/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { TouchableOpacity, View, Text, Modal, Pressable, Animated } from "react-native";
|
|
2
|
-
import { Menu } from "../../types/menu";
|
|
3
|
-
import { useLanguage } from "../../context/LanguageContext";
|
|
4
|
-
import LanguageSelect from "./languageSelect";
|
|
1
|
+
import { TouchableOpacity, View, Text, Modal, Pressable, Animated, I18nManager } from "react-native";
|
|
5
2
|
import React, { useState, useEffect, useRef } from "react";
|
|
6
|
-
import { Fonts, textSize } from "../../tokens/typography";
|
|
7
|
-
import { useAppTheme } from "../../context/ThemeContext";
|
|
8
3
|
import { Dimensions } from "react-native";
|
|
9
4
|
import {Logout} from "@towsila/icons";
|
|
10
5
|
import ThemeToggle from "./themeToggle";
|
|
6
|
+
import { useAppTheme } from "../../context/ThemeContext";
|
|
7
|
+
import { useLanguage } from "../../context/LanguageContext";
|
|
8
|
+
import { Menu } from "../../types/menu";
|
|
9
|
+
import LanguageSelect from "./languageSelect";
|
|
10
|
+
import { Fonts, textSize } from "../../tokens/typography";
|
|
11
11
|
const SIDEBAR_WIDTH = Dimensions.get("window").width * 0.7;
|
|
12
12
|
|
|
13
13
|
interface AsideProps{
|
|
@@ -107,7 +107,9 @@ export default function AsideBar({logo, menu, onLogout, logoutLabel, onNavigate,
|
|
|
107
107
|
}}
|
|
108
108
|
>
|
|
109
109
|
{item.iconSvg && (
|
|
110
|
-
|
|
110
|
+
<View style={[I18nManager.isRTL && {transform: [{ scaleX: -1 }]} ]}>
|
|
111
|
+
{item.iconSvg(isActive ? colors.primary : "transparent")}
|
|
112
|
+
</View>
|
|
111
113
|
)}
|
|
112
114
|
<Text style={{
|
|
113
115
|
fontFamily: isActive ? Fonts.montserrat.semiBold : Fonts.montserrat.regular,
|
|
@@ -126,7 +128,7 @@ export default function AsideBar({logo, menu, onLogout, logoutLabel, onNavigate,
|
|
|
126
128
|
{/* bottom container */}
|
|
127
129
|
<View style={{ gap: 16, paddingHorizontal: 16, }}>
|
|
128
130
|
<TouchableOpacity onPress={onLogout} style={{ flexDirection: "row", alignItems: "center", gap: 10 }}>
|
|
129
|
-
<Logout width={22} height={22} color={colors.semantic.error}/>
|
|
131
|
+
<Logout width={22} height={22} color={colors.semantic.error} style={[I18nManager.isRTL && {transform: [{scale:-1}]}]}/>
|
|
130
132
|
<Text style={{
|
|
131
133
|
fontFamily: Fonts.montserrat.regular,
|
|
132
134
|
fontSize: textSize.md,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useRef, useEffect } from "react";
|
|
2
|
-
import { Animated, TouchableOpacity, View, Text } from "react-native";
|
|
3
|
-
import { useAppTheme } from "../../context/ThemeContext";
|
|
2
|
+
import { Animated, TouchableOpacity, View, Text, I18nManager } from "react-native";
|
|
4
3
|
import {LightMode, DarkMode} from "@towsila/icons";
|
|
5
|
-
import { Fonts, textSize } from "../../tokens/typography";
|
|
6
4
|
import Svg, { Path } from "react-native-svg";
|
|
5
|
+
import { useAppTheme } from "../../context/ThemeContext";
|
|
6
|
+
import { Fonts, textSize } from "../../tokens/typography";
|
|
7
7
|
|
|
8
8
|
interface TextTheme {
|
|
9
9
|
label?: string;
|
|
@@ -30,8 +30,8 @@ export default function ThemeToggle({ label }: TextTheme) {
|
|
|
30
30
|
return (
|
|
31
31
|
<View style={{ flexDirection: "row", alignItems: "center", gap: 10 }}>
|
|
32
32
|
{isDark
|
|
33
|
-
? <DarkMode width={22} height={22} color={colors.text.primary} />
|
|
34
|
-
: <LightMode width={24} height={24} color={colors.text.primary} />
|
|
33
|
+
? <DarkMode width={22} height={22} color={colors.text.primary} style={[I18nManager.isRTL && {transform:[{scaleX: -1}]}]}/>
|
|
34
|
+
: <LightMode width={24} height={24} color={colors.text.primary} style={[I18nManager.isRTL && {transform:[{scaleX: -1}]}]}/>
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
{label && (
|
|
@@ -70,7 +70,7 @@ export default function ThemeToggle({ label }: TextTheme) {
|
|
|
70
70
|
<Animated.View style={{
|
|
71
71
|
position: "absolute",
|
|
72
72
|
top: MARGIN,
|
|
73
|
-
left: MARGIN,
|
|
73
|
+
...(I18nManager.isRTL ? { right: MARGIN } : { left: MARGIN }),
|
|
74
74
|
width: THUMB,
|
|
75
75
|
height: THUMB,
|
|
76
76
|
borderRadius: THUMB / 2,
|
|
@@ -86,8 +86,8 @@ export default function ThemeToggle({ label }: TextTheme) {
|
|
|
86
86
|
elevation: 4,
|
|
87
87
|
}}>
|
|
88
88
|
{isDark
|
|
89
|
-
? <LightMode width={20} height={20} color={colors.background.main} />
|
|
90
|
-
: <DarkMode width={16} height={16} color={colors.background.main} />
|
|
89
|
+
? <LightMode width={20} height={20} color={colors.background.main} style={[I18nManager.isRTL && {transform:[{scaleX: -1}]}]}/>
|
|
90
|
+
: <DarkMode width={16} height={16} color={colors.background.main} style={[I18nManager.isRTL && {transform:[{scaleX: -1}]}]}/>
|
|
91
91
|
}
|
|
92
92
|
</Animated.View>
|
|
93
93
|
</View>
|
|
@@ -28,7 +28,7 @@ export function useResetPasswordForm({
|
|
|
28
28
|
...(includeOldPassword ?
|
|
29
29
|
[{ name: "oldPassword", type: "password", label: "Old Password" }] : []),
|
|
30
30
|
{ name: "password", type: "password", label: "Password" },
|
|
31
|
-
{ name: "confirmPassword", type: "
|
|
31
|
+
{ name: "confirmPassword", type: "password", label: "Confirm Password" },
|
|
32
32
|
];
|
|
33
33
|
|
|
34
34
|
const formValues = {
|