diff --git a/navigation/index.js b/navigation/index.js index 6cb5891..50e424c 100644 --- a/navigation/index.js +++ b/navigation/index.js @@ -8,8 +8,7 @@ import { createNativeStackNavigator } from "@react-navigation/native-stack"; import { createBottomTabNavigator } from "@react-navigation/bottom-tabs"; import { connect } from "react-redux"; import { user, publicApi } from "../src/redux/actions"; -import { useSafeAreaInsets } from 'react-native-safe-area-context'; - +import { useSafeAreaInsets } from "react-native-safe-area-context"; //components import OrderDetails from "../src/screens/OrderDetails"; @@ -50,7 +49,7 @@ import Colors from "../src/constants/Colors"; import fontSize from "../src/constants/fontSize"; const Tab = createBottomTabNavigator(); -const BottomTabNavigator = ({}) => { +const BottomTabNavigator = ({ theme }) => { const insets = useSafeAreaInsets(); const [headerShown, setHeaderShown] = React.useState(true); React.useEffect(() => { @@ -58,6 +57,7 @@ const BottomTabNavigator = ({}) => { setHeaderShown(false); }, 600); }, []); + return ( { transform: [{ scaleX: -1 }], }, tabBarLabelPosition: "below-icon", - tabBarActiveTintColor: Colors.theme1["light"].green79, + tabBarActiveTintColor: Colors.theme1.green79, tabBarInactiveTintColor: "grey", tabBarStyle: { - backgroundColor: Colors.theme1["light"].white, + backgroundColor: + theme === "light" ? Colors.theme1.white : Colors.theme1.dark, transform: [{ scaleX: -1 }], height: 65 + insets.bottom, }, tabBarLabelStyle: { - transform: [{ scaleX: -1 }, {translateY : -5}], + transform: [{ scaleX: -1 }, { translateY: -5 }], fontSize: fontSize.xs, fontFamily: "bold", }, @@ -89,8 +90,7 @@ const BottomTabNavigator = ({}) => { > } options={{ title: "خانه", tabBarIcon: ({ focused, color }) => @@ -102,7 +102,7 @@ const BottomTabNavigator = ({}) => { > { { data-name="Vector" d="M16.79 25.471v-6.693" fill="none" - stroke={Colors.theme1["light"].green79} + stroke={Colors.theme1.green79} strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} @@ -143,7 +143,7 @@ const BottomTabNavigator = ({}) => { /> } options={{ title: "کتاب‌ها", tabBarIcon: ({ focused, color }) => @@ -155,7 +155,7 @@ const BottomTabNavigator = ({}) => { > { > { } options={{ unmountOnExit: true, unmountOnBlur: true, @@ -204,8 +204,8 @@ const BottomTabNavigator = ({}) => { { { data-name="Vector" d="M12.427 14.995v-2.083c0-2.673 1.892-3.766 4.2-2.43l1.805 1.042 1.806 1.041c2.308 1.336 2.308 3.523 0 4.86l-1.806 1.041-1.805 1.046c-2.308 1.332-4.2.239-4.2-2.434v-2.083Z" fill="none" - stroke={Colors.theme1["light"].green79} + stroke={Colors.theme1.green79} strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} @@ -250,12 +250,12 @@ const BottomTabNavigator = ({}) => { /> } options={{ // tabBarBadge: count, // tabBarBadgeStyle: { // color: "white", - // backgroundColor: Colors.theme1['light'].green79, + // backgroundColor: Colors.theme1.['light'].green79, // fontSize: fontSize.sm, // }, title: "سبد خرید", @@ -267,7 +267,7 @@ const BottomTabNavigator = ({}) => { height={31.017} > { > { } options={{ title: "پروفایل", tabBarIcon: ({ focused, color }) => @@ -318,7 +318,7 @@ const BottomTabNavigator = ({}) => { width={31.192} height={31.192} > - + { > { }; const HomeStack = createNativeStackNavigator(); -const HomeStackScreen = () => { +const HomeStackScreen = ({ theme }) => { return ( @@ -382,12 +385,15 @@ const HomeStackScreen = () => { }; const ProductsStack = createNativeStackNavigator(); -const ProductsStackScreen = () => { +const ProductsStackScreen = ({ theme }) => { return ( @@ -401,12 +407,15 @@ const ProductsStackScreen = () => { }; const VODStack = createNativeStackNavigator(); -const VODStackScreen = () => { +const VODStackScreen = ({ theme }) => { return ( @@ -418,12 +427,15 @@ const VODStackScreen = () => { }; const CARTStack = createNativeStackNavigator(); -const CARTStackScreen = () => { +const CARTStackScreen = ({ theme }) => { return ( @@ -434,12 +446,15 @@ const CARTStackScreen = () => { }; const PROFILEStack = createNativeStackNavigator(); -const PROFILEStackScreen = () => { +const PROFILEStackScreen = ({ theme }) => { return ( @@ -456,7 +471,14 @@ const PROFILEStackScreen = () => { const prefix = Linking.createURL("/"); const Stack = createNativeStackNavigator(); -const Navigation = ({ getStatus, isLogin, userProducts, ltr, setLTR }) => { +const Navigation = ({ + getStatus, + isLogin, + userProducts, + ltr, + setLTR, + theme, +}) => { const linking = { prefixes: [prefix], }; @@ -480,14 +502,20 @@ const Navigation = ({ getStatus, isLogin, userProducts, ltr, setLTR }) => { // initialRouteName="Root" screenOptions={{ headerShown: false, - contentStyle: { backgroundColor: Colors.theme1["light"].white }, + contentStyle: { + backgroundColor: + theme === "light" ? Colors.theme1.white : Colors.theme1.dark, + }, }} > - + } + /> @@ -516,4 +544,5 @@ const mapDispatchToProps = { getStatus: user.getStatus, setLTR: publicApi.setLTR, }; + export default connect(mapStateToProps, mapDispatchToProps)(Navigation); diff --git a/src/components/CustomTextInput.js b/src/components/CustomTextInput.js index 68c57ff..902dff8 100644 --- a/src/components/CustomTextInput.js +++ b/src/components/CustomTextInput.js @@ -26,9 +26,6 @@ const FloatingLabelInput = ({ ...props }) => { const [isFocused, setIsFocused] = React.useState(false); - const color = React.useMemo(() => { - return Colors.theme1[theme]; - }, [theme]); const styles = StyleSheet.create({ labelStyle: { @@ -44,13 +41,15 @@ const FloatingLabelInput = ({ : -Math.floor(fontSize.sm), }, ], - color: !isFocused ? color.gray2077 : color.green79, + color: !isFocused ? Colors.theme1.gray2077 : Colors.theme1.green79, }, inputStyle: { fontSize: fontSize.lg, - color: color.black, + color: Colors.theme1.black, borderWidth: 1, - borderColor: isFocused ? color.greenC8 : color.gray2077 + "66", + borderColor: isFocused + ? Colors.theme1.greenC8 + : Colors.theme1.gray2077 + "66", textAlign: textAlign, fontFamily: "regular", direction: direction ? direction : "rtl", diff --git a/src/components/Drawer.js b/src/components/Drawer.js index c7f294c..9f2bd96 100644 --- a/src/components/Drawer.js +++ b/src/components/Drawer.js @@ -14,7 +14,7 @@ import { import { useNavigation } from "@react-navigation/native"; import { asyncAwesomeAlert } from "../utils/AsyncWrappers"; import { connect } from "react-redux"; -import { user } from "../redux/actions"; +import { user, publicApi } from "../redux/actions"; import Svg, { Path, G } from "react-native-svg"; import { AntDesign } from "@expo/vector-icons"; @@ -36,7 +36,14 @@ if ( UIManager.setLayoutAnimationEnabledExperimental(true); } -const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => { +const Drawer = ({ + position, + setBoxPosition, + user, + mobile, + theme, + setIsDark, +}) => { const [height, setHeight] = useState(Dimensions.get("window").height); const [width, setWidth] = useState(Dimensions.get("window").width); const fadeAnim = React.useRef(new Animated.Value(0)).current; // Initial value for opacity: 0 @@ -44,10 +51,6 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => { const [dropdownHeight, setDropdownHeight] = useState(0); const navigation = useNavigation(); - const color = React.useMemo(() => { - return Colors.theme1[theme]; - }, [theme]); - const routes = React.useMemo(() => { return [ { @@ -62,7 +65,9 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => { > { { { > { { data-name="Vector" d="M13.33 10h-2.67a2.006 2.006 0 0 0-2 2v10h6.67V12a2 2 0 0 0-2-2ZM20 17h-4.67v5H22v-3a2.006 2.006 0 0 0-2-2ZM12.52 2.07l.53 1.06a.6.6 0 0 0 .42.31l.96.16c.61.1.76.55.32.98l-.75.75a.639.639 0 0 0-.16.54l.21.92c.17.73-.22 1.01-.86.63l-.9-.53a.618.618 0 0 0-.59 0l-.9.53c-.64.38-1.03.1-.86-.63l.21-.92a.63.63 0 0 0-.156-.54l-.74-.74c-.44-.44-.3-.88.32-.98l.96-.16a.666.666 0 0 0 .42-.31l.53-1.06c.286-.58.746-.58 1.036-.01Z" fill="none" - stroke="#292d32" + stroke={theme === "light" ? "#292d32" : Colors.theme1.white} strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} @@ -204,7 +209,7 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => { > { @@ -250,7 +255,7 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => { message: "", }, ]; - }, [user]); + }, [user, theme]); const Route = React.useCallback( ({ route }) => { @@ -276,6 +281,10 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => { { fontFamily: "regular", fontSize: mobile ? fontSize.base : fontSize.lg, + color: + theme === "light" + ? Colors.theme1.gray20 + : Colors.theme1.white, }, ]} > @@ -284,14 +293,14 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => { ); }, - [mobile, position] + [mobile, position, theme] ); React.useEffect(() => { if (position === "0%") { setTimeout(() => { Animated.timing(fadeAnim, { - toValue: 0.5, + toValue: 0.7, duration: 300, useNativeDriver: true, // Add This line }).start(); @@ -334,25 +343,82 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => { style={[tw("w-1/5 h-full bg-black"), { opacity: fadeAnim }]} > setBoxPosition()} - > + > + setBoxPosition()} + /> + - + - + - setBoxPosition()} - /> + {theme === "light" ? ( + setIsDark("dark")} + width={24} + height={24} + style={{ padding: 10 }} + > + + + ) : ( + setIsDark("light")} + width={24} + height={24} + style={{ padding: 10 }} + > + + + + + + )} { {user?.cellphone} - { strokeLinejoin="round" strokeWidth={2} /> - + */} - { style={{ fontSize: mobile ? fontSize.base : fontSize.xl, fontFamily: "regular", - color: color.gray20, + color: Colors.theme1.gray20, }} > افزودن حساب کاربری جدید @@ -439,12 +505,12 @@ const Drawer = ({ position, setBoxPosition, user, mobile, theme }) => { marginTop: 3, fontSize: fontSize.xl4, fontFamily: "bold", - color: color.gray20 + "77", + color: Colors.theme1.gray20 + "77", }} > + - + */} {routes.map((route, index) => ( @@ -464,6 +530,7 @@ const mapStateToProps = (state) => ({ const mapDispatchToProps = { logout: user.logout, + setIsDark: publicApi.setIsDark, }; export default connect(mapStateToProps, mapDispatchToProps)(Drawer); diff --git a/src/components/Empty.js b/src/components/Empty.js index 1ec0f37..25f1e63 100644 --- a/src/components/Empty.js +++ b/src/components/Empty.js @@ -16,7 +16,7 @@ const Empty = ({ text, buttonText, buttonAction, theme }) => { fontFamily: "regular", fontSize: fontSize.tiny, transform: [{ translateY: -50 }], - color: Colors.theme1[theme].gray20, + color: Colors.theme1.gray20, }, ]} > @@ -26,7 +26,7 @@ const Empty = ({ text, buttonText, buttonAction, theme }) => { buttonAction()} > diff --git a/src/components/Header.js b/src/components/Header.js index f677872..5434186 100644 --- a/src/components/Header.js +++ b/src/components/Header.js @@ -15,7 +15,7 @@ function Header({ title, description, background }) { tw(`w-full flex items-center pb-7`), { height: height / 4.5, - backgroundColor: Colors.theme1["light"].greenCF + "0F", + backgroundColor: Colors.theme1.greenCF + "0F", }, ]} > @@ -28,7 +28,7 @@ function Header({ title, description, background }) { style={[ { fontSize: fontSize.xl, - color: Colors.theme1["light"].greenCF, + color: Colors.theme1.greenCF, fontFamily: "bold", }, ]} @@ -38,7 +38,7 @@ function Header({ title, description, background }) { @@ -400,7 +400,7 @@ const Navbar = ({ ) : null} {headerOptions?.bookmark ? ( bookmarkLoading ? ( - + ) : isActiveBookmark ? ( onChange(text)} placeholder={placeholder} - placeholderTextColor={Colors.theme1[theme].gray20 + '88'} + placeholderTextColor={Colors.theme1.gray20 + '88'} value={value} /> diff --git a/src/components/Select.js b/src/components/Select.js index 7223f97..5be4783 100644 --- a/src/components/Select.js +++ b/src/components/Select.js @@ -21,7 +21,7 @@ function Select({ buttonStyle={{ width: width, borderWidth: 1, - borderColor: Colors.theme1[theme].gray2077 + "66", + borderColor: Colors.theme1.gray2077 + "66", borderRadius: 2, height: 48, backgroundColor: "white", @@ -38,7 +38,7 @@ function Select({ justifyContent: "flex-end", flex: 0, fontSize: fontSize.tiny, - color: Colors.theme1[theme].gray2077, + color: Colors.theme1.gray2077, fontFamily: "regular", // display: 'inline' }} @@ -56,7 +56,7 @@ function Select({ { return { ...state, ltr : true }; case "public/setIsDark": // AsyncStorage.setItem("isDark", data); - return { ...state, location: false, error: null, isDark: data }; + return { ...state, location: false, error: null, theme: data }; case "active/video": return { ...state, diff --git a/src/screens/AR/components/Book.js b/src/screens/AR/components/Book.js index 500f565..d6c0b03 100644 --- a/src/screens/AR/components/Book.js +++ b/src/screens/AR/components/Book.js @@ -38,7 +38,7 @@ const Book = ({ book, mobile, theme }) => { fontFamily: "bold", fontSize: fontSize.tiny, marginTop: 10, - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, }, ]} > diff --git a/src/screens/Activation/index.js b/src/screens/Activation/index.js index 6c921e6..fef86e1 100644 --- a/src/screens/Activation/index.js +++ b/src/screens/Activation/index.js @@ -63,7 +63,7 @@ function Activation({ add, mobile, theme, route }) { bookmark: false, qr: true, back: true, - backgroundColor: Colors.theme1[theme].greenCF + "0F", + backgroundColor: Colors.theme1.greenCF + "0F", }} /> @@ -107,7 +107,7 @@ function Activation({ add, mobile, theme, route }) { /> @@ -236,7 +236,7 @@ const Address = ({ style={{ fontFamily: "regular", fontSize: mobile ? fontSize.sm : fontSize.base, - color: Colors.theme1[colorScheme].gray20 + "aa", + color: Colors.theme1.gray20 + "aa", textAlign: ios ? "right" : "auto", }} > @@ -440,7 +440,7 @@ const Address = ({ ? "ذخیره اطلاعات و بازگشت به صفحه قبل" : "ثبت آدرس" } - backgroundColor={Colors.theme1[colorScheme].greenCF} + backgroundColor={Colors.theme1.greenCF} color={"white"} border={{ color: "#196EC0", width: 0 }} width={"100%"} diff --git a/src/screens/Blog/index.js b/src/screens/Blog/index.js index e0ea0e4..c5a3dab 100644 --- a/src/screens/Blog/index.js +++ b/src/screens/Blog/index.js @@ -111,7 +111,7 @@ export const Blog = ({ getInfo, blog, getList, blogs, route, theme }) => { { { { { tw( "flex flex-row-reverse py-1 pl-3 rounded-full items-center w-full mb-7" ), - {borderWidth : 2, borderColor : Colors.theme1[theme].greenFF1} + {borderWidth : 2, borderColor : Colors.theme1.greenFF1} ]} > diff --git a/src/screens/Blogs/layouts/Header.js b/src/screens/Blogs/layouts/Header.js index ba8e787..a61115a 100644 --- a/src/screens/Blogs/layouts/Header.js +++ b/src/screens/Blogs/layouts/Header.js @@ -15,15 +15,15 @@ export const Header = ({ title, theme }) => { tw("py-2.5 pr-2.5 pl-5"), { fontSize: fontSize.base, - color: Colors.theme1[theme].white, - backgroundColor: Colors.theme1[theme].black, + color: Colors.theme1.white, + backgroundColor: Colors.theme1.black, fontFamily : 'bold' }, ]} > {title} - + ); }; diff --git a/src/screens/Blogs/layouts/New.js b/src/screens/Blogs/layouts/New.js index 88b9613..e87eac3 100644 --- a/src/screens/Blogs/layouts/New.js +++ b/src/screens/Blogs/layouts/New.js @@ -35,7 +35,7 @@ export const New = ({ blog, theme }) => { style={{ fontSize: fontSize.tiny, fontFamily: "bold", - color: Colors.theme1[theme].gray20, + color: Colors.theme1.gray20, marginTop: 5, textAlign: ios ? "right" : "auto", }} @@ -46,7 +46,7 @@ export const New = ({ blog, theme }) => { style={{ fontSize: fontSize.xs, fontFamily: "regular", - color: Colors.theme1[theme].gray2077, + color: Colors.theme1.gray2077, textAlign: ios ? "right" : "auto", marginTop: 5, }} diff --git a/src/screens/Blogs/layouts/Single.js b/src/screens/Blogs/layouts/Single.js index 5062fb7..65086f5 100644 --- a/src/screens/Blogs/layouts/Single.js +++ b/src/screens/Blogs/layouts/Single.js @@ -109,7 +109,7 @@ export const Single = ({ blog, theme }) => { style={{ fontFamily: "bold", fontSize: fontSize.lg, - color: Colors.theme1[theme].gray20, + color: Colors.theme1.gray20, textAlign: ios ? "right" : "auto", }} > @@ -119,7 +119,7 @@ export const Single = ({ blog, theme }) => { style={{ fontFamily: "regular", fontSize: fontSize.sm, - color: Colors.theme1[theme].gray2077, + color: Colors.theme1.gray2077, lineHeight: 25, marginTop: 10, textAlign: ios ? "right" : "auto", diff --git a/src/screens/Blogs/layouts/Target.js b/src/screens/Blogs/layouts/Target.js index 553695a..1dd456f 100644 --- a/src/screens/Blogs/layouts/Target.js +++ b/src/screens/Blogs/layouts/Target.js @@ -73,7 +73,7 @@ const Target = ({ blogs, theme }) => { style={[ { fontFamily: "bold", - color: Colors.theme1[theme].gray20, + color: Colors.theme1.gray20, fontSize: fontSize.tiny, }, ]} @@ -84,7 +84,7 @@ const Target = ({ blogs, theme }) => { style={[ { fontFamily: "regular", - color: Colors.theme1[theme].gray20, + color: Colors.theme1.gray20, fontSize: fontSize.xs, }, ]} @@ -98,7 +98,7 @@ const Target = ({ blogs, theme }) => { style={[ { fontFamily: "bold", - color: Colors.theme1[theme].gray20, + color: Colors.theme1.gray20, fontSize: fontSize.sm, }, ]} @@ -110,7 +110,7 @@ const Target = ({ blogs, theme }) => { tw("mt-0"), { fontFamily: "bold", - color: Colors.theme1[theme].gray20, + color: Colors.theme1.gray20, fontSize: fontSize.sm, }, ]} diff --git a/src/screens/Contact/index.js b/src/screens/Contact/index.js index 7e394dc..daa242d 100644 --- a/src/screens/Contact/index.js +++ b/src/screens/Contact/index.js @@ -45,7 +45,7 @@ function Contact({ info, theme }) { bookmark: false, qr: true, back: true, - backgroundColor: Colors.theme1[theme].greenCF + "0F", + backgroundColor: Colors.theme1.greenCF + "0F", }} />
{ ) : ( @@ -112,8 +112,8 @@ const Address = ({ یک آدرس جدید اضافه کنید @@ -135,7 +135,7 @@ const Address = ({ style={{ marginRight: 5, fontSize: mobile ? fontSize.xl : fontSize.xl4, - color: Colors.theme1[theme].gray20, + color: Colors.theme1.gray20, }} > + diff --git a/src/screens/DeliveryForm/TransportDate/index.js b/src/screens/DeliveryForm/TransportDate/index.js index 5acf8b8..1ec1b69 100644 --- a/src/screens/DeliveryForm/TransportDate/index.js +++ b/src/screens/DeliveryForm/TransportDate/index.js @@ -19,12 +19,12 @@ const TransportDate = ({ transportDate, mobile, theme }) => { tw(`flex flex-row-reverse justify-between items-center w-full px-3 ${mobile ? "py-3" : "py-2"} rounded-sm mt-3`), { backgroundColor: active - ? Colors.theme1[theme].greenCF + "15" - : Colors.theme1[theme].grayE3 + "44", + ? Colors.theme1.greenCF + "15" + : Colors.theme1.grayE3 + "44", borderWidth: 1.5, borderColor: active - ? Colors.theme1[theme].greenCF - : Colors.theme1[theme].grayE3, + ? Colors.theme1.greenCF + : Colors.theme1.grayE3, }, ]} onPress={() => setActiveDate(time)} @@ -34,8 +34,8 @@ const TransportDate = ({ transportDate, mobile, theme }) => { fontFamily: "regular", fontSize: mobile ? fontSize.tiny : fontSize.xl, color: active - ? Colors.theme1[theme].gray20 - : Colors.theme1[theme].gray20, + ? Colors.theme1.gray20 + : Colors.theme1.gray20, }} > {time.time} @@ -57,8 +57,8 @@ const TransportDate = ({ transportDate, mobile, theme }) => { fontFamily: "regular", fontSize: mobile ? fontSize.sm : fontSize.base, color: active - ? Colors.theme1[theme].green20 - : Colors.theme1[theme].gray20, + ? Colors.theme1.green20 + : Colors.theme1.gray20, }} > تکمیل ظرفیت @@ -73,7 +73,7 @@ const TransportDate = ({ transportDate, mobile, theme }) => { style={{ fontSize: mobile ? fontSize.base : fontSize.xl2, fontFamily: "bold", - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, textAlign : ios ? "right" : "auto", }} > diff --git a/src/screens/DeliveryForm/TransportMethod/index.js b/src/screens/DeliveryForm/TransportMethod/index.js index 5032c4d..2ca4298 100644 --- a/src/screens/DeliveryForm/TransportMethod/index.js +++ b/src/screens/DeliveryForm/TransportMethod/index.js @@ -44,12 +44,12 @@ const TransportMethod = ({ ), { backgroundColor: active - ? Colors.theme1[theme].greenCF + "15" - : Colors.theme1[theme].grayE3 + "44", + ? Colors.theme1.greenCF + "15" + : Colors.theme1.grayE3 + "44", borderWidth: 1.5, borderColor: active - ? Colors.theme1[theme].greenCF - : Colors.theme1[theme].grayE3, + ? Colors.theme1.greenCF + : Colors.theme1.grayE3, }, ]} onPress={() => @@ -67,8 +67,8 @@ const TransportMethod = ({ size="small" color={ factorInfo?.transportId === method?.id - ? Colors.theme1[theme].greenC8 - : Colors.theme1[theme].gray20 + ? Colors.theme1.greenC8 + : Colors.theme1.gray20 } /> ) : ( @@ -77,8 +77,8 @@ const TransportMethod = ({ fontFamily: "regular", fontSize: mobile ? fontSize.tiny : fontSize.xl2, color: active - ? Colors.theme1[theme].gray20 - : Colors.theme1[theme].gray20, + ? Colors.theme1.gray20 + : Colors.theme1.gray20, }} > {method.name} @@ -100,8 +100,8 @@ const TransportMethod = ({ fontFamily: "regular", fontSize: mobile ? fontSize.base : fontSize.base, color: active - ? Colors.theme1[theme].green20 - : Colors.theme1[theme].gray20, + ? Colors.theme1.green20 + : Colors.theme1.gray20, }} > {separate(method.price) + " " + "تومان"} @@ -118,7 +118,7 @@ const TransportMethod = ({ style={{ fontSize: mobile ? fontSize.base : fontSize.xl, fontFamily: "bold", - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, textAlign: ios ? "right" : "auto", }} > diff --git a/src/screens/DeliveryForm/index.js b/src/screens/DeliveryForm/index.js index 3274633..78bffcd 100644 --- a/src/screens/DeliveryForm/index.js +++ b/src/screens/DeliveryForm/index.js @@ -63,7 +63,7 @@ const DeliveryForm = ({ list, form, getList, getFactorInfo, userId, payFactor, f {question.active ? ( - + ) : ( - + )} {question.active ? ( @@ -48,7 +48,7 @@ function Instance({ question, selectFaq, mobile, theme }) {
موردی یافت نشد. diff --git a/src/screens/Home/components/Blogs.js b/src/screens/Home/components/Blogs.js index bb4ca8f..eec352c 100644 --- a/src/screens/Home/components/Blogs.js +++ b/src/screens/Home/components/Blogs.js @@ -87,7 +87,7 @@ const Blog = ({ blog, mobile, theme }) => { style={[ tw("mb-1"), { - color: Colors.theme1[theme].gray20, + color: Colors.theme1.gray20, fontFamily: "regular", fontSize: mobile ? fontSize.sm : fontSize.lg, textAlign: ios ? "right" : "auto", @@ -108,7 +108,7 @@ const Blog = ({ blog, mobile, theme }) => { { style={[ tw("ml-1"), { - color: Colors.theme1[theme].gray20, + color: Colors.theme1.gray20, fontFamily: "regular", fontSize: mobile ? fontSize.xs : fontSize.base, }, diff --git a/src/screens/Home/components/Header.js b/src/screens/Home/components/Header.js index dd72a7b..706867f 100644 --- a/src/screens/Home/components/Header.js +++ b/src/screens/Home/components/Header.js @@ -2,22 +2,26 @@ import React from "react"; import { View, Text, Pressable } from "react-native"; import { Entypo } from "@expo/vector-icons"; import { useNavigation } from "@react-navigation/native"; -import {connect} from 'react-redux'; +import { connect } from "react-redux"; import fontSize from "../../../constants/fontSize"; import tw from "tailwind-rn"; //Color -import Color from "../../../constants/Colors"; +import Colors from "../../../constants/Colors"; const Header = ({ title, route, mobile, theme, state = null }) => { const navigation = useNavigation(); return ( - + { {title} {route ? ( - navigation.navigate(route, state)} style={{transform: [{translateX : -fontSize.xl6 / 3}]}}> - - + navigation.navigate(route, state)} + style={{ transform: [{ translateX: -fontSize.xl6 / 3 }] }} + > + + ) : null} ); }; const mapStateToProps = (state) => ({ - mobile : state.publicApi.mobile, - theme : state.publicApi.theme -}) + mobile: state.publicApi.mobile, + theme: state.publicApi.theme, +}); export default connect(mapStateToProps)(Header); diff --git a/src/screens/Home/components/MyBooks.js b/src/screens/Home/components/MyBooks.js index f362263..5302529 100644 --- a/src/screens/Home/components/MyBooks.js +++ b/src/screens/Home/components/MyBooks.js @@ -18,8 +18,8 @@ function MyBooks({ books, grades, theme }) { style={[ tw(`w-full flex rounded-md pt-3 overflow-hidden`), { - backgroundColor: Colors.theme1[theme].greenCF + "0F", - borderColor: Colors.theme1[theme].greenD9 + "", + backgroundColor: Colors.theme1.greenCF + "0F", + borderColor: Colors.theme1.greenD9 + "", borderWidth: 1, }, ]} @@ -28,7 +28,7 @@ function MyBooks({ books, grades, theme }) { style={[ tw(`pr-4 ${ios ? "text-right" : ""} w-full`), { - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, fontFamily: "demi", fontSize: fontSize.lg, }, @@ -77,7 +77,7 @@ const Book = ({ book, grades, theme }) => { style={[ tw("mt-2 pr-1"), { - color: Colors.theme1[theme].gray20, + color: Colors.theme1.gray20, fontFamily: "bold", fontSize: fontSize.sm, }, @@ -89,7 +89,7 @@ const Book = ({ book, grades, theme }) => { style={[ tw("pr-1"), { - color: Colors.theme1[theme].gray20, + color: Colors.theme1.gray20, fontFamily: "light", fontSize: fontSize.sm, }, diff --git a/src/screens/Home/components/Videos.js b/src/screens/Home/components/Videos.js index a7b2aa0..9668d1f 100644 --- a/src/screens/Home/components/Videos.js +++ b/src/screens/Home/components/Videos.js @@ -60,7 +60,7 @@ const Video = ({ video, mobile, grades, theme }) => { style={[ tw("mt-2 px-1"), { - color: Colors.theme1[theme].gray20, + color: Colors.theme1.gray20, fontFamily: "bold", fontSize: mobile ? fontSize.sm : fontSize.xl, textAlign: ios ? "right" : "auto", @@ -73,7 +73,7 @@ const Video = ({ video, mobile, grades, theme }) => { style={[ tw("mt-1 pr-1"), { - color: Colors.theme1[theme].gray20, + color: Colors.theme1.gray20, fontFamily: "regular", fontSize: mobile ? fontSize.xs : fontSize.base, textAlign: ios ? "right" : "auto", diff --git a/src/screens/Home/index.js b/src/screens/Home/index.js index ee77cac..e510d8c 100644 --- a/src/screens/Home/index.js +++ b/src/screens/Home/index.js @@ -82,7 +82,6 @@ const styles = StyleSheet.create({ // alignItems: "", }, container: { - backgroundColor: "white", flexDirection: "column", paddingVertical: 0, paddingHorizontal: 0, diff --git a/src/screens/Login/index.js b/src/screens/Login/index.js index 1975320..adf1ef5 100644 --- a/src/screens/Login/index.js +++ b/src/screens/Login/index.js @@ -98,7 +98,7 @@ function Login(props) { { fontSize: fontSize.xl2, fontFamily: "bold", - color: Colors.theme1[props.theme].black, + color: Colors.theme1.black, }, ]} > @@ -114,7 +114,7 @@ function Login(props) { { fontSize: fontSize.xl2, fontFamily: "bold", - color: Colors.theme1[props.theme].black, + color: Colors.theme1.black, }, ]} > @@ -146,11 +146,11 @@ function Login(props) { {!props.mobile ? : null} @@ -38,7 +38,7 @@ function Book({ book, mobile, grades, theme }) { style={[ { fontSize: mobile ? fontSize.base : fontSize.xl2, - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, fontFamily: "bold", }, ]} @@ -50,7 +50,7 @@ function Book({ book, mobile, grades, theme }) { tw(" mt-2"), { fontSize: mobile ? fontSize.sm : fontSize.lg, - color: Colors.theme1[theme].gray20 + "aa", + color: Colors.theme1.gray20 + "aa", fontFamily: "regular", }, ]} @@ -62,7 +62,7 @@ function Book({ book, mobile, grades, theme }) { tw(" mt-1"), { fontSize: mobile ? fontSize.sm : fontSize.lg, - color: Colors.theme1[theme].greenBA, + color: Colors.theme1.greenBA, fontFamily: "regular", }, ]} @@ -90,7 +90,7 @@ function Book({ book, mobile, grades, theme }) { style={{ fontFamily: "bold", fontSize: mobile ? fontSize.sm : fontSize.xl2, - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, }} > تومان @@ -99,7 +99,7 @@ function Book({ book, mobile, grades, theme }) { style={[ tw(" mr-3"), { - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, fontSize: fontSize.xl, fontFamily: "bold", }, diff --git a/src/screens/OrderDetails/index.js b/src/screens/OrderDetails/index.js index f045abd..7e75925 100644 --- a/src/screens/OrderDetails/index.js +++ b/src/screens/OrderDetails/index.js @@ -82,14 +82,14 @@ function OrderDetails({ mobile, route, theme }) { mobile ? "p-3" : "p-4" }` ), - { backgroundColor: Colors.theme1[theme].greenCF + "1a" }, + { backgroundColor: Colors.theme1.greenCF + "1a" }, ]} > @@ -122,7 +122,7 @@ function OrderDetails({ mobile, route, theme }) { style={[ { fontSize: mobile ? fontSize.sm : fontSize.lg, - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, fontFamily: "bold", }, ]} @@ -135,7 +135,7 @@ function OrderDetails({ mobile, route, theme }) { { fontSize: mobile ? fontSize.sm : fontSize.lg, lineHeight: mobile ? 17 : "auto", - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, fontFamily: "regular", }, ]} @@ -148,7 +148,7 @@ function OrderDetails({ mobile, route, theme }) { tw("w-full flex flex-row-reverse justify-between py-4"), { borderBottomWidth: 1, - borderColor: Colors.theme1[theme].grayE3, + borderColor: Colors.theme1.grayE3, }, ]} > @@ -157,7 +157,7 @@ function OrderDetails({ mobile, route, theme }) { style={[ { fontSize: mobile ? fontSize.sm : fontSize.lg, - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, fontFamily: "bold", }, ]} @@ -170,7 +170,7 @@ function OrderDetails({ mobile, route, theme }) { { fontSize: mobile ? fontSize.sm : fontSize.lg, lineHeight: mobile ? 17 : "auto", - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, fontFamily: "regular", }, ]} @@ -183,7 +183,7 @@ function OrderDetails({ mobile, route, theme }) { style={[ { fontSize: mobile ? fontSize.sm : fontSize.lg, - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, fontFamily: "bold", }, ]} @@ -196,7 +196,7 @@ function OrderDetails({ mobile, route, theme }) { { fontSize: mobile ? fontSize.sm : fontSize.lg, lineHeight: mobile ? 17 : "auto", - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, fontFamily: "regular", }, ]} @@ -208,7 +208,7 @@ function OrderDetails({ mobile, route, theme }) { @@ -289,7 +289,7 @@ function OrderDetails({ mobile, route, theme }) { style={[ { fontSize: mobile ? fontSize.sm : fontSize.lg, - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, fontFamily: "bold", }, ]} @@ -301,7 +301,7 @@ function OrderDetails({ mobile, route, theme }) { tw("font-light text-right mr-1"), { fontSize: mobile ? fontSize.sm : fontSize.lg, - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, fontFamily: "regular", }, ]} @@ -314,7 +314,7 @@ function OrderDetails({ mobile, route, theme }) { style={[ { fontSize: mobile ? fontSize.sm : fontSize.lg, - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, fontFamily: "bold", }, ]} @@ -326,7 +326,7 @@ function OrderDetails({ mobile, route, theme }) { tw("font-light text-right mr-1"), { fontSize: mobile ? fontSize.sm : fontSize.lg, - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, fontFamily: "regular", }, ]} @@ -340,7 +340,7 @@ function OrderDetails({ mobile, route, theme }) { tw("w-full flex flex-row-reverse justify-between py-4"), { borderBottomWidth: 1, - borderColor: Colors.theme1[theme].grayE3, + borderColor: Colors.theme1.grayE3, }, ]} > @@ -350,7 +350,7 @@ function OrderDetails({ mobile, route, theme }) { style={[ { fontSize: mobile ? fontSize.sm : fontSize.lg, - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, fontFamily: "bold", }, ]} @@ -362,7 +362,7 @@ function OrderDetails({ mobile, route, theme }) { tw("font-light text-right mr-1"), { fontSize: mobile ? fontSize.sm : fontSize.lg, - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, fontFamily: "regular", }, ]} @@ -377,7 +377,7 @@ function OrderDetails({ mobile, route, theme }) { style={[ { fontSize: mobile ? fontSize.sm : fontSize.lg, - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, fontFamily: "bold", }, ]} @@ -389,7 +389,7 @@ function OrderDetails({ mobile, route, theme }) { tw("font-light text-right mr-1"), { fontSize: mobile ? fontSize.sm : fontSize.lg, - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, fontFamily: "regular", }, ]} diff --git a/src/screens/OrdersFollowUp/components/Order.js b/src/screens/OrdersFollowUp/components/Order.js index ac9f43f..dbcab7e 100644 --- a/src/screens/OrdersFollowUp/components/Order.js +++ b/src/screens/OrdersFollowUp/components/Order.js @@ -42,7 +42,7 @@ function Order({ order, mobile, theme }) { tw("w-full flex rounded-md overflow-hidden my-3"), { borderWidth: 1, - borderColor: Colors.theme1[theme].greenCF + "22", + borderColor: Colors.theme1.greenCF + "22", }, ]} > @@ -53,7 +53,7 @@ function Order({ order, mobile, theme }) { mobile ? "p-3" : "p-4" }` ), - { backgroundColor: Colors.theme1[theme].greenCF + "1a" }, + { backgroundColor: Colors.theme1.greenCF + "1a" }, ]} > @@ -130,7 +130,7 @@ function Order({ order, mobile, theme }) { tw("my-3"), { fontSize: mobile ? fontSize.tiny : fontSize.xl, - color: Colors.theme1[theme].gray20, + color: Colors.theme1.gray20, fontFamily: "bold", }, ]} @@ -145,14 +145,14 @@ function Order({ order, mobile, theme }) { ), { borderWidth: 1, - borderColor: Colors.theme1[theme].greenCF, + borderColor: Colors.theme1.greenCF, }, ]} > @@ -168,7 +168,7 @@ function Order({ order, mobile, theme }) { @@ -218,7 +218,7 @@ function Otp(props) { یک کد تائیدیه به شماره submit()} @@ -345,7 +345,7 @@ function Otp(props) { { fontFamily: "light", fontSize: fontSize.base, - color: Colors.theme1[props.theme].gray20, + color: Colors.theme1.gray20, }, ]} > @@ -364,7 +364,7 @@ function Otp(props) { textAlign: "center", fontFamily: "light", fontSize: fontSize.base, - color: Colors.theme1[props.theme].greenBA, + color: Colors.theme1.greenBA, }} > {"ارسال مجدد کد"} @@ -382,7 +382,7 @@ function Otp(props) { textAlign: "center", fontFamily: "light", fontSize: fontSize.base, - color: Colors.theme1[props.theme].greenBA, + color: Colors.theme1.greenBA, }} > {"بازگشت به مرحله قبل و اصلاح شماره"} diff --git a/src/screens/Product/components/Book.js b/src/screens/Product/components/Book.js index 7b59c51..40696d1 100644 --- a/src/screens/Product/components/Book.js +++ b/src/screens/Product/components/Book.js @@ -122,7 +122,7 @@ function Book({ width: Dimensions.get("window").width, height: height - 110, zIndex: 1, - backgroundColor: Colors.theme1[theme].white + "60", + backgroundColor: Colors.theme1.white + "60", }, ]} > @@ -151,7 +151,7 @@ function Book({ @@ -290,7 +290,7 @@ function Book({ style={{ fontFamily: "bold", fontSize: fontSize.sm, - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, paddingVertical: 4, }} > @@ -304,7 +304,7 @@ function Book({ tw("py-1 pr-2"), { fontFamily: "bold", - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, fontSize: fontSize.sm, }, ]} @@ -316,13 +316,13 @@ function Book({ @@ -365,9 +365,9 @@ function Book({ tw("py-1 pr-2"), { borderRightWidth: 1, - borderColor: Colors.theme1[theme].greenCF, + borderColor: Colors.theme1.greenCF, fontFamily: "bold", - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, fontSize: fontSize.sm, }, ]} @@ -378,13 +378,13 @@ function Book({ @@ -402,13 +402,13 @@ function Book({ @@ -452,7 +452,7 @@ function Book({ tw("py-1 pr-2"), { fontFamily: "bold", - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, fontSize: fontSize.sm, }, ]} @@ -463,13 +463,13 @@ function Book({ diff --git a/src/screens/Product/components/Comments.js b/src/screens/Product/components/Comments.js index 39083d5..5bb1bfd 100644 --- a/src/screens/Product/components/Comments.js +++ b/src/screens/Product/components/Comments.js @@ -148,13 +148,13 @@ const AddComment = ({ addComment, productId, ...props }) => { style={[ tw("w-full mt-4 px-2 rounded-md"), { - backgroundColor: Colors.theme1[colorScheme].grayF9, - color: Colors.theme1[colorScheme].gray20, + backgroundColor: Colors.theme1.grayF9, + color: Colors.theme1.gray20, fontSize: fontSize.base, textAlign: "right", fontFamily: "light", borderWidth: 1, - borderColor: Colors.theme1[colorScheme].grayE3, + borderColor: Colors.theme1.grayE3, height : fontSize.base + 30 }, ]} @@ -167,13 +167,13 @@ const AddComment = ({ addComment, productId, ...props }) => { style={[ tw("w-full mt-4 py-4 px-2 rounded-md h-40"), { - backgroundColor: Colors.theme1[colorScheme].grayF9, - color: Colors.theme1[colorScheme].gray20, + backgroundColor: Colors.theme1.grayF9, + color: Colors.theme1.gray20, fontSize: fontSize.tiny, textAlign: "right", fontFamily: "light", borderWidth: 1, - borderColor: Colors.theme1[colorScheme].grayE3, + borderColor: Colors.theme1.grayE3, }, ]} @@ -186,8 +186,8 @@ const AddComment = ({ addComment, productId, ...props }) => { addComment(commentForm)} diff --git a/src/screens/Product/components/Info.js b/src/screens/Product/components/Info.js index a00f894..fa4d143 100644 --- a/src/screens/Product/components/Info.js +++ b/src/screens/Product/components/Info.js @@ -132,7 +132,7 @@ const ProductQuestion = ({ list, mobile, theme }) => { } mb-4` ), { - backgroundColor: Colors.theme1[theme].greenFF1, + backgroundColor: Colors.theme1.greenFF1, }, ]} > @@ -140,7 +140,7 @@ const ProductQuestion = ({ list, mobile, theme }) => { style={[ { fontSize: mobile ? fontSize.sm : fontSize.xl3, - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, fontFamily: "demi", }, ]} @@ -171,7 +171,7 @@ const ProductReviews = ({ list, mobile, theme }) => { } mb-4` ), { - backgroundColor: Colors.theme1[theme].greenFF1 + "66", + backgroundColor: Colors.theme1.greenFF1 + "66", }, ]} > @@ -179,7 +179,7 @@ const ProductReviews = ({ list, mobile, theme }) => { style={[ { fontSize: mobile ? fontSize.tiny : fontSize.lg, - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, fontFamily: "bold", }, ]} @@ -230,7 +230,7 @@ const ProductReviews = ({ list, mobile, theme }) => { "flex flex-row-reverse justify-between items-center mt-3 rounded-md px-2 py-3 mb-2" ), { - backgroundColor: Colors.theme1[theme].greenFF1, + backgroundColor: Colors.theme1.greenFF1, }, ]} > @@ -238,7 +238,7 @@ const ProductReviews = ({ list, mobile, theme }) => { style={[ { fontSize: fontSize.sm, - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, fontFamily: "demi", }, ]} @@ -311,7 +311,7 @@ const ProductSpecifications = ({ list, mobile, theme }) => { "flex flex-row-reverse justify-between items-center mt-3 rounded-md px-3 py-3 mb-4" ), { - backgroundColor: Colors.theme1[theme].greenFF1, + backgroundColor: Colors.theme1.greenFF1, }, ]} > @@ -319,7 +319,7 @@ const ProductSpecifications = ({ list, mobile, theme }) => { style={[ { fontSize: fontSize.sm, - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, fontFamily: "demi", }, ]} diff --git a/src/screens/Product/components/LinkBox.js b/src/screens/Product/components/LinkBox.js index a6e194e..02e605e 100644 --- a/src/screens/Product/components/LinkBox.js +++ b/src/screens/Product/components/LinkBox.js @@ -20,7 +20,7 @@ function Description({ title, onPress, mobile, theme }) { }` ), { - backgroundColor: Colors.theme1[theme].greenCF + "15", + backgroundColor: Colors.theme1.greenCF + "15", // borderWidth : 1, }, ]} @@ -29,7 +29,7 @@ function Description({ title, onPress, mobile, theme }) { style={[ { fontSize: mobile ? fontSize.sm : fontSize.lg, - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, fontFamily: "demi", }, tw(""), @@ -40,7 +40,7 @@ function Description({ title, onPress, mobile, theme }) { ); diff --git a/src/screens/Product/components/Rates.js b/src/screens/Product/components/Rates.js index 9508a6c..fd5c031 100644 --- a/src/screens/Product/components/Rates.js +++ b/src/screens/Product/components/Rates.js @@ -83,7 +83,7 @@ const Progress = ({ data,theme, ...props }) => { { tw("h-full rounded-md"), { width: data.value + "%", - backgroundColor: Colors.theme1[theme].greenCF, + backgroundColor: Colors.theme1.greenCF, }, ]} > diff --git a/src/screens/Products/components/Main.js b/src/screens/Products/components/Main.js index feeb3e9..0b0fec8 100644 --- a/src/screens/Products/components/Main.js +++ b/src/screens/Products/components/Main.js @@ -75,7 +75,7 @@ const Main = ({ books, filterOptions, grades, mobile, theme }) => { { width: mobile ? "auto" : width / 2.2, borderWidth: 1, - borderColor: Colors.theme1[theme].grayE3, + borderColor: Colors.theme1.grayE3, }, tw(`flex mb-5 p-2 rounded-md ${mobile ? "w-full" : ""}`), ]} @@ -100,7 +100,7 @@ const Main = ({ books, filterOptions, grades, mobile, theme }) => { { fontFamily: "bold", fontSize: fontSize.lg, - color: Colors.theme1[theme].gray20, + color: Colors.theme1.gray20, textAlign: ios ? "right" : "auto", }, ]} @@ -113,7 +113,7 @@ const Main = ({ books, filterOptions, grades, mobile, theme }) => { { fontSize: fontSize.tiny, fontFamily: "regular", - color: Colors.theme1[theme].greenBA, + color: Colors.theme1.greenBA, textAlign: ios ? "right" : "auto", }, ]} @@ -145,7 +145,7 @@ const Main = ({ books, filterOptions, grades, mobile, theme }) => { width: mobile ? width / 2 - 25 : width / 3.2, marginBottom: 15, borderWidth: 1, - borderColor: Colors.theme1[theme].grayE3, + borderColor: Colors.theme1.grayE3, }, tw("flex justify-between px-2 pt-2 rounded-md"), ]} @@ -186,7 +186,7 @@ const Main = ({ books, filterOptions, grades, mobile, theme }) => { { style={[ tw("text-center ml-1"), { - color: Colors.theme1[theme].gray20, + color: Colors.theme1.gray20, fontFamily: "bold", fontSize: fontSize.xl2, }, @@ -217,7 +217,7 @@ const Main = ({ books, filterOptions, grades, mobile, theme }) => { @@ -238,7 +238,7 @@ const Main = ({ books, filterOptions, grades, mobile, theme }) => { width: mobile ? width / 2 - 25 : width / 3.2, marginBottom: 15, borderWidth: 1, - borderColor: Colors.theme1[theme].grayE3, + borderColor: Colors.theme1.grayE3, }, tw("flex justify-between px-2 pt-2 rounded-md"), ]} @@ -279,7 +279,7 @@ const Main = ({ books, filterOptions, grades, mobile, theme }) => { { style={[ tw("text-center ml-1"), { - color: Colors.theme1[theme].gray20, + color: Colors.theme1.gray20, fontFamily: "bold", fontSize: fontSize.xl2, }, @@ -310,7 +310,7 @@ const Main = ({ books, filterOptions, grades, mobile, theme }) => { diff --git a/src/screens/Products/index.js b/src/screens/Products/index.js index 76c4397..aacefd2 100644 --- a/src/screens/Products/index.js +++ b/src/screens/Products/index.js @@ -47,7 +47,6 @@ function Products({ style={{ paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0, position: "relative", - // backgroundColor: "white", }} > diff --git a/src/screens/Profile/components/List.js b/src/screens/Profile/components/List.js index 7547727..78e8124 100644 --- a/src/screens/Profile/components/List.js +++ b/src/screens/Profile/components/List.js @@ -211,7 +211,7 @@ const List = ({ mobile, theme }) => { ), { borderBottomWidth: 1, - borderColor: Colors.theme1[theme].grayE3 + "aa", + borderColor: Colors.theme1.grayE3 + "aa", }, ]} onPress={() => page.onPress()} @@ -223,7 +223,7 @@ const List = ({ mobile, theme }) => { fontFamily: "regular", marginTop: 5, marginRight: mobile ? 10 : 20, - color: Colors.theme1[theme].gray20, + color: Colors.theme1.gray20, fontSize: mobile ? fontSize.tiny : fontSize.lg, }} > diff --git a/src/screens/Profile/components/ProfileAddress/index.js b/src/screens/Profile/components/ProfileAddress/index.js index faf6b4c..35bc977 100644 --- a/src/screens/Profile/components/ProfileAddress/index.js +++ b/src/screens/Profile/components/ProfileAddress/index.js @@ -47,13 +47,13 @@ const ProfileAddress = ({ { backgroundColor: userAddressId === address?.id - ? Colors.theme1[theme].greenCF + "0a" - : Colors.theme1[theme].grayE3 + "44", + ? Colors.theme1.greenCF + "0a" + : Colors.theme1.grayE3 + "44", borderWidth: 2, borderColor: userAddressId === address?.id - ? Colors.theme1[theme].greenCF + "aa" - : Colors.theme1[theme].grayE3, + ? Colors.theme1.greenCF + "aa" + : Colors.theme1.grayE3, }, tw( `flex flex-row-reverse items-center w-full px-3 py-2 rounded-md mt-2` @@ -75,7 +75,7 @@ const ProfileAddress = ({ style={{ fontSize: fontSize.base, fontFamily: "bold", - color: Colors.theme1[theme].gray20, + color: Colors.theme1.gray20, }} > آدرس انتخابی شما @@ -84,7 +84,7 @@ const ProfileAddress = ({ style={{ fontSize: fontSize.xs, fontFamily: "regular", - color: Colors.theme1[theme].gray20, + color: Colors.theme1.gray20, marginRight: 10, }} > @@ -159,7 +159,7 @@ const ProfileAddress = ({ {!active ? ( @@ -176,8 +176,8 @@ const ProfileAddress = ({ title={"مشاهده روی نقشه"} backgroundColor={ active - ? Colors.theme1[theme].greenCF - : Colors.theme1[theme].gray20 + "66" + ? Colors.theme1.greenCF + : Colors.theme1.gray20 + "66" } color={"white"} border={{ color: "#196EC0", width: 0 }} @@ -240,8 +240,8 @@ const ProfileAddress = ({ یک آدرس جدید اضافه کنید @@ -264,7 +264,7 @@ const ProfileAddress = ({ marginTop: 3, marginRight: 5, fontSize: fontSize.xl3, - color: Colors.theme1[theme].greenCF, + color: Colors.theme1.greenCF, fontFamily: "bold", }} > diff --git a/src/screens/Profile/components/ProfileBookmark/index.js b/src/screens/Profile/components/ProfileBookmark/index.js index c0a483c..1c12c47 100644 --- a/src/screens/Profile/components/ProfileBookmark/index.js +++ b/src/screens/Profile/components/ProfileBookmark/index.js @@ -111,7 +111,7 @@ const Bookmark = ({ bookmark, deleteItem, mobile, grades, theme, loading }) => { tw("flex flex-row-reverse rounded-md justify-between px-3.5 py-2 mb-4"), { borderWidth: 1.5, - borderColor: Colors.theme1[theme].greenCF, + borderColor: Colors.theme1.greenCF, }, ]} onPress={() => @@ -155,7 +155,7 @@ const Bookmark = ({ bookmark, deleteItem, mobile, grades, theme, loading }) => { style={{ fontFamily: "bold", fontSize: fontSize.tiny, - color: Colors.theme1[theme].gray20, + color: Colors.theme1.gray20, width: width / 3, textAlign: "right", }} @@ -170,7 +170,7 @@ const Bookmark = ({ bookmark, deleteItem, mobile, grades, theme, loading }) => { marginTop: 5, fontFamily: "regular", fontSize: fontSize.sm, - color: Colors.theme1[theme].gray20, + color: Colors.theme1.gray20, }} > {"پایه" + " " + grades[bookmark?.product?.book?.gradeId]} @@ -179,7 +179,7 @@ const Bookmark = ({ bookmark, deleteItem, mobile, grades, theme, loading }) => { {selectedBookmark === bookmark ? ( - + ) : ( deleteAction(deleteItem({ id: bookmark.id }))} diff --git a/src/screens/Profile/components/Trophy.js b/src/screens/Profile/components/Trophy.js index 08c5112..7c68862 100644 --- a/src/screens/Profile/components/Trophy.js +++ b/src/screens/Profile/components/Trophy.js @@ -17,7 +17,7 @@ const Trophy = ({theme}) => { tw( `w-full flex py-3 px-3 justify-between flex-row-reverse` ), - { backgroundColor: Colors.theme1[theme].yellow2 }, + { backgroundColor: Colors.theme1.yellow2 }, ]} > @@ -55,7 +55,7 @@ const Trophy = ({theme}) => { fontFamily: "regular", fontSize: fontSize.tiny, marginRight: 10, - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, }} > {"امتیاز شما" + " " + 14560} @@ -66,7 +66,7 @@ const Trophy = ({theme}) => { style={{ fontFamily: "light", fontSize: fontSize.sm, - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, }} > مشاهده جوایز diff --git a/src/screens/Profile/components/User.js b/src/screens/Profile/components/User.js index 29d8c73..4baf93c 100644 --- a/src/screens/Profile/components/User.js +++ b/src/screens/Profile/components/User.js @@ -42,7 +42,7 @@ const User = ({ user, mobile, theme }) => { @@ -51,7 +51,7 @@ const User = ({ user, mobile, theme }) => { { tw(`flex items-center w-full pb-3 mb-3 flex-row-reverse pt-2`), { borderTopWidth: 1, - borderColor: Colors.theme1[theme].grayE3, + borderColor: Colors.theme1.grayE3, }, ]} > @@ -97,7 +97,7 @@ const User = ({ user, mobile, theme }) => { style={{ fontSize: mobile ? fontSize.base : fontSize.xl, fontFamily: "bold", - color: Colors.theme1[theme].gray20, + color: Colors.theme1.gray20, }} > افزودن حساب کاربری جدید @@ -108,7 +108,7 @@ const User = ({ user, mobile, theme }) => { marginTop: 3, fontSize: fontSize.xl2, fontFamily: "bold", - color: Colors.theme1[theme].gray20, + color: Colors.theme1.gray20, }} > + diff --git a/src/screens/Profile/index.js b/src/screens/Profile/index.js index 5b4aae7..2dada0f 100644 --- a/src/screens/Profile/index.js +++ b/src/screens/Profile/index.js @@ -81,7 +81,7 @@ function Profile({ mobile, theme, logout, loading }) { > {loading ? ( ) : ( @@ -112,7 +112,7 @@ function Profile({ mobile, theme, logout, loading }) { style={{ fontSize: mobile ? fontSize.base : fontSize.xl, fontFamily: "bold", - color: Colors.theme1[theme].redFF1, + color: Colors.theme1.redFF1, marginRight: 4, }} > @@ -143,7 +143,6 @@ const styles = StyleSheet.create({ position: "relative", }, container: { - backgroundColor: "white", flexDirection: "column", paddingVertical: 5, paddingHorizontal: 16, diff --git a/src/screens/QR/layouts/Scan/index.js b/src/screens/QR/layouts/Scan/index.js index 4c4d1a6..2fe2b7f 100644 --- a/src/screens/QR/layouts/Scan/index.js +++ b/src/screens/QR/layouts/Scan/index.js @@ -71,19 +71,19 @@ function Scan({ theme, route }) { { width: height / 3.5, borderWidth: 1, - borderColor: Colors.theme1[theme].greenCF, + borderColor: Colors.theme1.greenCF, }, ]} > @@ -34,10 +34,10 @@ function Tab({ data, theme }) { borderBottomWidth: 1, borderColor: dataType === "all" - ? Colors.theme1[theme].blue3 - : Colors.theme1[theme].blue5, + ? Colors.theme1.blue3 + : Colors.theme1.blue5, backgroundColor: - dataType === "all" ? Colors.theme1[theme].blue3 : "white", + dataType === "all" ? Colors.theme1.blue3 : "white", }, ]} > @@ -46,7 +46,7 @@ function Tab({ data, theme }) { fontSize: width / 38, fontFamily: dataType === "all" ? "bold" : "light", textAlign: "center", - color: Colors.theme1[theme].blue5, + color: Colors.theme1.blue5, }} > تمامی محتوا @@ -60,10 +60,10 @@ function Tab({ data, theme }) { borderBottomWidth: 1, borderColor: dataType === "voice" - ? Colors.theme1[theme].blue3 - : Colors.theme1[theme].blue5, + ? Colors.theme1.blue3 + : Colors.theme1.blue5, backgroundColor: - dataType === "voice" ? Colors.theme1[theme].blue3 : "white", + dataType === "voice" ? Colors.theme1.blue3 : "white", }, ]} > @@ -72,7 +72,7 @@ function Tab({ data, theme }) { fontSize: width / 38, fontFamily: dataType === "voice" ? "bold" : "light", textAlign: "center", - color: Colors.theme1[theme].blue5, + color: Colors.theme1.blue5, }} > صوت @@ -86,10 +86,10 @@ function Tab({ data, theme }) { borderBottomWidth: 1, borderColor: dataType === "video" - ? Colors.theme1[theme].blue3 - : Colors.theme1[theme].blue5, + ? Colors.theme1.blue3 + : Colors.theme1.blue5, backgroundColor: - dataType === "video" ? Colors.theme1[theme].blue3 : "white", + dataType === "video" ? Colors.theme1.blue3 : "white", }, ]} > @@ -98,7 +98,7 @@ function Tab({ data, theme }) { fontSize: width / 38, fontFamily: dataType === "video" ? "bold" : "light", textAlign: "center", - color: Colors.theme1[theme].blue5, + color: Colors.theme1.blue5, }} > ویدئو @@ -112,10 +112,10 @@ function Tab({ data, theme }) { borderBottomWidth: 1, borderColor: dataType === "pdf" - ? Colors.theme1[theme].blue3 - : Colors.theme1[theme].blue5, + ? Colors.theme1.blue3 + : Colors.theme1.blue5, backgroundColor: - dataType === "pdf" ? Colors.theme1[theme].blue3 : "white", + dataType === "pdf" ? Colors.theme1.blue3 : "white", }, ]} > @@ -124,7 +124,7 @@ function Tab({ data, theme }) { fontSize: width / 38, fontFamily: dataType === "pdf" ? "bold" : "light", textAlign: "center", - color: Colors.theme1[theme].blue5, + color: Colors.theme1.blue5, }} > پی دی اف @@ -138,10 +138,10 @@ function Tab({ data, theme }) { borderBottomWidth: 1, borderColor: dataType === "ppt" - ? Colors.theme1[theme].blue3 - : Colors.theme1[theme].blue5, + ? Colors.theme1.blue3 + : Colors.theme1.blue5, backgroundColor: - dataType === "ppt" ? Colors.theme1[theme].blue3 : "white", + dataType === "ppt" ? Colors.theme1.blue3 : "white", }, ]} > @@ -150,7 +150,7 @@ function Tab({ data, theme }) { fontSize: width / 38, fontFamily: dataType === "ppt" ? "bold" : "light", textAlign: "center", - color: Colors.theme1[theme].blue5, + color: Colors.theme1.blue5, }} > پاور پوینت @@ -164,10 +164,10 @@ function Tab({ data, theme }) { borderBottomWidth: 1, borderColor: dataType === "links" - ? Colors.theme1[theme].blue3 - : Colors.theme1[theme].blue5, + ? Colors.theme1.blue3 + : Colors.theme1.blue5, backgroundColor: - dataType === "links" ? Colors.theme1[theme].blue3 : "white", + dataType === "links" ? Colors.theme1.blue3 : "white", }, ]} > @@ -176,7 +176,7 @@ function Tab({ data, theme }) { fontSize: width / 38, fontFamily: dataType === "links" ? "bold" : "light", textAlign: "center", - color: Colors.theme1[theme].blue5, + color: Colors.theme1.blue5, }} > لینک ها diff --git a/src/screens/Rules/index.js b/src/screens/Rules/index.js index aee3352..5c87313 100644 --- a/src/screens/Rules/index.js +++ b/src/screens/Rules/index.js @@ -96,8 +96,8 @@ const Rules = ({ route, mobile, theme }) => { { fontFamily: "bold", fontSize: fontSize.sm, - color: Colors.theme1[theme].redC0, - backgroundColor: Colors.theme1[theme].redFF, + color: Colors.theme1.redC0, + backgroundColor: Colors.theme1.redFF, }, ]} > @@ -116,7 +116,7 @@ const Switch = ({ theme, active, setActive }) => { { tw("flex-1 py-3 flex flex-row justify-center"), { backgroundColor: active - ? Colors.theme1[theme].green79 + '11' + ? Colors.theme1.green79 + '11' : "transparent", }, ]} @@ -134,7 +134,7 @@ const Switch = ({ theme, active, setActive }) => { style={{ fontFamily: "regular", fontSize: fontSize.tiny, - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, }} > راهنمای استفاده @@ -146,7 +146,7 @@ const Switch = ({ theme, active, setActive }) => { tw("flex-1 py-3 flex flex-row justify-center"), { backgroundColor: !active - ? Colors.theme1[theme].green79 + '11' + ? Colors.theme1.green79 + '11' : "transparent", }, ]} @@ -156,7 +156,7 @@ const Switch = ({ theme, active, setActive }) => { style={{ fontFamily: "regular", fontSize: fontSize.tiny, - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, }} > شرایط و قوانین @@ -175,8 +175,8 @@ const Rule = ({ rule, theme }) => { { fontFamily: "bold", fontSize: fontSize.sm, - color: Colors.theme1[theme].green79, - backgroundColor: Colors.theme1[theme].green79 + '11', + color: Colors.theme1.green79, + backgroundColor: Colors.theme1.green79 + '11', }, ]} > @@ -188,7 +188,7 @@ const Rule = ({ rule, theme }) => { { fontFamily: "regular", fontSize: fontSize.sm, - color: Colors.theme1[theme].gray20, + color: Colors.theme1.gray20, }, ]} > diff --git a/src/screens/ShoppingCart/components/Code.js b/src/screens/ShoppingCart/components/Code.js index f34bf8f..7b695a4 100644 --- a/src/screens/ShoppingCart/components/Code.js +++ b/src/screens/ShoppingCart/components/Code.js @@ -39,7 +39,7 @@ function Code({ codeId, setCodeId, theme, loading }) { ) : ( diff --git a/src/screens/ShoppingCart/components/Product.js b/src/screens/ShoppingCart/components/Product.js index ecd371e..bac06bf 100644 --- a/src/screens/ShoppingCart/components/Product.js +++ b/src/screens/ShoppingCart/components/Product.js @@ -58,7 +58,7 @@ function Product({ ), { borderBottomWidth: 1, - borderColor: Colors.theme1[theme].grayE3, + borderColor: Colors.theme1.grayE3, direction: "rtl", }, ]} @@ -83,7 +83,7 @@ function Product({ @@ -145,7 +145,7 @@ function Product({ submit( pushToCart( @@ -183,14 +183,14 @@ function Product({ }` ), { - borderColor: Colors.theme1[theme].greenCF, + borderColor: Colors.theme1.greenCF, }, ]} > @@ -201,7 +201,7 @@ function Product({ ) : ( diff --git a/src/screens/ShoppingCart/index.js b/src/screens/ShoppingCart/index.js index e74a15f..925653d 100644 --- a/src/screens/ShoppingCart/index.js +++ b/src/screens/ShoppingCart/index.js @@ -41,7 +41,7 @@ const PriceStatus = ({ name, value, type, theme }) => { tw(""), { fontSize: fontSize.tiny, - color: Colors.theme1[theme].gray20, + color: Colors.theme1.gray20, fontFamily: "bold", }, ]} @@ -54,8 +54,8 @@ const PriceStatus = ({ name, value, type, theme }) => { { color: type === "error" - ? Colors.theme1[theme].redFF1 - : Colors.theme1[theme].green79, + ? Colors.theme1.redFF1 + : Colors.theme1.green79, fontSize: fontSize.xl, fontFamily: "bold", }, @@ -68,8 +68,8 @@ const PriceStatus = ({ name, value, type, theme }) => { { color: type === "error" - ? Colors.theme1[theme].redFF1 - : Colors.theme1[theme].green79, + ? Colors.theme1.redFF1 + : Colors.theme1.green79, fontSize: fontSize.sm, fontFamily: "regular", marginRight: 4, @@ -192,7 +192,7 @@ function ShoppingCart({ @@ -56,7 +56,7 @@ const Season = ({ { fontFamily: "bold", fontSize: mobile ? fontSize.base : fontSize.lg, - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, }, ]} > @@ -68,7 +68,7 @@ const Season = ({ { fontFamily: "regular", fontSize: mobile ? fontSize.base : fontSize.lg, - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, }, ]} > @@ -81,8 +81,8 @@ const Season = ({ borderWidth: 1, borderColor: Number(index) === 0 - ? Colors.theme1[theme].greenCF - : Colors.theme1[theme].gray2077, + ? Colors.theme1.greenCF + : Colors.theme1.gray2077, }, ]} onPress={() => @@ -103,8 +103,8 @@ const Season = ({ fontSize: mobile ? fontSize.tiny : fontSize.lg, color: Number(index) === 0 - ? Colors.theme1[theme].greenCF - : Colors.theme1[theme].gray2077, + ? Colors.theme1.greenCF + : Colors.theme1.gray2077, }} > نمایش @@ -121,9 +121,9 @@ const Season = ({ style={[ tw("flex rounded-sm py-3 px-3"), { - backgroundColor: Colors.theme1[theme].greenCF + "05", + backgroundColor: Colors.theme1.greenCF + "05", borderWidth: 1, - borderColor: Colors.theme1[theme].greenC8, + borderColor: Colors.theme1.greenC8, }, ]} onPress={() => toggle(season[0].categoryId)} @@ -134,7 +134,7 @@ const Season = ({ { fontFamily: "bold", fontSize: mobile ? fontSize.base : fontSize.xl, - color: Colors.theme1[theme].green79, + color: Colors.theme1.green79, }, ]} > @@ -149,7 +149,7 @@ const Season = ({ season[0].categoryId === activeSeason ? "arrow-up" : "arrow-down" } size={14} - color={Colors.theme1[theme].green79} + color={Colors.theme1.green79} /> {season[0]?.categoryId === activeSeason diff --git a/src/screens/Video/index.js b/src/screens/Video/index.js index 30ce8a0..fb9e252 100644 --- a/src/screens/Video/index.js +++ b/src/screens/Video/index.js @@ -130,7 +130,7 @@ function Product({ tw(`w-full flex rounded-md overflow-hidden ${mobile ? "mb-3" : "mb-5"}`), { borderWidth: 1, - borderColor: Colors.theme1[theme].greenD9, + borderColor: Colors.theme1.greenD9, backgroundColor: activeUnit === unit - ? Colors.theme1[theme].greenCF + ? Colors.theme1.greenCF : "transparent", }, ]} @@ -56,7 +56,7 @@ const Season = ({ season, activeUnit, name, setVideoActive, mobile, theme }) => ), { borderBottomWidth: 1, - borderColor: Colors.theme1[theme].greenD9, + borderColor: Colors.theme1.greenD9, }, ]} > @@ -68,7 +68,7 @@ const Season = ({ season, activeUnit, name, setVideoActive, mobile, theme }) => color: activeUnit === unit ? "white" - : Colors.theme1[theme].green79, + : Colors.theme1.green79, }, ]} > @@ -82,12 +82,12 @@ const Season = ({ season, activeUnit, name, setVideoActive, mobile, theme }) => color: activeUnit === unit ? "white" - : Colors.theme1[theme].green79, + : Colors.theme1.green79, borderRightWidth: 1, borderColor: activeUnit === unit ? "white" - : Colors.theme1[theme].green79, + : Colors.theme1.green79, paddingRight: 8, }, ]} @@ -109,7 +109,7 @@ const Season = ({ season, activeUnit, name, setVideoActive, mobile, theme }) => color: activeUnit === unit ? "white" - : Colors.theme1[theme].green79, + : Colors.theme1.green79, }} > نمایش diff --git a/src/screens/VideoDisplay/index.js b/src/screens/VideoDisplay/index.js index 69a59ae..341f8b4 100644 --- a/src/screens/VideoDisplay/index.js +++ b/src/screens/VideoDisplay/index.js @@ -79,7 +79,7 @@ function VideoDisplay({ route, mobile, theme }) { fontSize: fontSize.xl, fontFamily: "bold", marginTop: mobile ? 8 : 12, - color: Colors.theme1[theme].gray20, + color: Colors.theme1.gray20, textAlign: ios ? "right" : "auto", }} > diff --git a/src/screens/Videos/components/MostViewedVideo.js b/src/screens/Videos/components/MostViewedVideo.js index b60470d..3147564 100644 --- a/src/screens/Videos/components/MostViewedVideo.js +++ b/src/screens/Videos/components/MostViewedVideo.js @@ -69,7 +69,7 @@ function MostViewedVideo({ videos, grades, mobile, theme }) { fontSize: mobile ? fontSize.base : fontSize.xl, marginTop: 5, paddingRight: 4, - color: Colors.theme1[theme].gray20, + color: Colors.theme1.gray20, fontFamily: "regular", }} > @@ -85,7 +85,7 @@ function MostViewedVideo({ videos, grades, mobile, theme }) { { style={{ fontSize: mobile ? fontSize.base : fontSize.xl, marginTop: 5, - color: Colors.theme1[theme].gray20, + color: Colors.theme1.gray20, fontFamily: "bold", }} > @@ -58,7 +58,7 @@ const NewestVideo = ({ videos, grades, mobile, theme }) => {