diff --git a/Presentation 1 1.pptx b/Presentation 1 1.pptx new file mode 100644 index 0000000..5a8729d Binary files /dev/null and b/Presentation 1 1.pptx differ diff --git a/navigation/index.js b/navigation/index.js index 50e424c..cae5c7c 100644 --- a/navigation/index.js +++ b/navigation/index.js @@ -64,22 +64,21 @@ const BottomTabNavigator = ({ theme }) => { screenOptions={{ tabBarHideOnKeyboard: true, headerShown, - contentStyle: { - backgroundColor: "white", - }, tabBarIconStyle: { transform: [{ scaleX: -1 }], }, tabBarLabelPosition: "below-icon", - tabBarActiveTintColor: Colors.theme1.green79, - tabBarInactiveTintColor: "grey", + tabBarActiveTintColor: + theme === "light" ? Colors.theme1.green79 : Colors.theme1.greenCF, + tabBarInactiveTintColor: + theme === "light" ? Colors.theme1.gray20 : Colors.theme1.white, tabBarStyle: { backgroundColor: theme === "light" ? Colors.theme1.white : Colors.theme1.dark, transform: [{ scaleX: -1 }], height: 65 + insets.bottom, + borderWidth : 0 }, - tabBarLabelStyle: { transform: [{ scaleX: -1 }, { translateY: -5 }], fontSize: fontSize.xs, @@ -102,7 +101,11 @@ const BottomTabNavigator = ({ theme }) => { > { xmlns="http://www.w3.org/2000/svg" width={33.58} height={33.579} + style={{ + transform: [{scale : 0.7}] + }} > { data-name="Vector" d="M16.79 25.471v-6.693" fill="none" - stroke={Colors.theme1.green79} + stroke={ + theme === "light" + ? Colors.theme1.green79 + : Colors.theme1.white + } strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} @@ -155,7 +169,11 @@ const BottomTabNavigator = ({ theme }) => { > { xmlns="http://www.w3.org/2000/svg" width={35.135} height={34.763} + style={{ + transform: [{scale : 0.7}] + }} > { { ) : ( - + { 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.green79} + stroke={ + theme === "light" + ? Colors.theme1.green79 + : Colors.theme1.white + } strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} @@ -267,7 +315,11 @@ const BottomTabNavigator = ({ theme }) => { height={31.017} > { xmlns="http://www.w3.org/2000/svg" width={31.017} height={31.017} + style={{ + transform: [{ scale: 0.8 }], + }} > { width={31.192} height={31.192} > - + { xmlns="http://www.w3.org/2000/svg" width={31.192} height={31.192} + style={{ + transform: [{ scale: 0.8 }], + }} > @@ -35,13 +39,13 @@ function Avatar({ source, size }) { @@ -51,4 +55,8 @@ function Avatar({ source, size }) { ); } -export default Avatar; +const mapStateToProps = (state) => ({ + theme: state.publicApi.theme, +}); + +export default connect(mapStateToProps)(Avatar); diff --git a/src/components/Blur.js b/src/components/Blur.js index c5ce7bd..20093a6 100644 --- a/src/components/Blur.js +++ b/src/components/Blur.js @@ -1,16 +1,26 @@ import React from "react"; import { BlurView } from "expo-blur"; import { ActivityIndicator } from "react-native"; -import tw from 'tailwind-rn'; +import { connect } from "react-redux"; +import tw from "tailwind-rn"; -export default function Blur() { +function Blur({ theme }) { return ( ); } + +const mapStateToProps = (state) => ({ + theme: state.publicApi.theme, +}); + +export default connect(mapStateToProps)(Blur); diff --git a/src/components/CustomTextInput.js b/src/components/CustomTextInput.js index 902dff8..e612e7d 100644 --- a/src/components/CustomTextInput.js +++ b/src/components/CustomTextInput.js @@ -41,15 +41,16 @@ const FloatingLabelInput = ({ : -Math.floor(fontSize.sm), }, ], - color: !isFocused ? Colors.theme1.gray2077 : Colors.theme1.green79, + backgroundColor : theme === 'light' ? Colors.theme1.white : Colors.theme1.dark, + color: !isFocused ? theme === 'light' ? Colors.theme1.gray2077 : Colors.theme1.white + 'aa' : Colors.theme1.green79, }, inputStyle: { fontSize: fontSize.lg, - color: Colors.theme1.black, + color: theme === 'light' ? Colors.theme1.black : Colors.theme1.white, borderWidth: 1, borderColor: isFocused ? Colors.theme1.greenC8 - : Colors.theme1.gray2077 + "66", + : theme === "light" ? Colors.theme1.gray2077 + "66" : Colors.theme1.white + 'aa', textAlign: textAlign, fontFamily: "regular", direction: direction ? direction : "rtl", @@ -63,12 +64,14 @@ const FloatingLabelInput = ({ setIsFocused(false); } }, [value]); + + console.log(theme); return ( - + setIsFocused(true)} > @@ -89,6 +92,7 @@ const FloatingLabelInput = ({ onBlur={() => (value ? {} : setIsFocused(() => false))} keyboardType={keyboardType} multiline={multiline} + placeholderTextColor={theme === 'light' ? Colors.theme1.gray20 + 'aa' : Colors.theme1.white + '55'} /> ); diff --git a/src/components/Divider.js b/src/components/Divider.js index 95bb0e5..7663cdd 100644 --- a/src/components/Divider.js +++ b/src/components/Divider.js @@ -1,19 +1,24 @@ import React from "react"; import { View, Text } from "react-native"; +import { connect } from "react-redux"; import tw from "tailwind-rn"; -const Divider = ({ type }) => { +const Divider = ({ type, theme }) => { return ( ); }; -export default Divider; +const mapStateToProps = (state) => ({ + theme: state.publicApi.theme, +}); + +export default connect(mapStateToProps)(Divider); diff --git a/src/components/Empty.js b/src/components/Empty.js index 25f1e63..880ae7c 100644 --- a/src/components/Empty.js +++ b/src/components/Empty.js @@ -16,7 +16,8 @@ const Empty = ({ text, buttonText, buttonAction, theme }) => { fontFamily: "regular", fontSize: fontSize.tiny, transform: [{ translateY: -50 }], - color: Colors.theme1.gray20, + color: + theme === "light" ? Colors.theme1.gray20 : Colors.theme1.white, }, ]} > @@ -26,7 +27,11 @@ const Empty = ({ text, buttonText, buttonAction, theme }) => { buttonAction()} > @@ -36,6 +41,10 @@ const Empty = ({ text, buttonText, buttonAction, theme }) => { { fontFamily: "regular", fontSize: fontSize.tiny, + color: + theme === "light" + ? Colors.theme1.white + : Colors.theme1.greenCF, }, ]} > diff --git a/src/components/Navbar.js b/src/components/Navbar.js index 61ec7a5..ae8f670 100644 --- a/src/components/Navbar.js +++ b/src/components/Navbar.js @@ -49,24 +49,28 @@ const Navbar = ({ ).length; }, [headerOptions, userFavoriteList]); - const Button = useCallback(({ icon, route, state }) => { - return ( - navigation.navigate(route, { page: state })} - > - {icon} - - ); - }, []); + const Button = useCallback( + ({ icon, route, state }) => { + return ( + navigation.navigate(route, { page: state })} + > + {icon} + + ); + }, + [theme] + ); return ( navigation.goBack()} /> ) : null @@ -97,7 +103,8 @@ const Navbar = ({ style={{ fontFamily: "demi", fontSize: fontSize.xl, - color: Colors.theme1.green79, + color: + theme === "light" ? Colors.theme1.green79 : Colors.theme1.white, paddingRight: 16, }} > @@ -113,7 +120,9 @@ const Navbar = ({ > navigation.goBack()} /> ) : null @@ -182,7 +193,13 @@ const Navbar = ({ @@ -224,7 +239,6 @@ const styles = StyleSheet.create({ paddingBottom: 100, }, container: { - backgroundColor: "white", paddingVertical: 0, paddingHorizontal: 0, }, diff --git a/src/screens/Blogs/index.js b/src/screens/Blogs/index.js index ae14847..dc8db83 100644 --- a/src/screens/Blogs/index.js +++ b/src/screens/Blogs/index.js @@ -104,7 +104,6 @@ const styles = StyleSheet.create({ paddingBottom: 100, }, container: { - backgroundColor: "white", paddingVertical: 0, paddingHorizontal: 0, }, diff --git a/src/screens/Blogs/layouts/Hashtags.js b/src/screens/Blogs/layouts/Hashtags.js index a31dbc0..c756012 100644 --- a/src/screens/Blogs/layouts/Hashtags.js +++ b/src/screens/Blogs/layouts/Hashtags.js @@ -15,7 +15,7 @@ export const Hashtags = ({ hashtags, theme }) => { tw( "flex flex-row-reverse py-1 pl-3 rounded-full items-center w-full mb-7" ), - {borderWidth : 2, borderColor : Colors.theme1.greenFF1} + {borderWidth : 2, borderColor : Colors.theme1.greenFF1 + (theme === 'light' ? "" : "55")} ]} > diff --git a/src/screens/Blogs/layouts/Header.js b/src/screens/Blogs/layouts/Header.js index a61115a..d758a47 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.white, - backgroundColor: Colors.theme1.black, + color: theme === "light" ? Colors.theme1.white : Colors.theme1.black, + backgroundColor: theme === 'light' ? Colors.theme1.black : Colors.theme1.white + 'dd', fontFamily : 'bold' }, ]} > {title} - + ); }; diff --git a/src/screens/Blogs/layouts/New.js b/src/screens/Blogs/layouts/New.js index e87eac3..1572aa9 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.gray20, + color: theme === "light" ? Colors.theme1.gray20 : Colors.theme1.grayF9, marginTop: 5, textAlign: ios ? "right" : "auto", }} @@ -46,7 +46,8 @@ export const New = ({ blog, theme }) => { style={{ fontSize: fontSize.xs, fontFamily: "regular", - color: Colors.theme1.gray2077, + color: + theme === "light" ? Colors.theme1.gray2077 : Colors.theme1.grayF9, textAlign: ios ? "right" : "auto", marginTop: 5, }} diff --git a/src/screens/Blogs/layouts/Single.js b/src/screens/Blogs/layouts/Single.js index 65086f5..4c18cd5 100644 --- a/src/screens/Blogs/layouts/Single.js +++ b/src/screens/Blogs/layouts/Single.js @@ -109,7 +109,8 @@ export const Single = ({ blog, theme }) => { style={{ fontFamily: "bold", fontSize: fontSize.lg, - color: Colors.theme1.gray20, + color: + theme === "light" ? Colors.theme1.gray20 : Colors.theme1.grayF9, textAlign: ios ? "right" : "auto", }} > @@ -119,7 +120,10 @@ export const Single = ({ blog, theme }) => { style={{ fontFamily: "regular", fontSize: fontSize.sm, - color: Colors.theme1.gray2077, + color: + theme === "light" + ? Colors.theme1.gray2077 + : Colors.theme1.grayF9, lineHeight: 25, marginTop: 10, textAlign: ios ? "right" : "auto", @@ -138,7 +142,7 @@ export const Single = ({ blog, theme }) => { const mapStateToProps = (state) => ({ blog: state.blog.list[0], - theme: state.publicApi.theme + theme: state.publicApi.theme, }); const mapDispatchToProps = {}; diff --git a/src/screens/Blogs/layouts/Target.js b/src/screens/Blogs/layouts/Target.js index 1dd456f..fae1f12 100644 --- a/src/screens/Blogs/layouts/Target.js +++ b/src/screens/Blogs/layouts/Target.js @@ -53,6 +53,8 @@ const Target = ({ blogs, theme }) => { fontFamily: "bold", fontSize: fontSize.lg, textAlign: ios ? "right" : "auto", + color: + theme === "light" ? Colors.theme1.gray20 : Colors.theme1.grayF9, }, ]} > @@ -73,7 +75,10 @@ const Target = ({ blogs, theme }) => { style={[ { fontFamily: "bold", - color: Colors.theme1.gray20, + color: + theme === "light" + ? Colors.theme1.gray20 + : Colors.theme1.grayF9, fontSize: fontSize.tiny, }, ]} @@ -84,7 +89,10 @@ const Target = ({ blogs, theme }) => { style={[ { fontFamily: "regular", - color: Colors.theme1.gray20, + color: + theme === "light" + ? Colors.theme1.gray20 + : Colors.theme1.grayF9, fontSize: fontSize.xs, }, ]} @@ -98,7 +106,10 @@ const Target = ({ blogs, theme }) => { style={[ { fontFamily: "bold", - color: Colors.theme1.gray20, + color: + theme === "light" + ? Colors.theme1.gray20 + : Colors.theme1.grayF9, fontSize: fontSize.sm, }, ]} @@ -110,7 +121,10 @@ const Target = ({ blogs, theme }) => { tw("mt-0"), { fontFamily: "bold", - color: Colors.theme1.gray20, + color: + theme === "light" + ? Colors.theme1.gray20 + : Colors.theme1.grayF9, fontSize: fontSize.sm, }, ]} @@ -145,6 +159,10 @@ const Target = ({ blogs, theme }) => { fontFamily: "bold", fontSize: fontSize.sm, textAlign: ios ? "right" : "auto", + color: + theme === "light" + ? Colors.theme1.gray20 + : Colors.theme1.grayF9, }, ]} > diff --git a/src/screens/Contact/index.js b/src/screens/Contact/index.js index daa242d..47e70ea 100644 --- a/src/screens/Contact/index.js +++ b/src/screens/Contact/index.js @@ -33,7 +33,6 @@ function Contact({ info, theme }) { style={{ paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0, position: "relative", - backgroundColor: "white", }} > - + {Object.keys(info).map((item, index) => ( ))} diff --git a/src/screens/Contact/layouts/Ticket.js b/src/screens/Contact/layouts/Ticket.js index 43d8636..cc410f3 100644 --- a/src/screens/Contact/layouts/Ticket.js +++ b/src/screens/Contact/layouts/Ticket.js @@ -77,7 +77,6 @@ export const Ticket = ({ style={{ paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0, position: "relative", - backgroundColor: "white", flex: 1, }} > diff --git a/src/screens/Contact/layouts/Tickets.js b/src/screens/Contact/layouts/Tickets.js index 6870fba..42f8d00 100644 --- a/src/screens/Contact/layouts/Tickets.js +++ b/src/screens/Contact/layouts/Tickets.js @@ -26,7 +26,6 @@ export const Tickets = ({ tickets = [], theme }) => { style={{ paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0, position: "relative", - backgroundColor: "white", flex: 1, }} > diff --git a/src/screens/Faq/components/Instance.js b/src/screens/Faq/components/Instance.js index 0b82275..df24726 100644 --- a/src/screens/Faq/components/Instance.js +++ b/src/screens/Faq/components/Instance.js @@ -14,10 +14,12 @@ function Instance({ question, selectFaq, mobile, theme }) { tw(`w-full flex my-1.5 rounded-sm px-4 ${mobile ? "py-2" : "py-3"}`), { backgroundColor: !question.active - ? "#F9F9F9" + ? theme === "light" + ? "#F9F9F9" + : null : Colors.theme1.greenCF + "0a", borderColor: !question.active - ? "#DBDBDB" + ? "#DBDBDB" + (theme === "light" ? "" : "88") : Colors.theme1.greenCF, borderWidth: 1.5, }, @@ -29,7 +31,10 @@ function Instance({ question, selectFaq, mobile, theme }) { { width: "90%", textAlign: "right", - color: Colors.theme1.green79, + color: + theme === "light" + ? Colors.theme1.green79 + : Colors.theme1.grayF9, fontSize: mobile ? fontSize.tiny : fontSize.lg, fontFamily: "bold", }, @@ -38,9 +43,21 @@ function Instance({ question, selectFaq, mobile, theme }) { {question.title} {question.active ? ( - + ) : ( - + )} {question.active ? ( @@ -48,7 +65,10 @@ function Instance({ question, selectFaq, mobile, theme }) { { return index; @@ -94,7 +93,7 @@ function Faq({ list, getFaq, searchResult, search, selectFaq, searchFaq, theme } ) : ( { return index; diff --git a/src/screens/Home/components/Blogs.js b/src/screens/Home/components/Blogs.js index eec352c..9a7de8f 100644 --- a/src/screens/Home/components/Blogs.js +++ b/src/screens/Home/components/Blogs.js @@ -72,7 +72,7 @@ const Blog = ({ blog, mobile, theme }) => { { shadowRadius: 2, elevation: 5, height: 85, + backgroundColor : theme === 'light' ? Colors.theme1.white : Colors.theme1.green79 }, ]} > @@ -87,7 +88,7 @@ const Blog = ({ blog, mobile, theme }) => { style={[ tw("mb-1"), { - color: Colors.theme1.gray20, + color: theme === 'light' ? Colors.theme1.gray20 : Colors.theme1.white, fontFamily: "regular", fontSize: mobile ? fontSize.sm : fontSize.lg, textAlign: ios ? "right" : "auto", @@ -108,7 +109,7 @@ const Blog = ({ blog, mobile, theme }) => { { style={[ tw("ml-1"), { - color: Colors.theme1.gray20, + color: theme === 'light' ? Colors.theme1.gray20 : Colors.theme1.white, 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 706867f..9ba8176 100644 --- a/src/screens/Home/components/Header.js +++ b/src/screens/Home/components/Header.js @@ -21,7 +21,7 @@ const Header = ({ title, route, mobile, theme, state = null }) => { { ) : null} diff --git a/src/screens/Home/components/MyBooks.js b/src/screens/Home/components/MyBooks.js index 5302529..173eb20 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.greenCF + "0F", - borderColor: Colors.theme1.greenD9 + "", + backgroundColor: theme === 'light' ? Colors.theme1.greenCF + "0F" : Colors.theme1.greenCF + '11', + borderColor: Colors.theme1.greenD9 + (theme === 'light' ? "" : "77"), borderWidth: 1, }, ]} @@ -28,7 +28,8 @@ function MyBooks({ books, grades, theme }) { style={[ tw(`pr-4 ${ios ? "text-right" : ""} w-full`), { - color: Colors.theme1.green79, + color: + theme === "light" ? Colors.theme1.green79 : Colors.theme1.white, fontFamily: "demi", fontSize: fontSize.lg, }, @@ -77,7 +78,8 @@ const Book = ({ book, grades, theme }) => { style={[ tw("mt-2 pr-1"), { - color: Colors.theme1.gray20, + color: + theme === "light" ? Colors.theme1.gray20 : Colors.theme1.white, fontFamily: "bold", fontSize: fontSize.sm, }, @@ -89,7 +91,8 @@ const Book = ({ book, grades, theme }) => { style={[ tw("pr-1"), { - color: Colors.theme1.gray20, + color: + theme === "light" ? Colors.theme1.gray20 : Colors.theme1.white, fontFamily: "light", fontSize: fontSize.sm, }, diff --git a/src/screens/Home/components/Videos.js b/src/screens/Home/components/Videos.js index 9668d1f..89725f1 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.gray20, + color: theme === 'light' ? Colors.theme1.gray20 : Colors.theme1.white, 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.gray20, + color: theme === 'light' ? Colors.theme1.gray20 : Colors.theme1.white, fontFamily: "regular", fontSize: mobile ? fontSize.xs : fontSize.base, textAlign: ios ? "right" : "auto", diff --git a/src/screens/Login/index.js b/src/screens/Login/index.js index adf1ef5..dc4bf3b 100644 --- a/src/screens/Login/index.js +++ b/src/screens/Login/index.js @@ -59,7 +59,7 @@ function Login(props) { @@ -114,7 +117,10 @@ function Login(props) { { fontSize: fontSize.xl2, fontFamily: "bold", - color: Colors.theme1.black, + color: + props.theme === "light" + ? Colors.theme1.black + : Colors.theme1.white, }, ]} > @@ -175,8 +181,15 @@ function Login(props) { ورود شما در سامانه به منزله قبول و{" "} diff --git a/src/screens/OrderDetails/components/Book.js b/src/screens/OrderDetails/components/Book.js index 66e9465..05b77e9 100644 --- a/src/screens/OrderDetails/components/Book.js +++ b/src/screens/OrderDetails/components/Book.js @@ -15,13 +15,13 @@ function Book({ book, mobile, grades, theme }) { tw("w-full flex flex-row-reverse justify-between py-3"), { borderBottomWidth: 1, - borderColor: Colors.theme1.grayE3, + borderColor: Colors.theme1.grayE3 + (theme === "light" ? "" : "55"), }, ]} > تومان @@ -99,7 +108,10 @@ function Book({ book, mobile, grades, theme }) { style={[ tw(" mr-3"), { - color: Colors.theme1.green79, + color: + theme === "light" + ? Colors.theme1.green79 + : Colors.theme1.white, fontSize: fontSize.xl, fontFamily: "bold", }, @@ -116,7 +128,7 @@ function Book({ book, mobile, grades, theme }) { const mapStateToProps = (state) => ({ mobile: state.publicApi.mobile, grades: state.publicApi.grades, - theme: state.publicApi.theme + theme: state.publicApi.theme, }); export default connect(mapStateToProps)(Book); diff --git a/src/screens/OrderDetails/index.js b/src/screens/OrderDetails/index.js index 7e75925..1927df5 100644 --- a/src/screens/OrderDetails/index.js +++ b/src/screens/OrderDetails/index.js @@ -43,7 +43,6 @@ const status = { }; function OrderDetails({ mobile, route, theme }) { - const { order } = route.params; const [position, setPosition] = useState("100%"); @@ -85,11 +84,18 @@ function OrderDetails({ mobile, route, theme }) { { backgroundColor: Colors.theme1.greenCF + "1a" }, ]} > - + @@ -122,7 +129,11 @@ function OrderDetails({ mobile, route, theme }) { style={[ { fontSize: mobile ? fontSize.sm : fontSize.lg, - color: Colors.theme1.green79, + color: + theme === "light" + ? Colors.theme1.green79 + : Colors.theme1.white, + fontFamily: "bold", }, ]} @@ -135,7 +146,11 @@ function OrderDetails({ mobile, route, theme }) { { fontSize: mobile ? fontSize.sm : fontSize.lg, lineHeight: mobile ? 17 : "auto", - color: Colors.theme1.green79, + color: + theme === "light" + ? Colors.theme1.green79 + : Colors.theme1.white, + fontFamily: "regular", }, ]} @@ -148,7 +163,8 @@ function OrderDetails({ mobile, route, theme }) { tw("w-full flex flex-row-reverse justify-between py-4"), { borderBottomWidth: 1, - borderColor: Colors.theme1.grayE3, + borderColor: + Colors.theme1.grayE3 + (theme === "light" ? "" : "55"), }, ]} > @@ -157,7 +173,11 @@ function OrderDetails({ mobile, route, theme }) { style={[ { fontSize: mobile ? fontSize.sm : fontSize.lg, - color: Colors.theme1.green79, + color: + theme === "light" + ? Colors.theme1.green79 + : Colors.theme1.white, + fontFamily: "bold", }, ]} @@ -170,7 +190,11 @@ function OrderDetails({ mobile, route, theme }) { { fontSize: mobile ? fontSize.sm : fontSize.lg, lineHeight: mobile ? 17 : "auto", - color: Colors.theme1.green79, + color: + theme === "light" + ? Colors.theme1.green79 + : Colors.theme1.white, + fontFamily: "regular", }, ]} @@ -183,7 +207,11 @@ function OrderDetails({ mobile, route, theme }) { style={[ { fontSize: mobile ? fontSize.sm : fontSize.lg, - color: Colors.theme1.green79, + color: + theme === "light" + ? Colors.theme1.green79 + : Colors.theme1.white, + fontFamily: "bold", }, ]} @@ -196,7 +224,11 @@ function OrderDetails({ mobile, route, theme }) { { fontSize: mobile ? fontSize.sm : fontSize.lg, lineHeight: mobile ? 17 : "auto", - color: Colors.theme1.green79, + color: + theme === "light" + ? Colors.theme1.green79 + : Colors.theme1.white, + fontFamily: "regular", }, ]} @@ -207,8 +239,13 @@ function OrderDetails({ mobile, route, theme }) { @@ -289,7 +343,11 @@ function OrderDetails({ mobile, route, theme }) { style={[ { fontSize: mobile ? fontSize.sm : fontSize.lg, - color: Colors.theme1.green79, + color: + theme === "light" + ? Colors.theme1.green79 + : Colors.theme1.white, + fontFamily: "bold", }, ]} @@ -301,7 +359,11 @@ function OrderDetails({ mobile, route, theme }) { tw("font-light text-right mr-1"), { fontSize: mobile ? fontSize.sm : fontSize.lg, - color: Colors.theme1.green79, + color: + theme === "light" + ? Colors.theme1.green79 + : Colors.theme1.white, + fontFamily: "regular", }, ]} @@ -314,7 +376,11 @@ function OrderDetails({ mobile, route, theme }) { style={[ { fontSize: mobile ? fontSize.sm : fontSize.lg, - color: Colors.theme1.green79, + color: + theme === "light" + ? Colors.theme1.green79 + : Colors.theme1.white, + fontFamily: "bold", }, ]} @@ -326,7 +392,11 @@ function OrderDetails({ mobile, route, theme }) { tw("font-light text-right mr-1"), { fontSize: mobile ? fontSize.sm : fontSize.lg, - color: Colors.theme1.green79, + color: + theme === "light" + ? Colors.theme1.green79 + : Colors.theme1.white, + fontFamily: "regular", }, ]} @@ -340,17 +410,21 @@ function OrderDetails({ mobile, route, theme }) { tw("w-full flex flex-row-reverse justify-between py-4"), { borderBottomWidth: 1, - borderColor: Colors.theme1.grayE3, + borderColor: + Colors.theme1.grayE3 + (theme === "light" ? "" : "55"), }, ]} > - ({ mobile: state.publicApi.mobile, - theme: state.publicApi.theme + theme: state.publicApi.theme, }); export default connect(mapStateToProps)(OrderDetails); diff --git a/src/screens/OrdersFollowUp/components/Order.js b/src/screens/OrdersFollowUp/components/Order.js index dbcab7e..2c30ca0 100644 --- a/src/screens/OrdersFollowUp/components/Order.js +++ b/src/screens/OrdersFollowUp/components/Order.js @@ -61,7 +61,8 @@ function Order({ order, mobile, theme }) { tw("font-medium"), { fontSize: mobile ? fontSize.base : fontSize.xl, - color: Colors.theme1.green79, + color: + theme === "light" ? Colors.theme1.green79 : Colors.theme1.white, fontFamily: mobile ? "regular" : "demi", }, ]} @@ -73,7 +74,10 @@ function Order({ order, mobile, theme }) { style={[ tw("font-light"), { - color: Colors.theme1.green79, + color: + theme === "light" + ? Colors.theme1.green79 + : Colors.theme1.white, fontSize: mobile ? fontSize.sm : fontSize.lg, fontFamily: mobile ? "bold" : "demi", }, @@ -111,12 +115,14 @@ function Order({ order, mobile, theme }) { @@ -130,7 +136,10 @@ function Order({ order, mobile, theme }) { tw("my-3"), { fontSize: mobile ? fontSize.tiny : fontSize.xl, - color: Colors.theme1.gray20, + color: + theme === "light" + ? Colors.theme1.gray20 + : Colors.theme1.white, fontFamily: "bold", }, ]} @@ -180,7 +189,10 @@ function Order({ order, mobile, theme }) { tw("my-5"), { fontSize: mobile ? fontSize.sm : fontSize.lg, - color: Colors.theme1.gray20, + color: + theme === "light" + ? Colors.theme1.gray20 + : Colors.theme1.white, fontFamily: "light", }, ]} @@ -197,7 +209,7 @@ function Order({ order, mobile, theme }) { const mapStateToProps = (state) => ({ mobile: state.publicApi.mobile, - theme: state.publicApi.theme + theme: state.publicApi.theme, }); export default connect(mapStateToProps)(Order); diff --git a/src/screens/OrdersFollowUp/index.js b/src/screens/OrdersFollowUp/index.js index 99a58fc..fcb6a44 100644 --- a/src/screens/OrdersFollowUp/index.js +++ b/src/screens/OrdersFollowUp/index.js @@ -72,7 +72,6 @@ const styles = StyleSheet.create({ alignItems: "flex-end", }, container: { - backgroundColor: "white", flexDirection: "column", paddingVertical: 0, paddingHorizontal: 16, diff --git a/src/screens/Otp/index.js b/src/screens/Otp/index.js index e9345ae..16afe8a 100644 --- a/src/screens/Otp/index.js +++ b/src/screens/Otp/index.js @@ -139,7 +139,11 @@ function Otp(props) { " " + ":" + " " + - (hour > 0 ? hour.toString().length === 1 ? "0" + hour.toString() : hour : "00") + (hour > 0 + ? hour.toString().length === 1 + ? "0" + hour.toString() + : hour + : "00") ); }, [props.route] @@ -171,7 +175,7 @@ function Otp(props) { @@ -234,12 +241,16 @@ function Otp(props) { > diff --git a/src/screens/Product/components/Book.js b/src/screens/Product/components/Book.js index 40696d1..438aa61 100644 --- a/src/screens/Product/components/Book.js +++ b/src/screens/Product/components/Book.js @@ -151,7 +151,10 @@ function Book({ @@ -290,7 +301,11 @@ function Book({ style={{ fontFamily: "bold", fontSize: fontSize.sm, - color: Colors.theme1.green79, + color: + theme === "light" + ? Colors.theme1.green79 + : Colors.theme1.greenCF, + paddingVertical: 4, }} > @@ -304,7 +319,11 @@ function Book({ tw("py-1 pr-2"), { fontFamily: "bold", - color: Colors.theme1.green79, + color: + theme === "light" + ? Colors.theme1.green79 + : Colors.theme1.greenCF, + fontSize: fontSize.sm, }, ]} @@ -321,8 +340,8 @@ function Book({ tw("flex flex-row-reverse justify-between px-2 py-3 mb-4"), { borderWidth: 1, - borderColor: Colors.theme1.greenCF, - backgroundColor: Colors.theme1.greenFF + "0a", + borderColor: Colors.theme1.greenCF, + backgroundColor: theme === 'light' ? Colors.theme1.greenFF + "0a" : null, width: width - 32 - 8 - (fontSize.sm * 6 + 18), }, ]} @@ -353,7 +372,11 @@ function Book({ style={{ fontFamily: "bold", fontSize: fontSize.sm, - color: Colors.theme1.green79, + color: + theme === "light" + ? Colors.theme1.green79 + : Colors.theme1.greenCF, + paddingVertical: 4, }} > @@ -367,7 +390,11 @@ function Book({ borderRightWidth: 1, borderColor: Colors.theme1.greenCF, fontFamily: "bold", - color: Colors.theme1.green79, + color: + theme === "light" + ? Colors.theme1.green79 + : Colors.theme1.greenCF, + fontSize: fontSize.sm, }, ]} @@ -384,7 +411,7 @@ function Book({ { borderWidth: 1, borderColor: Colors.theme1.greenCF, - backgroundColor: Colors.theme1.greenFF + "0a", + backgroundColor: theme === 'light' ? Colors.theme1.greenFF + "0a" : null, width: fontSize.sm * 6 + 18, }, ]} @@ -394,7 +421,9 @@ function Book({ style={{ fontFamily: "bold", fontSize: fontSize.xs, - color: Colors.theme1.green79, + color: + theme === "light" ? Colors.theme1.green79 : Colors.theme1.greenCF, + paddingVertical: 4, }} > @@ -408,7 +437,7 @@ function Book({ { borderWidth: 1, borderColor: Colors.theme1.greenCF, - backgroundColor: Colors.theme1.greenFF + "0a", + backgroundColor: theme === 'light' ? Colors.theme1.greenFF + "0a" : null, width: width - 32 - 8 - (fontSize.sm * 6 + 18), }, ]} @@ -439,7 +468,11 @@ function Book({ style={{ fontFamily: "bold", fontSize: fontSize.sm, - color: Colors.theme1.green79, + color: + theme === "light" + ? Colors.theme1.green79 + : Colors.theme1.greenCF, + paddingVertical: 4, }} > @@ -452,7 +485,11 @@ function Book({ tw("py-1 pr-2"), { fontFamily: "bold", - color: Colors.theme1.green79, + color: + theme === "light" + ? Colors.theme1.green79 + : Colors.theme1.greenCF, + fontSize: fontSize.sm, }, ]} @@ -469,7 +506,7 @@ function Book({ { borderWidth: 1, borderColor: Colors.theme1.greenCF, - backgroundColor: Colors.theme1.greenFF + "0a", + backgroundColor: theme === 'light' ? Colors.theme1.greenFF + "0a" : null, width: fontSize.sm * 6 + 18, }, ]} @@ -479,7 +516,9 @@ function Book({ style={{ fontFamily: "bold", fontSize: fontSize.xs, - color: Colors.theme1.green79, + color: + theme === "light" ? Colors.theme1.green79 : Colors.theme1.greenCF, + paddingVertical: 4, }} > @@ -528,7 +567,7 @@ function Book({ style={[ { fontSize: fontSize.tiny, - color: "#275077", + color: theme === 'light' ? "#275077" : Colors.theme1.white, fontFamily: "regular", }, tw(""), diff --git a/src/screens/Product/components/Comments.js b/src/screens/Product/components/Comments.js index 5bb1bfd..94039d3 100644 --- a/src/screens/Product/components/Comments.js +++ b/src/screens/Product/components/Comments.js @@ -31,6 +31,7 @@ function Commnets({ productId, getFullList, orderFullList, + theme }) { React.useEffect(() => { if (!orderFullList.length) { @@ -46,18 +47,19 @@ function Commnets({ inverted={true} style={{ marginTop: 20, paddingBottom: 10 }} data={comments} - renderItem={({ item }) => } + renderItem={({ item }) => } keyExtractor={(item) => item.id} /> ); } -const Comment = ({ comment }) => { +const Comment = ({ comment, theme }) => { return ( { ); }; -const AddComment = ({ addComment, productId, ...props }) => { +const AddComment = ({ addComment, productId, theme, ...props }) => { const [commentForm, setCommentForm] = React.useState({ title: "", text: "", @@ -148,32 +150,32 @@ const AddComment = ({ addComment, productId, ...props }) => { style={[ tw("w-full mt-4 px-2 rounded-md"), { - backgroundColor: Colors.theme1.grayF9, - color: Colors.theme1.gray20, + backgroundColor: theme === 'light' ? Colors.theme1.grayF9 : null, + color: theme === 'light' ? Colors.theme1.gray20 : Colors.theme1.white, fontSize: fontSize.base, textAlign: "right", fontFamily: "light", borderWidth: 1, - borderColor: Colors.theme1.grayE3, + borderColor: theme === 'light' ? Colors.theme1.grayE3 : Colors.theme1.white + '55', height : fontSize.base + 30 }, ]} - value={comment.title} placeholder="عنوان نظر ..." onChangeText={(text) => setCommentForm({...commentForm, title : text})} + placeholderTextColor={theme === 'light' ? "auto" : Colors.theme1.white + 'aa'} /> { textAlignVertical="top" placeholder="متن نظر ..." onChangeText={(text) => setCommentForm({...commentForm, text})} + placeholderTextColor={theme === 'light' ? "auto" : Colors.theme1.white + 'aa'} /> { const mapStateToProps = (state) => ({ orderFullList: state.userFactor.fullList, + theme1: state.publicApi.theme1, }); const mapDispatchToProps = { diff --git a/src/screens/Product/components/Info.js b/src/screens/Product/components/Info.js index fa4d143..c6035a8 100644 --- a/src/screens/Product/components/Info.js +++ b/src/screens/Product/components/Info.js @@ -84,7 +84,6 @@ const Info = ({ paddingBottom: 100, }, container: { - backgroundColor: "white", flexDirection: "column", paddingVertical: 5, paddingHorizontal: 16, diff --git a/src/screens/Product/components/LinkBox.js b/src/screens/Product/components/LinkBox.js index 02e605e..1673b5c 100644 --- a/src/screens/Product/components/LinkBox.js +++ b/src/screens/Product/components/LinkBox.js @@ -20,7 +20,10 @@ function Description({ title, onPress, mobile, theme }) { }` ), { - backgroundColor: Colors.theme1.greenCF + "15", + backgroundColor: + theme === "light" + ? Colors.theme1.greenCF + "15" + : Colors.theme1.blue90 + "33", // borderWidth : 1, }, ]} @@ -29,7 +32,8 @@ function Description({ title, onPress, mobile, theme }) { style={[ { fontSize: mobile ? fontSize.sm : fontSize.lg, - color: Colors.theme1.green79, + color: + theme === "light" ? Colors.theme1.green79 : Colors.theme1.white, fontFamily: "demi", }, tw(""), @@ -40,7 +44,7 @@ function Description({ title, onPress, mobile, theme }) { ); diff --git a/src/screens/Product/components/Rates.js b/src/screens/Product/components/Rates.js index fd5c031..ca1b37e 100644 --- a/src/screens/Product/components/Rates.js +++ b/src/screens/Product/components/Rates.js @@ -13,11 +13,10 @@ import Colors from "../../../constants/Colors"; const width = Dimensions.get("window").width; function Rates({ rate, productId, addVote, isBuyed = null, theme }) { - return ( !isBuyed ? asyncAwesomeAlert("خطا", "شما این محصول رو خریداری نکرده اید.", { @@ -28,7 +27,11 @@ function Rates({ rate, productId, addVote, isBuyed = null, theme }) { > {rate} @@ -44,7 +47,7 @@ function Rates({ rate, productId, addVote, isBuyed = null, theme }) { { - +const Progress = ({ data, theme, ...props }) => { return ( @@ -102,7 +104,7 @@ const Progress = ({ data,theme, ...props }) => { fontFamily: "light", width: width / 7.5, textAlign: "center", - color: "#05335F", + color: theme === "light" ? "#05335F" : Colors.theme1.white, }} > {data.value + "%"} @@ -112,7 +114,7 @@ const Progress = ({ data,theme, ...props }) => { }; const mapStateToProps = (state) => ({ - theme: state.publicApi.theme + theme: state.publicApi.theme, }); const mapDispatchToProps = { diff --git a/src/screens/Product/index.js b/src/screens/Product/index.js index 8978ca5..134d1f9 100644 --- a/src/screens/Product/index.js +++ b/src/screens/Product/index.js @@ -52,7 +52,6 @@ const styles = StyleSheet.create({ paddingBottom: 100, }, container: { - backgroundColor: "white", flexDirection: "column", paddingVertical: 5, paddingHorizontal: 16, diff --git a/src/screens/Products/components/Header.js b/src/screens/Products/components/Header.js index 77df7b7..aa8682c 100644 --- a/src/screens/Products/components/Header.js +++ b/src/screens/Products/components/Header.js @@ -12,7 +12,7 @@ import Select from "../../../components/Select"; const Header = ({ setFilterOptions, filterOptions, levels, productTypes }) => { return ( - + setFilterOptions({ ...filterOptions, search: val })} placeholder={"نام کتاب یا دوره را جستجو کنید"} diff --git a/src/screens/Products/components/Main.js b/src/screens/Products/components/Main.js index 0b0fec8..e7938df 100644 --- a/src/screens/Products/components/Main.js +++ b/src/screens/Products/components/Main.js @@ -75,7 +75,8 @@ const Main = ({ books, filterOptions, grades, mobile, theme }) => { { width: mobile ? "auto" : width / 2.2, borderWidth: 1, - borderColor: Colors.theme1.grayE3, + borderColor: + Colors.theme1.grayE3 + (theme === "light" ? "" : "55"), }, tw(`flex mb-5 p-2 rounded-md ${mobile ? "w-full" : ""}`), ]} @@ -100,7 +101,10 @@ const Main = ({ books, filterOptions, grades, mobile, theme }) => { { fontFamily: "bold", fontSize: fontSize.lg, - color: Colors.theme1.gray20, + color: + theme === "light" + ? Colors.theme1.gray20 + : Colors.theme1.white, textAlign: ios ? "right" : "auto", }, ]} @@ -123,7 +127,14 @@ const Main = ({ books, filterOptions, grades, mobile, theme }) => { {separate(product?.product[2]?.price)}{" "} @@ -145,7 +156,8 @@ const Main = ({ books, filterOptions, grades, mobile, theme }) => { width: mobile ? width / 2 - 25 : width / 3.2, marginBottom: 15, borderWidth: 1, - borderColor: Colors.theme1.grayE3, + borderColor: + Colors.theme1.grayE3 + (theme === "light" ? "" : "55"), }, tw("flex justify-between px-2 pt-2 rounded-md"), ]} @@ -176,10 +188,13 @@ const Main = ({ books, filterOptions, grades, mobile, theme }) => { style={{ fontSize: fontSize.base, marginTop: 5, - color: "#05335F", fontFamily: "bold", width: "100%", textAlign: ios ? "right" : "auto", + color: + theme === "light" + ? Colors.theme1.gray20 + : Colors.theme1.white, }} > {"کتاب دیجیتال" + " " + product?.name} @@ -206,7 +221,10 @@ const Main = ({ books, filterOptions, grades, mobile, theme }) => { style={[ tw("text-center ml-1"), { - color: Colors.theme1.gray20, + color: + theme === "light" + ? Colors.theme1.gray20 + : Colors.theme1.white, fontFamily: "bold", fontSize: fontSize.xl2, }, @@ -217,7 +235,10 @@ const Main = ({ books, filterOptions, grades, mobile, theme }) => { @@ -238,7 +259,8 @@ const Main = ({ books, filterOptions, grades, mobile, theme }) => { width: mobile ? width / 2 - 25 : width / 3.2, marginBottom: 15, borderWidth: 1, - borderColor: Colors.theme1.grayE3, + borderColor: + Colors.theme1.grayE3 + (theme === "light" ? "" : "55"), }, tw("flex justify-between px-2 pt-2 rounded-md"), ]} @@ -269,7 +291,10 @@ const Main = ({ books, filterOptions, grades, mobile, theme }) => { style={{ fontSize: fontSize.base, marginTop: 5, - color: "#05335F", + color: + theme === "light" + ? Colors.theme1.gray20 + : Colors.theme1.white, fontFamily: "bold", width: "100%", textAlign: ios ? "right" : "auto", @@ -299,7 +324,10 @@ const Main = ({ books, filterOptions, grades, mobile, theme }) => { style={[ tw("text-center ml-1"), { - color: Colors.theme1.gray20, + color: + theme === "light" + ? Colors.theme1.gray20 + : Colors.theme1.white, fontFamily: "bold", fontSize: fontSize.xl2, }, @@ -310,7 +338,10 @@ const Main = ({ books, filterOptions, grades, mobile, theme }) => { @@ -328,7 +359,7 @@ const Main = ({ books, filterOptions, grades, mobile, theme }) => { onLayout={() => setWidth(Dimensions.get("window").width)} style={[ tw( - `flex w-full px-4 flex-wrap justify-between bg-white pb-20 ${ + `flex w-full px-4 flex-wrap justify-between ${ ios ? "flex-row-reverse" : "flex-row" }` ), diff --git a/src/screens/Products/index.js b/src/screens/Products/index.js index aacefd2..3b34385 100644 --- a/src/screens/Products/index.js +++ b/src/screens/Products/index.js @@ -5,6 +5,7 @@ import { ScrollView, SafeAreaView, StatusBar, + Dimensions, LayoutAnimation, } from "react-native"; import { connect } from "react-redux"; @@ -17,6 +18,9 @@ import Main from "./components/Main"; //style +//variables +const {height} = Dimensions.get("window"); + function Products({ books, getBooks, @@ -51,7 +55,7 @@ function Products({ >
- +
diff --git a/src/screens/Profile/components/List.js b/src/screens/Profile/components/List.js index 78e8124..53c9ec9 100644 --- a/src/screens/Profile/components/List.js +++ b/src/screens/Profile/components/List.js @@ -29,7 +29,7 @@ const List = ({ mobile, theme }) => { { data-name="Vector" d="M20.59 22c0-3.87-3.85-7-8.59-7s-8.59 3.13-8.59 7" fill="none" - stroke="#37a865" + stroke={theme === 'light' ? Colors.theme1.greenCF : Colors.theme1.white} strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} @@ -54,7 +54,7 @@ const List = ({ mobile, theme }) => { { data-name="Vector" d="M9 22h6c4.02 0 4.74-1.61 4.95-3.57l.75-6C20.97 9.99 20.27 8 16 8H8c-4.27 0-4.97 1.99-4.7 4.43l.75 6C4.26 20.39 4.98 22 9 22Z" fill="none" - stroke="#37a865" + stroke={theme === 'light' ? Colors.theme1.greenCF : Colors.theme1.white} strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} @@ -72,7 +72,7 @@ const List = ({ mobile, theme }) => { data-name="Vector" d="M15.496 12h.005M8.495 12H8.5" fill="none" - stroke="#37a865" + stroke={theme === 'light' ? Colors.theme1.greenCF : Colors.theme1.white} strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} @@ -88,7 +88,7 @@ const List = ({ mobile, theme }) => { { data-name="Vector" d="M12 5.236v15M19.955 8.4h-2.25M19.918 11.369h-3" fill="none" - stroke="#37a865" + stroke={theme === 'light' ? Colors.theme1.greenCF : Colors.theme1.white} strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} @@ -114,7 +114,7 @@ const List = ({ mobile, theme }) => { { data-name="Vector" d="M8.954 10.76V9.296c0-1.878 1.329-2.646 2.951-1.708l1.268.732 1.268.732c1.622.939 1.622 2.476 0 3.415l-1.267.732-1.268.732c-1.623.938-2.952.17-2.952-1.708V10.76Z" fill="none" - stroke="#37a865" + stroke={theme === 'light' ? Colors.theme1.greenCF : Colors.theme1.white} strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} @@ -141,7 +141,7 @@ const List = ({ mobile, theme }) => { { data-name="Vector" d="M12.75 8.723v5.313M17.872 2.125H7.628a4.111 4.111 0 0 0-4.1 4.1v14.972c0 1.912 1.371 2.72 3.049 1.8l5.185-2.879a2.251 2.251 0 0 1 1.987 0l5.185 2.879c1.679.935 3.049.128 3.049-1.8V6.225a4.127 4.127 0 0 0-4.111-4.1Z" fill="none" - stroke="#37a865" + stroke={theme === 'light' ? Colors.theme1.greenCF : Colors.theme1.white} strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} @@ -165,7 +165,7 @@ const List = ({ mobile, theme }) => { { data-name="Vector" d="M9 22h6c5 0 7-2 7-7V9c0-5-2-7-7-7H9C4 2 2 4 2 9v6c0 5 2 7 7 7Z" fill="none" - stroke="#37a865" + stroke={theme === 'light' ? Colors.theme1.greenCF : Colors.theme1.white} strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} @@ -211,7 +211,7 @@ const List = ({ mobile, theme }) => { ), { borderBottomWidth: 1, - borderColor: Colors.theme1.grayE3 + "aa", + borderColor: Colors.theme1.grayE3 + (theme === 'light' ? "aa" : '55'), }, ]} onPress={() => page.onPress()} @@ -223,7 +223,7 @@ const List = ({ mobile, theme }) => { fontFamily: "regular", marginTop: 5, marginRight: mobile ? 10 : 20, - color: Colors.theme1.gray20, + color: theme === 'light' ? Colors.theme1.gray20 : Colors.theme1.white, fontSize: mobile ? fontSize.tiny : fontSize.lg, }} > diff --git a/src/screens/Profile/components/MyCourses/index.js b/src/screens/Profile/components/MyCourses/index.js index e2250c2..288243b 100644 --- a/src/screens/Profile/components/MyCourses/index.js +++ b/src/screens/Profile/components/MyCourses/index.js @@ -32,7 +32,6 @@ const ProfileBookmark = ({ myCourses = [], mobile, theme }) => { style={{ paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0, position: "relative", - backgroundColor: "white", flex: 1, }} > diff --git a/src/screens/Profile/components/ProfileAddress/index.js b/src/screens/Profile/components/ProfileAddress/index.js index 35bc977..0ccb167 100644 --- a/src/screens/Profile/components/ProfileAddress/index.js +++ b/src/screens/Profile/components/ProfileAddress/index.js @@ -199,7 +199,6 @@ const ProfileAddress = ({ style={{ paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0, position: "relative", - backgroundColor: "white", flex: 1, paddingBottom: 20, }} diff --git a/src/screens/Profile/components/ProfileBookmark/index.js b/src/screens/Profile/components/ProfileBookmark/index.js index 1c12c47..4646ffa 100644 --- a/src/screens/Profile/components/ProfileBookmark/index.js +++ b/src/screens/Profile/components/ProfileBookmark/index.js @@ -43,7 +43,6 @@ const ProfileBookmark = ({ style={{ paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0, position: "relative", - backgroundColor: "white", flex: 1, }} > @@ -111,7 +110,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.greenCF, + borderColor: Colors.theme1.greenCF + (theme === "light" ? "" : "77"), }, ]} onPress={() => @@ -155,7 +154,8 @@ const Bookmark = ({ bookmark, deleteItem, mobile, grades, theme, loading }) => { style={{ fontFamily: "bold", fontSize: fontSize.tiny, - color: Colors.theme1.gray20, + color: + theme === "light" ? Colors.theme1.gray20 : Colors.theme1.white, width: width / 3, textAlign: "right", }} @@ -170,7 +170,10 @@ const Bookmark = ({ bookmark, deleteItem, mobile, grades, theme, loading }) => { marginTop: 5, fontFamily: "regular", fontSize: fontSize.sm, - color: Colors.theme1.gray20, + color: + theme === "light" + ? Colors.theme1.gray20 + : Colors.theme1.white, }} > {"پایه" + " " + grades[bookmark?.product?.book?.gradeId]} @@ -192,7 +195,7 @@ const Bookmark = ({ bookmark, deleteItem, mobile, grades, theme, loading }) => { > { +const Trophy = ({ theme }) => { return ( @@ -55,7 +57,8 @@ const Trophy = ({theme}) => { fontFamily: "regular", fontSize: fontSize.tiny, marginRight: 10, - color: Colors.theme1.green79, + color: + theme === "light" ? Colors.theme1.green79 : Colors.theme1.yellow2, }} > {"امتیاز شما" + " " + 14560} @@ -66,7 +69,8 @@ const Trophy = ({theme}) => { style={{ fontFamily: "light", fontSize: fontSize.sm, - color: Colors.theme1.green79, + color: + theme === "light" ? Colors.theme1.green79 : Colors.theme1.yellow2, }} > مشاهده جوایز @@ -77,7 +81,7 @@ const Trophy = ({theme}) => { }; const mapStateToProps = (state) => ({ - theme: state.publicApi.theme + theme: state.publicApi.theme, }); export default connect(mapStateToProps)(Trophy); diff --git a/src/screens/Profile/components/User.js b/src/screens/Profile/components/User.js index 4baf93c..f7edeb3 100644 --- a/src/screens/Profile/components/User.js +++ b/src/screens/Profile/components/User.js @@ -42,7 +42,10 @@ const User = ({ user, mobile, theme }) => { @@ -51,7 +54,10 @@ 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.grayE3, + borderColor: + Colors.theme1.grayE3 + (theme === "light" ? "" : "55"), }, ]} > @@ -97,7 +104,10 @@ const User = ({ user, mobile, theme }) => { style={{ fontSize: mobile ? fontSize.base : fontSize.xl, fontFamily: "bold", - color: Colors.theme1.gray20, + color: + theme === "light" + ? Colors.theme1.gray20 + : Colors.theme1.white, }} > افزودن حساب کاربری جدید @@ -108,7 +118,10 @@ const User = ({ user, mobile, theme }) => { marginTop: 3, fontSize: fontSize.xl2, fontFamily: "bold", - color: Colors.theme1.gray20, + color: + theme === "light" + ? Colors.theme1.gray20 + : Colors.theme1.white, }} > + diff --git a/src/screens/Rules/index.js b/src/screens/Rules/index.js index 5c87313..2748006 100644 --- a/src/screens/Rules/index.js +++ b/src/screens/Rules/index.js @@ -32,7 +32,6 @@ const Rules = ({ route, mobile, theme }) => { paddingBottom: 100, }, container: { - backgroundColor: "white", flexDirection: "column", paddingVertical: 5, paddingHorizontal: 16, @@ -97,7 +96,9 @@ const Rules = ({ route, mobile, theme }) => { fontFamily: "bold", fontSize: fontSize.sm, color: Colors.theme1.redC0, - backgroundColor: Colors.theme1.redFF, + backgroundColor: theme === 'light' ? Colors.theme1.redFF : null, + borderWidth : theme === 'light' ? 0 : 1, + borderColor : Colors.theme1.redC0 }, ]} > @@ -116,7 +117,11 @@ const Switch = ({ theme, active, setActive }) => { { tw("flex-1 py-3 flex flex-row justify-center"), { backgroundColor: active - ? Colors.theme1.green79 + '11' + ? theme === "light" + ? Colors.theme1.green79 + "11" + : Colors.theme1.greenCF + "22" : "transparent", }, ]} @@ -134,7 +141,8 @@ const Switch = ({ theme, active, setActive }) => { style={{ fontFamily: "regular", fontSize: fontSize.tiny, - color: Colors.theme1.green79, + color: + theme === "light" ? Colors.theme1.green79 : Colors.theme1.greenCF, }} > راهنمای استفاده @@ -146,7 +154,9 @@ const Switch = ({ theme, active, setActive }) => { tw("flex-1 py-3 flex flex-row justify-center"), { backgroundColor: !active - ? Colors.theme1.green79 + '11' + ? theme === "light" + ? Colors.theme1.green79 + "11" + : Colors.theme1.greenCF + "22" : "transparent", }, ]} @@ -156,7 +166,8 @@ const Switch = ({ theme, active, setActive }) => { style={{ fontFamily: "regular", fontSize: fontSize.tiny, - color: Colors.theme1.green79, + color: + theme === "light" ? Colors.theme1.green79 : Colors.theme1.greenCF, }} > شرایط و قوانین @@ -175,8 +186,13 @@ const Rule = ({ rule, theme }) => { { fontFamily: "bold", fontSize: fontSize.sm, - color: Colors.theme1.green79, - backgroundColor: Colors.theme1.green79 + '11', + color: + theme === "light" ? Colors.theme1.green79 : Colors.theme1.greenCF, + backgroundColor: + theme === "light" ? Colors.theme1.green79 + "11" : null, + borderWidth: theme === "light" ? 0 : 1, + borderColor: Colors.theme1.greenCF + "55", + textAlign: "right", }, ]} > @@ -188,7 +204,9 @@ const Rule = ({ rule, theme }) => { { fontFamily: "regular", fontSize: fontSize.sm, - color: Colors.theme1.gray20, + color: + theme === "light" ? Colors.theme1.gray20 : Colors.theme1.white, + textAlign: "right", }, ]} > diff --git a/src/screens/ShoppingCart/components/Code.js b/src/screens/ShoppingCart/components/Code.js index 7b695a4..0d0bee6 100644 --- a/src/screens/ShoppingCart/components/Code.js +++ b/src/screens/ShoppingCart/components/Code.js @@ -48,10 +48,15 @@ function Code({ codeId, setCodeId, theme, loading }) { } style={[ tw("border-0 flex-1 text-right pr-3"), - { fontSize: fontSize.tiny, fontFamily: "regular" }, + { + fontSize: fontSize.tiny, + fontFamily: "regular", + color: + theme === "light" ? Colors.theme1.gray20 : Colors.theme1.white, + }, ]} placeholder={"کد تخفیف دارید ؟"} - placeholderTextColor={Colors.theme1.gray20 + "aa"} + placeholderTextColor={theme === 'light' ? Colors.theme1.gray20 + "aa" : Colors.theme1.white + 'aa'} value={value} /> @@ -121,6 +128,10 @@ function Product({ { fontSize: mobile ? fontSize.xs : fontSize.tiny, fontFamily: "regular", + color: + theme === "light" + ? Colors.theme1.gray20 + : Colors.theme1.white, }, ]} > @@ -131,6 +142,10 @@ function Product({ { fontSize: mobile ? fontSize.lg : fontSize.xl, fontFamily: "regular", + color: + theme === "light" + ? Colors.theme1.gray20 + : Colors.theme1.white, }, ]} > @@ -257,7 +272,18 @@ function Product({ }` )} > - + {" " + "تومان"} diff --git a/src/screens/ShoppingCart/index.js b/src/screens/ShoppingCart/index.js index 925653d..a8da81f 100644 --- a/src/screens/ShoppingCart/index.js +++ b/src/screens/ShoppingCart/index.js @@ -41,7 +41,8 @@ const PriceStatus = ({ name, value, type, theme }) => { tw(""), { fontSize: fontSize.tiny, - color: Colors.theme1.gray20, + color: + theme === "light" ? Colors.theme1.gray20 : Colors.theme1.white, fontFamily: "bold", }, ]} @@ -55,7 +56,9 @@ const PriceStatus = ({ name, value, type, theme }) => { color: type === "error" ? Colors.theme1.redFF1 - : Colors.theme1.green79, + : theme === "light" + ? Colors.theme1.green79 + : Colors.theme1.white, fontSize: fontSize.xl, fontFamily: "bold", }, @@ -69,7 +72,9 @@ const PriceStatus = ({ name, value, type, theme }) => { color: type === "error" ? Colors.theme1.redFF1 - : Colors.theme1.green79, + : theme === "light" + ? Colors.theme1.green79 + : Colors.theme1.white, fontSize: fontSize.sm, fontFamily: "regular", marginRight: 4, @@ -154,7 +159,9 @@ function ShoppingCart({
@@ -304,11 +332,10 @@ export default connect(mapStateToProps, mapDispatchToProps)(ShoppingCart); const styles = StyleSheet.create({ contentContainerStyle: { - paddingBottom: 50, + paddingBottom: 120, position: "relative", }, container: { - backgroundColor: "white", flexDirection: "column", paddingVertical: 5, paddingHorizontal: 16, diff --git a/src/screens/Splash/index.js b/src/screens/Splash/index.js index 1ae9d95..9138b14 100644 --- a/src/screens/Splash/index.js +++ b/src/screens/Splash/index.js @@ -85,7 +85,6 @@ function Splash({ }} /> - ); diff --git a/src/screens/Video/components/Season.js b/src/screens/Video/components/Season.js index f95f64c..3899e2b 100644 --- a/src/screens/Video/components/Season.js +++ b/src/screens/Video/components/Season.js @@ -40,7 +40,7 @@ const Season = ({ tw("w-full flex overflow-hidden mb-3"), { borderBottomWidth: 1, - borderColor: Colors.theme1.grayE3, + borderColor: Colors.theme1.grayE3 + (theme === "light" ? "" : "55"), }, ]} > @@ -56,7 +56,10 @@ const Season = ({ { fontFamily: "bold", fontSize: mobile ? fontSize.base : fontSize.lg, - color: Colors.theme1.green79, + color: + theme === "light" + ? Colors.theme1.green79 + : Colors.theme1.white, }, ]} > @@ -68,7 +71,10 @@ const Season = ({ { fontFamily: "regular", fontSize: mobile ? fontSize.base : fontSize.lg, - color: Colors.theme1.green79, + color: + theme === "light" + ? Colors.theme1.green79 + : Colors.theme1.white, }, ]} > @@ -82,7 +88,9 @@ const Season = ({ borderColor: Number(index) === 0 ? Colors.theme1.greenCF - : Colors.theme1.gray2077, + : theme === "light" + ? Colors.theme1.gray2077 + : Colors.theme1.white + "66", }, ]} onPress={() => @@ -104,7 +112,9 @@ const Season = ({ color: Number(index) === 0 ? Colors.theme1.greenCF - : Colors.theme1.gray2077, + : theme === "light" + ? Colors.theme1.gray2077 + : Colors.theme1.white + "66", }} > نمایش @@ -134,7 +144,10 @@ const Season = ({ { fontFamily: "bold", fontSize: mobile ? fontSize.base : fontSize.xl, - color: Colors.theme1.green79, + color: + theme === "light" + ? Colors.theme1.green79 + : Colors.theme1.greenC8, }, ]} > @@ -149,7 +162,9 @@ const Season = ({ season[0].categoryId === activeSeason ? "arrow-up" : "arrow-down" } size={14} - color={Colors.theme1.green79} + color={ + theme === "light" ? Colors.theme1.green79 : Colors.theme1.greenC8 + } /> {season[0]?.categoryId === activeSeason diff --git a/src/screens/Video/index.js b/src/screens/Video/index.js index fb9e252..d82453b 100644 --- a/src/screens/Video/index.js +++ b/src/screens/Video/index.js @@ -130,7 +130,10 @@ function Product({ @@ -111,8 +111,6 @@ const styles = StyleSheet.create({ paddingBottom: 100, }, container: { - backgroundColor: "white", - flexDirection: "column", paddingVertical: 5, paddingHorizontal: 16, }, diff --git a/src/screens/Videos/components/MostViewedVideo.js b/src/screens/Videos/components/MostViewedVideo.js index 3147564..67ed27e 100644 --- a/src/screens/Videos/components/MostViewedVideo.js +++ b/src/screens/Videos/components/MostViewedVideo.js @@ -69,7 +69,8 @@ function MostViewedVideo({ videos, grades, mobile, theme }) { fontSize: mobile ? fontSize.base : fontSize.xl, marginTop: 5, paddingRight: 4, - color: Colors.theme1.gray20, + color: + theme === "light" ? Colors.theme1.gray20 : Colors.theme1.white, fontFamily: "regular", }} > @@ -85,7 +86,10 @@ function MostViewedVideo({ videos, grades, mobile, theme }) { -
+