reza changed activation and faq color

master
Reza_ashrafi 3 years ago
parent 26f18dc08e
commit d13297bd6f
  1. 30
      navigation/index.js
  2. 27
      src/redux/actions/activation.js
  3. 1
      src/redux/actions/index.js
  4. 40
      src/redux/reducers/activation.js
  5. 1
      src/redux/reducers/index.js
  6. BIN
      src/screens/Activation/assets/alert.png
  7. BIN
      src/screens/Activation/assets/book.png
  8. 67
      src/screens/Activation/index.js
  9. 38
      src/screens/Faq/components/Instance.js

@ -1,6 +1,6 @@
import React, { useEffect } from "react"; import React, { useEffect } from "react";
import Svg, { G, Path } from "react-native-svg"; import Svg, { G, Path } from "react-native-svg";
import {Appearance} from 'react-native'; import { Appearance } from "react-native";
import { NavigationContainer } from "@react-navigation/native"; import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack"; import { createNativeStackNavigator } from "@react-navigation/native-stack";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs"; import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
@ -38,7 +38,6 @@ import fontSize from "../src/constants/fontSize";
import Colors from "../src/constants/Colors"; import Colors from "../src/constants/Colors";
import tw from "tailwind-react-native-classnames"; import tw from "tailwind-react-native-classnames";
const Tab = createBottomTabNavigator(); const Tab = createBottomTabNavigator();
const BottomTabNavigator = () => { const BottomTabNavigator = () => {
const colorScheme = Appearance.getColorScheme(); const colorScheme = Appearance.getColorScheme();
@ -178,11 +177,7 @@ const BottomTabNavigator = () => {
title: "ویدئوها", title: "ویدئوها",
tabBarIcon: ({ focused, color }) => tabBarIcon: ({ focused, color }) =>
focused ? ( focused ? (
<Svg <Svg xmlns="http://www.w3.org/2000/svg" width={35} height={31.1}>
xmlns="http://www.w3.org/2000/svg"
width={35}
height={31.100}
>
<G data-name="Group 2000"> <G data-name="Group 2000">
<Path <Path
d="M25.421 29.241H8.974C4.04 29.241.75 26.392.75 19.744V10.25c0-6.651 3.29-9.5 8.224-9.5h16.447c4.935 0 8.229 2.849 8.229 9.5v9.5c0 6.642-3.294 9.491-8.229 9.491Z" d="M25.421 29.241H8.974C4.04 29.241.75 26.392.75 19.744V10.25c0-6.651 3.29-9.5 8.224-9.5h16.447c4.935 0 8.229 2.849 8.229 9.5v9.5c0 6.642-3.294 9.491-8.229 9.491Z"
@ -205,11 +200,7 @@ const BottomTabNavigator = () => {
</G> </G>
</Svg> </Svg>
) : ( ) : (
<Svg <Svg xmlns="http://www.w3.org/2000/svg" width={35} height={32}>
xmlns="http://www.w3.org/2000/svg"
width={35}
height={32}
>
<G data-name="Group 1999"> <G data-name="Group 1999">
<Path <Path
d="M25.421 29.241H8.974C4.04 29.241.75 26.392.75 19.744V10.25c0-6.651 3.29-9.5 8.224-9.5h16.447c4.935 0 8.229 2.849 8.229 9.5v9.5c0 6.642-3.294 9.491-8.229 9.491Z" d="M25.421 29.241H8.974C4.04 29.241.75 26.392.75 19.744V10.25c0-6.651 3.29-9.5 8.224-9.5h16.447c4.935 0 8.229 2.849 8.229 9.5v9.5c0 6.642-3.294 9.491-8.229 9.491Z"
@ -359,7 +350,13 @@ const HomeStackScreen = () => {
const ProductsStack = createNativeStackNavigator(); const ProductsStack = createNativeStackNavigator();
const ProductsStackScreen = () => { const ProductsStackScreen = () => {
return ( return (
<ProductsStack.Navigator screenOptions={{ headerShown: false }} initialRouteName="Products"> <ProductsStack.Navigator
screenOptions={{
headerShown: false,
contentStyle: { backgroundColor: "white" },
}}
initialRouteName="Products"
>
<ProductsStack.Screen name="Products" component={Products} /> <ProductsStack.Screen name="Products" component={Products} />
<ProductsStack.Screen name="Product" component={Product} /> <ProductsStack.Screen name="Product" component={Product} />
</ProductsStack.Navigator> </ProductsStack.Navigator>
@ -385,7 +382,7 @@ const CARTStackScreen = () => {
<CARTStack.Screen name="DeliveryForm" component={DeliveryForm} /> <CARTStack.Screen name="DeliveryForm" component={DeliveryForm} />
</CARTStack.Navigator> </CARTStack.Navigator>
); );
} };
const PROFILEStack = createNativeStackNavigator(); const PROFILEStack = createNativeStackNavigator();
const PROFILEStackScreen = () => { const PROFILEStackScreen = () => {
@ -408,7 +405,10 @@ const Navigation = ({ getStatus, isLogin }) => {
<NavigationContainer> <NavigationContainer>
<Stack.Navigator <Stack.Navigator
// initialRouteName="Root" // initialRouteName="Root"
screenOptions={{ headerShown: false, contentStyle : {backgroundColor : 'white'} }} screenOptions={{
headerShown: false,
contentStyle: { backgroundColor: "white" },
}}
> >
<Stack.Screen name="Splash" component={Splash} /> <Stack.Screen name="Splash" component={Splash} />
<Stack.Screen name="QR" component={QR} /> <Stack.Screen name="QR" component={QR} />

@ -0,0 +1,27 @@
import proxy from "../proxy";
const activation = {
list:
(data = {}) =>
async (dispatch) =>
await proxy.get("activation/list", data, { dispatch }),
update:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.put("activation/update", data);
await proxy.get("activation/list", data2, { dispatch });
},
add:
(data = {}) =>
async (dispatch) => {
await proxy.post("activation/add", data);
},
del:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.delete("activation/delete", data);
await proxy.get("activation/list", data2, { dispatch });
},
};
export default activation;

@ -12,3 +12,4 @@ export { default as file } from "./file";
export { default as qr } from "./qr"; export { default as qr } from "./qr";
export {default as userAddress} from "./userAddress"; export {default as userAddress} from "./userAddress";
export { default as transport } from "./transport"; export { default as transport } from "./transport";
export { default as activation } from "./activation";

@ -0,0 +1,40 @@
import { asyncAwesomeAlert } from "../../utils/AsyncWrappers";
const initialState = {
loading: false,
error: null,
list: [],
message: null,
};
export default function activation(state = initialState, action) {
let { type, data } = action;
switch (type) {
case "activation/list":
return { ...state, loading: false, list: data, error: null };
case "activation/update":
return { ...state, loading: false, error: null, message: data.message };
case "activation/add":
asyncAwesomeAlert("نتیجه", data.message, {
showCancelButton: false,
});
console.log(data.message);
return { ...state, loading: false, error: null };
case "activation/delete":
return { ...state, loading: false, error: null };
case "loading":
return { ...state, loading: true };
case "error":
console.log(data.message);
asyncAwesomeAlert("خطا", data.message, {
showCancelButton: false,
});
return {
...state,
loading: false,
error: data.message,
message: data.message,
};
default:
return state;
}
}

@ -11,3 +11,4 @@ export { default as userProduct } from "./userProduct";
import { default as qr } from "./qr"; import { default as qr } from "./qr";
export { default as userAddress } from "./userAddress"; export { default as userAddress } from "./userAddress";
export { default as transport } from "./transport"; export { default as transport } from "./transport";
export { default as activation } from "./activation";

Binary file not shown.

Before

Width:  |  Height:  |  Size: 684 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

File diff suppressed because one or more lines are too long

@ -1,20 +1,34 @@
import { View, Text, Dimensions, TouchableOpacity } from "react-native"; import {
View,
Text,
Dimensions,
TouchableOpacity,
Appearance,
} from "react-native";
import { Entypo } from "@expo/vector-icons"; import { Entypo } from "@expo/vector-icons";
//style
import tw from "tailwind-rn"; import tw from "tailwind-rn";
import fontSize from '../../../constants/fontSize'; import fontSize from "../../../constants/fontSize";
import Colors from "../../../constants/Colors";
const { width } = Dimensions.get("window"); const { width } = Dimensions.get("window");
function Instance({ question, selectFaq }) { function Instance({ question, selectFaq }) {
const colorScheme = Appearance.getColorScheme();
return ( return (
<TouchableOpacity <TouchableOpacity
onPress={() => selectFaq(question.id)} onPress={() => selectFaq(question.id)}
style={[ style={[
tw("w-full flex flex-col my-1.5 rounded-md px-4 py-2"), tw("w-full flex flex-col my-1.5 rounded-md px-4 py-2"),
{ {
backgroundColor: !question.active ? "#F9F9F9" : "#F6F9FD", backgroundColor: !question.active
borderColor: !question.active ? "#DBDBDB" : "#196EC0", ? "#F9F9F9"
borderWidth: 1, : Colors.theme1[colorScheme].greenCF + "0a",
borderColor: !question.active
? "#DBDBDB"
: Colors.theme1[colorScheme].greenCF,
borderWidth: 1.5,
}, },
]} ]}
> >
@ -24,8 +38,8 @@ function Instance({ question, selectFaq }) {
{ {
width: "90%", width: "90%",
textAlign: "right", textAlign: "right",
color: "#196EC0", color: Colors.theme1[colorScheme].green79,
fontSize: fontSize.sm, fontSize: fontSize.tiny,
fontFamily: "bold", fontFamily: "bold",
}, },
]} ]}
@ -33,16 +47,20 @@ function Instance({ question, selectFaq }) {
{question.title} {question.title}
</Text> </Text>
{question.active ? ( {question.active ? (
<Entypo name="minus" size={18} color="#196EC0" /> <Entypo name="minus" size={18} color={Colors.theme1[colorScheme].green79} />
) : ( ) : (
<Entypo name="plus" size={18} color="#196EC0" /> <Entypo name="plus" size={18} color={Colors.theme1[colorScheme].green79} />
)} )}
</View> </View>
{question.active && ( {question.active && (
<View style={tw("w-full flex flex-row-reverse pt-2")}> <View style={tw("w-full flex flex-row-reverse pt-2")}>
<Text <Text
style={[ style={[
{ color: "#196EC0", fontSize: fontSize.sm, fontFamily: "light" }, {
color: Colors.theme1[colorScheme].green79,
fontSize: fontSize.tiny,
fontFamily: "light",
},
tw("text-right flex-1"), tw("text-right flex-1"),
]} ]}
> >

Loading…
Cancel
Save