reza fixed some bugs

master
Reza_ashrafi 3 years ago
parent 5dc7b0d1bf
commit 95d927b727
  1. 4
      App.js
  2. 26
      navigation.js
  3. 54
      navigation/BottomNavigation.js
  4. 46
      navigation/index.js
  5. 6
      package.json
  6. 71
      src/components/Navbar.js
  7. 4
      src/components/Pressable.js
  8. 2
      src/components/Progress.js
  9. 4
      src/components/Search.js
  10. 2
      src/screens/Home/components/Blogs.js
  11. 2
      src/screens/Home/components/Header.js
  12. 40
      src/screens/Home/index.js
  13. 76
      src/screens/Product/index.js
  14. 12
      src/screens/Products/components/Book.js
  15. 65
      src/screens/Products/components/Video.js
  16. 102
      src/screens/Products/index.js
  17. 2
      src/screens/QR/Content/Links.js
  18. 2
      src/screens/QR/Content/PDF.js
  19. 2
      src/screens/QR/Content/PPT.js
  20. 40
      src/screens/QR/Scanner.js
  21. 145
      src/screens/QR/index.js
  22. 12
      src/screens/ShoppingCart/components/Product.js
  23. 110
      src/screens/ShoppingCart/index.js
  24. 6551
      yarn-error.log
  25. 59
      yarn.lock

@ -8,7 +8,7 @@ import thunk from "redux-thunk";
import { persistStore, persistReducer } from "redux-persist";
import autoMergeLevel2 from "redux-persist/lib/stateReconciler/autoMergeLevel2";
import allReducers from "./src/reducers";
import Navigator from "./navigation";
import Navigation from "./navigation/index";
import AlertModal from "./src/components/AlertModal";
const persistConfig = {
@ -47,7 +47,7 @@ const App = () => {
return (
<Provider store={store}>
<Navigator />
<Navigation />
<AlertModal />
</Provider>
);

@ -10,7 +10,6 @@ import Product from './src/screens/Product';
import Products from './src/screens/Products';
import ShoppingCart from './src/screens/ShoppingCart';
import QR from './src/screens/QR/index';
import {connect} from 'react-redux';
import i18n from './src/services/i18n';
import {useTranslation} from 'react-i18next';
import Profile from './src/screens/Profile';
@ -29,40 +28,27 @@ const Stack = createNativeStackNavigator();
const Tab = createBottomTabNavigator();
function BottomTab(props) {
const {t} = useTranslation('translation', {keyPrefix: 'main'});
return (
<Tab.Navigator initialRouteName={'Home'}>
<Tab.Screen
name={'Profile'}
component={Profile}
options={{
title: t('profile'),
}}
/>
<Tab.Screen
name={'Exams'}
component={Exams}
options={{
title: t('exams'),
}}
/>
<Tab.Screen
name={'Videos'}
component={Videos}
options={{
title: t('videos'),
}}
/>
<Tab.Screen
name={'OrderDetails'}
component={OrderDetails}
options={{
title: t('books'),
}}
name={'محصولات'}
component={Products}
/>
<Tab.Screen
name={'Home'}
name={'خانه'}
component={Home}
options={{
headerShown : false
@ -75,7 +61,7 @@ function BottomTab(props) {
function Navigator(props) {
React.useEffect(() => {
i18n.changeLanguage(props.config.lan);
// i18n.changeLanguage(props.config.lan);
}, [props.config]);
return (
@ -113,7 +99,7 @@ function Navigator(props) {
/>
<Stack.Screen
name="Products"
component={Products}
component={BottomTab}
options={{headerShown: false}}
/>
<Stack.Screen name="QR" component={QR} options={{headerShown: true}} />
@ -127,4 +113,4 @@ function Navigator(props) {
);
}
export default connect(mapStateToProps)(Navigator);
export default Navigator;

@ -0,0 +1,54 @@
import React from "react";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import Home from "../src/screens/Home";
import ShoppingCart from '../src/screens/ShoppingCart';
import Products from "../src/screens/Products";
import { Entypo, FontAwesome } from "@expo/vector-icons";
const Tab = createBottomTabNavigator();
const BottomTabNavigator = () => {
return (
<Tab.Navigator
initialRouteName="Home"
screenOptions={{
headerShown: false,
tabBarActiveTintColor: "white",
tabBarInactiveTintColor: "grey",
tabBarStyle: {
backgroundColor: "#181818",
},
}}
>
<Tab.Screen
name="Home"
component={Home}
options={{
tabBarIcon: ({ focused, color }) => (
<Entypo name="home" size={focused ? 30 : 25} color={color} />
),
}}
/>
<Tab.Screen
name="Products"
component={Products}
options={{
tabBarIcon: ({ focused, color }) => (
<Entypo name="shop" size={focused ? 30 : 25} color={color} />
),
}}
/>
<Tab.Screen
name="ShoppingCart"
component={ShoppingCart}
options={{
tabBarIcon: ({ focused, color }) => (
<FontAwesome name="shopping-cart" size={focused ? 30 : 25} color={color} />
),
}}
/>
</Tab.Navigator>
);
};
export default BottomTabNavigator;

@ -0,0 +1,46 @@
import React from "react";
import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import BottomTabNavigator from "./BottomNavigation";
import Splash from "../src/screens/Splash";
import Home from "../src/screens/Home";
import Login from "../src/screens/Login";
import Otp from "../src/screens/Otp";
import Product from "../src/screens/Product";
import QR from "../src/screens/QR/index";
import { connect } from "react-redux";
import i18n from "../src/services/i18n";
import { useTranslation } from "react-i18next";
import Profile from "../src/screens/Profile";
import Videos from "../src/screens/Videos";
import Exams from "../src/screens/Exams";
import OrderDetails from "../src/screens/OrderDetails";
const Stack = createNativeStackNavigator();
const Navigation = () => {
return (
<NavigationContainer>
<Stack.Navigator
initialRouteName="Root"
screenOptions={{ headerShown: false }}
>
<Stack.Screen name="Root" component={BottomTabNavigator} />
<Stack.Screen name="Product" component={Product} />
<Stack.Screen name="Login" component={Login} />
<Stack.Screen name="Otp" component={Otp} />
<Stack.Screen name="Splash" component={Splash} />
<Stack.Screen name="QR" component={QR} />
</Stack.Navigator>
</NavigationContainer>
);
};
const mapStateToProps = (state) => {
return {
profile: state.profile,
config: state.config,
};
};
export default connect(mapStateToProps)(Navigation);

@ -14,16 +14,20 @@
"@react-navigation/bottom-tabs": "^6.0.9",
"@react-navigation/native": "^6.0.6",
"@react-navigation/native-stack": "^6.2.5",
"expo": "~44.0.0",
"expo": "^44.0.1",
"expo-barcode-scanner": "~11.2.0",
"expo-camera": "~12.1.0",
"expo-device": "~4.1.0",
"expo-status-bar": "~1.2.0",
"i18next": "^21.6.3",
"install": "^0.13.0",
"lodash": "^4.17.21",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-i18next": "^11.15.1",
"react-native": "0.64.3",
"react-native-awesome-alerts": "^1.5.2",
"react-native-qrcode-scanner": "^1.5.4",
"react-native-restart": "^0.0.22",
"react-native-safe-area-context": "3.3.2",
"react-native-screens": "~3.10.1",

@ -1,64 +1,79 @@
import React, {useCallback} from 'react';
import {Image, StyleSheet, View, TouchableOpacity} from 'react-native';
import {useNavigation} from '@react-navigation/native';
import tw from 'tailwind-rn';
import React, { useCallback } from "react";
import {
Image,
StyleSheet,
View,
Pressable,
} from "react-native";
import { useNavigation } from "@react-navigation/native";
import tw from "tailwind-rn";
//colors
import Color from '../constants/Colors';
import Color from "../constants/Colors";
//assets
import hamburgerLightIcon from '../assets/icons/hamburger-light.png';
import logoIcon from '../assets/icons/logo.png';
import qrLightIcon from '../assets/icons/qr-light.png';
import arLightIcon from '../assets/icons/ar-light.png';
import hamburgerLightIcon from "../assets/icons/hamburger-light.png";
import logoIcon from "../assets/icons/logo.png";
import qrLightIcon from "../assets/icons/qr-light.png";
import arLightIcon from "../assets/icons/ar-light.png";
const Navbar = ({notification}) => {
const Navbar = ({ notification }) => {
const navigation = useNavigation();
const Button = useCallback(({icon, route}) => {
const Button = useCallback(({ icon, route }) => {
return (
<TouchableOpacity
<Pressable
style={[
tw('rounded-sm p-1'),
tw("rounded-sm p-1"),
{
backgroundColor: Color.theme1.light.blue1,
borderColor: Color.theme1.light.blue2,
borderWidth: 1,
marginLeft : route === 'ar' ? 10 : 0
marginLeft: route === "ar" ? 10 : 0,
},
]}
onPress={() => navigation.navigate(route)}>
<Image source={icon} style={{width: 20, height: 20}} />
</TouchableOpacity>
onPress={() => navigation.navigate(route)}
>
<Image source={icon} style={{ width: 20, height: 20 }} />
</Pressable>
);
}, []);
return (
<View
style={tw(
'w-full flex flex-row-reverse justify-between h-16 bg-white items-center px-4 relative',
)}>
<View style={tw('relative')}>
<Image source={hamburgerLightIcon} style={{width: 29.5, height: 27}} />
"w-full flex flex-row-reverse justify-between h-16 bg-white items-center px-4 relative"
)}
>
<View style={tw("relative")}>
<Image
source={hamburgerLightIcon}
style={{ width: 29.5, height: 27 }}
/>
{notification && (
<View
style={tw(
'h-2.5 w-2.5 absolute -left-1 -top-1 bg-red-500 rounded-full',
)}></View>
"h-2.5 w-2.5 absolute -left-1 -top-1 bg-red-500 rounded-full"
)}
></View>
)}
</View>
<Pressable
onPress={() => navigation.navigate("Home")}
style={tw("absolute right-1/2 top-1/2")}
>
<Image
source={logoIcon}
style={[
tw('absolute right-1/2 top-1/2'),
{
width: 19.6,
height: 28.9,
transform: [{translateX: 0}, {translateY: -14.5}],
transform: [{ translateX: 0 }, { translateY: -14.5 }],
},
]}
/>
<View style={tw('flex flex-row items-center')}>
<Button icon={qrLightIcon} route={'qr'} />
<Button icon={arLightIcon} route={'ar'} />
</Pressable>
<View style={tw("flex flex-row items-center")}>
<Button icon={qrLightIcon} route={"QR"} />
<Button icon={arLightIcon} route={"ar"} />
</View>
</View>
);

@ -14,7 +14,7 @@ export default function Pressable1({
return (
<Pressable
style={[
tw.style('rounded-md py-4 flex flex-row justify-center mb-3'),
tw.style('rounded-md py-3 flex flex-row justify-center mb-3'),
{
backgroundColor: backgroundColor,
borderWidth: border.width,
@ -22,7 +22,7 @@ export default function Pressable1({
width : width,
},
]}>
<Text style={{fontSize: fullWidth / 27, color: color}}>{title}</Text>
<Text style={{fontSize: 14, color: color}}>{title}</Text>
</Pressable>
);
}

@ -20,7 +20,7 @@ function Progress({percent}) {
]}>
<View
style={[
tw('h-full transition-all duration-500 rounded-full'),
tw('h-full rounded-full'),
{
backgroundColor: Color.theme1.light.blue3,
width: percent + '%',

@ -24,7 +24,7 @@ const Search = ({
color: '#000',
borderWidth: 0.5,
borderColor: '#DBDBDB',
paddingVertical: 16,
paddingVertical: 4,
paddingHorizontal: 10,
direction: direction,
textAlign: textAlign,
@ -40,7 +40,7 @@ const Search = ({
placeholderTextColor={'#cccccc'}
value={value}
/>
<Pressable style={tw.style('absolute left-3 top-0 transform inset-y-4')}>
<Pressable style={tw.style('absolute left-3 top-0 transform inset-y-2')}>
<Image source={searchIcon} style={[{width: 20, height: 20}]} />
</Pressable>
</View>

@ -32,7 +32,7 @@ function Blogs({products}) {
<FlatList
horizontal={true}
inverted={true}
style={[tw('flex flex-col-reverse mt-3')]}
style={[tw('flex flex-row mt-3')]}
data={products}
renderItem={({blog, index}) => <Blog blog={blog} key={index} />}
/>

@ -12,7 +12,7 @@ const Header = ({title, route}) => {
return (
<View style={tw('w-full flex flex-row-reverse justify-between mb-2')}>
<Text
style={[tw('text-2xl font-bold'), {color: Color.theme1.light.blue5}]}>
style={[tw('text-lg font-bold'), {color: Color.theme1.light.blue5}]}>
{title}
</Text>
<Pressable onPress={() => navigation.navigate(route)}>

@ -1,34 +1,36 @@
import React from 'react';
import {useTranslation} from 'react-i18next';
import React from "react";
import { useTranslation } from "react-i18next";
import {
View,
StyleSheet,
Dimensions,
ScrollView,
SafeAreaView,
} from 'react-native';
import Navbar from '../../components/Navbar';
import tw from 'tailwind-rn';
import Scroll from './components/Scroll';
import MyBooks from './components/MyBooks';
import Videos from './components/Videos';
import Blogs from './components/Blogs';
Platform,
StatusBar,
} from "react-native";
import Navbar from "../../components/Navbar";
import tw from "tailwind-rn";
import Scroll from "./components/Scroll";
import MyBooks from "./components/MyBooks";
import Videos from "./components/Videos";
import Blogs from "./components/Blogs";
import qrIcon from './assets/qr.png';
import arIcon from './assets/ar.png';
// import { SafeAreaView } from 'react-native-safe-area-context';
// Within your render function
function Home(props) {
return (
<SafeAreaView>
<SafeAreaView
style={{
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0
}}
>
<Navbar />
<ScrollView
contentContainerStyle={styles.contentContainerStyle}
style={[
styles.container,
tw('w-full flex flex-col'),
]}>
style={[styles.container, tw("w-full flex flex-col")]}
>
<MyBooks />
<Scroll />
<Videos />
@ -44,9 +46,9 @@ const styles = StyleSheet.create({
paddingBottom: 100,
},
container: {
width: Dimensions.get('window').width,
backgroundColor: 'white',
flexDirection: 'column',
width: Dimensions.get("window").width,
backgroundColor: "white",
flexDirection: "column",
paddingVertical: 0,
paddingHorizontal: 0,
},

@ -1,74 +1,90 @@
import React from 'react';
import {View, StyleSheet, Dimensions, ScrollView} from 'react-native';
import Book from './components/Book';
import Video from './components/Video';
import {connect} from 'react-redux';
import userImage from './assets/user.png';
import poster from './assets/poster.png';
import React from "react";
import {
View,
StyleSheet,
Dimensions,
ScrollView,
SafeAreaView,
StatusBar,
} from "react-native";
import Book from "./components/Book";
import Video from "./components/Video";
import { connect } from "react-redux";
import userImage from "./assets/user.png";
import poster from "./assets/poster.png";
import Navbar from "../../components/Navbar";
function Product({
product = {
type: 'ویدئوها',
name: 'ریاضی',
price: '145.000 تومان',
imageUrl: 'https://dnvn.ir/api/v1/file/2105',
poster : poster,
grade: 'پایه هفتم ابتدایی',
text: 'خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ” ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ ﻫﺮﮔﺰ ﺩﺯﺩﯼ ﻧﮑﻦ ” ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻭ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ',
type: "ویدئوها",
name: "ریاضی",
price: "145.000 تومان",
imageUrl: "https://dnvn.ir/api/v1/file/2105",
poster: poster,
grade: "پایه هفتم ابتدایی",
text: "خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ” ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ ﻫﺮﮔﺰ ﺩﺯﺩﯼ ﻧﮑﻦ ” ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻭ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ",
description:
'خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ” ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ ﻫﺮﮔﺰ ﺩﺯﺩﯼ ﻧﮑﻦ ” ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻭ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ﻣﻌﻨﺎ ﮐﻪ ﺍﻭ ﻫﺮﮔﺰ ﺩﺳﺖ ﮐﺞ ﻧﺪﺍﺷﺘﻪ ﭘﺪﺭ ﺑﻪ ﻧﮕﺎﻩ ﻣﺘﻌﺠﺐ ﻓﺮﺯﻧﺪ ﻟﺒﺨﻨﺪﯼ ﺯﺩ ﻭ ﺍﺩﺍﻣﻪ ﺩﺍﺩ : ﺩﺭ ﺯﻧﺪﮔﯽ ﺩﺭﻭﻍ ﻧﮕﻮ ﭼﺮﺍ ﮐﻪ ﺍﮔﺮ ﮔﻔﺘﯽ ﺻﺪﺍﻗﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺧﯿﺎﻧﺖ ﻧﮑﻦ ﮐﻪ ﺍﮔﺮ ﮐﺮﺩﯼ ﻋﺸﻖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺧﺸﻮﻧﺖ ﻧﮑﻦ ﺍﮔﺮ ﮐﺮﺩﯼ ﻣﺤﺒﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﻧﺎ ﺣﻖ ﻧﮕﻮ ﺍﮔﺮ ﮔﻔﺘﯽ ﺣﻖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺑﯽ ﺣﯿﺎﯾﯽ ﻧﮑﻦ ﺍﮔﺮ ﮐﺮﺩﯼ ﺷﺮﺍﻓﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍی... ﭘﺲ ﺩﺭ ﺯﻧﺪﮔﯽ ﻓﻘﻂ ﺩﺯﺩﯼ نکن ',
"خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ” ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ ﻫﺮﮔﺰ ﺩﺯﺩﯼ ﻧﮑﻦ ” ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻭ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ﻣﻌﻨﺎ ﮐﻪ ﺍﻭ ﻫﺮﮔﺰ ﺩﺳﺖ ﮐﺞ ﻧﺪﺍﺷﺘﻪ ﭘﺪﺭ ﺑﻪ ﻧﮕﺎﻩ ﻣﺘﻌﺠﺐ ﻓﺮﺯﻧﺪ ﻟﺒﺨﻨﺪﯼ ﺯﺩ ﻭ ﺍﺩﺍﻣﻪ ﺩﺍﺩ : ﺩﺭ ﺯﻧﺪﮔﯽ ﺩﺭﻭﻍ ﻧﮕﻮ ﭼﺮﺍ ﮐﻪ ﺍﮔﺮ ﮔﻔﺘﯽ ﺻﺪﺍﻗﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺧﯿﺎﻧﺖ ﻧﮑﻦ ﮐﻪ ﺍﮔﺮ ﮐﺮﺩﯼ ﻋﺸﻖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺧﺸﻮﻧﺖ ﻧﮑﻦ ﺍﮔﺮ ﮐﺮﺩﯼ ﻣﺤﺒﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﻧﺎ ﺣﻖ ﻧﮕﻮ ﺍﮔﺮ ﮔﻔﺘﯽ ﺣﻖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺑﯽ ﺣﯿﺎﯾﯽ ﻧﮑﻦ ﺍﮔﺮ ﮐﺮﺩﯼ ﺷﺮﺍﻓﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍی... ﭘﺲ ﺩﺭ ﺯﻧﺪﮔﯽ ﻓﻘﻂ ﺩﺯﺩﯼ نکن ",
rates: {
mid: 4.5,
allRates: 2456,
fields: [
{name: 'field1', value: 49},
{name: 'field2', value: 31},
{name: 'field3', value: 9},
{name: 'field4', value: 5},
{name: 'field5', value: 4},
{ name: "field1", value: 49 },
{ name: "field2", value: 31 },
{ name: "field3", value: 9 },
{ name: "field4", value: 5 },
{ name: "field5", value: 4 },
],
},
comments: [
{
name: 'سورنا عابدی',
name: "سورنا عابدی",
imageUrl: userImage,
vote: 4,
date: new Date(),
message:
'خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ” ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ ﻫﺮﮔﺰ ﺩﺯﺩﯼ ﻧﮑﻦ ” ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻭ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ﻣﻌﻨﺎ ﮐﻪ ﺍﻭ ﻫﺮﮔﺰ ﺩﺳﺖ ﮐﺞ ﻧﺪﺍﺷﺘﻪ ﭘﺪﺭ ﺑﻪ ﻧﮕﺎﻩ ﻣﺘﻌﺠﺐ ﻓﺮﺯﻧﺪ ﻟﺒﺨﻨﺪﯼ ﺯﺩ ﻭ ﺍﺩﺍﻣﻪ ',
"خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ” ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ ﻫﺮﮔﺰ ﺩﺯﺩﯼ ﻧﮑﻦ ” ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻭ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ﻣﻌﻨﺎ ﮐﻪ ﺍﻭ ﻫﺮﮔﺰ ﺩﺳﺖ ﮐﺞ ﻧﺪﺍﺷﺘﻪ ﭘﺪﺭ ﺑﻪ ﻧﮕﺎﻩ ﻣﺘﻌﺠﺐ ﻓﺮﺯﻧﺪ ﻟﺒﺨﻨﺪﯼ ﺯﺩ ﻭ ﺍﺩﺍﻣﻪ ",
},
{
name: 'سورنا عابدی',
name: "سورنا عابدی",
imageUrl: userImage,
vote: 4,
date: new Date(),
message:
'خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ” ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ ﻫﺮﮔﺰ ﺩﺯﺩﯼ ﻧﮑﻦ ” ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻭ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ﻣﻌﻨﺎ ﮐﻪ ﺍﻭ ﻫﺮﮔﺰ ﺩﺳﺖ ﮐﺞ ﻧﺪﺍﺷﺘﻪ ﭘﺪﺭ ﺑﻪ ﻧﮕﺎﻩ ﻣﺘﻌﺠﺐ ﻓﺮﺯﻧﺪ ﻟﺒﺨﻨﺪﯼ ﺯﺩ ﻭ ﺍﺩﺍﻣﻪ ',
"خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ” ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ ﻫﺮﮔﺰ ﺩﺯﺩﯼ ﻧﮑﻦ ” ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻭ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ﻣﻌﻨﺎ ﮐﻪ ﺍﻭ ﻫﺮﮔﺰ ﺩﺳﺖ ﮐﺞ ﻧﺪﺍﺷﺘﻪ ﭘﺪﺭ ﺑﻪ ﻧﮕﺎﻩ ﻣﺘﻌﺠﺐ ﻓﺮﺯﻧﺪ ﻟﺒﺨﻨﺪﯼ ﺯﺩ ﻭ ﺍﺩﺍﻣﻪ ",
},
],
},
}) {
return (
<SafeAreaView
style={{
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0,
}}
>
<Navbar />
<ScrollView
contentContainerStyle={styles.contentContainerStyle}
style={styles.container}>
{product.type === 'ویدئوها' ? (
style={styles.container}
>
{product.type === "ویدئوها" ? (
<Video product={product} />
) : (
<Book product={product} />
)}
</ScrollView>
</SafeAreaView>
);
}
const styles = StyleSheet.create({
contentContainerStyle: {
paddingBottom: 50,
paddingBottom: 100,
},
container: {
width: Dimensions.get('window').width,
backgroundColor: 'white',
flexDirection: 'column',
width: Dimensions.get("window").width,
backgroundColor: "white",
flexDirection: "column",
paddingVertical: 5,
paddingHorizontal: 10,
},

@ -1,5 +1,6 @@
import React from 'react';
import {View, Image, Text, Dimensions} from 'react-native';
import {View, Image, Text, Dimensions, Pressable} from 'react-native';
import { useNavigation } from '@react-navigation/native';
import tw from 'tailwind-react-native-classnames';
const width = Dimensions.get('window').width;
const height = Dimensions.get('window').height;
@ -12,8 +13,9 @@ function Book({
imageUrl: 'https://dnvn.ir/api/v1/file/2105',
},
}) {
const navigation = useNavigation();
return (
<View
<Pressable
style={[
{
width: width / 2 - 20,
@ -26,7 +28,9 @@ function Book({
borderColor: '#ddd',
},
tw.style('flex flex-col items-end p-2 rounded-md'),
]}>
]}
onPress={() => navigation.navigate('Product')}
>
<Image
source={{uri: item.imageUrl}}
style={[tw.style('w-full rounded-md'), {height: height / 3.8}]}
@ -36,7 +40,7 @@ function Book({
</Text>
<Text style={{ color : "#196EC0", fontSize : width / 32, marginTop : 5}}>{'پایه' + ' ' + item.grade }</Text>
<Text style={[tw.style('w-full text-center font-semibold'), {marginTop : 10, color : "#132F52"}]}>{item.price}</Text>
</View>
</Pressable>
);
}

@ -1,22 +1,24 @@
import React from 'react';
import {View, Image, Text, Dimensions} from 'react-native';
import tw from 'tailwind-react-native-classnames';
import posterImage from '../assets/poster.png';
import React from "react";
import { View, Image, Text, Dimensions, Pressable } from "react-native";
import { useNavigation } from "@react-navigation/native";
import tw from "tailwind-react-native-classnames";
import posterImage from "../assets/poster.png";
const width = Dimensions.get('window').width;
const height = Dimensions.get('window').height;
const width = Dimensions.get("window").width;
const height = Dimensions.get("window").height;
function Video({
item = {
name: 'ریاضی',
price: '145.000 تومان',
grade: '4',
imageUrl: 'https://dnvn.ir/api/v1/file/2105',
name: "ریاضی",
price: "145.000 تومان",
grade: "4",
imageUrl: "https://dnvn.ir/api/v1/file/2105",
poster: posterImage,
},
}) {
const navigation = useNavigation();
return (
<View
<Pressable
style={[
{
// shadowColor : "#000",
@ -25,17 +27,20 @@ function Video({
// shadowOpacity : 1,
marginBottom: 15,
borderWidth: 1,
borderColor: '#ddd',
borderColor: "#ddd",
},
tw.style('w-full flex flex-col items-end p-2 rounded-md'),
]}>
tw.style("w-full flex flex-col items-end p-2 rounded-md"),
]}
onPress={() => navigation.navigate("Product")}
>
<View
style={[
tw.style(
'w-full flex flex-row flex-1 justify-between items-center relative overflow-hidden',
"w-full flex flex-row flex-1 justify-between items-center relative overflow-hidden"
),
{height: height / 3.8},
]}>
{ height: height / 3.8 },
]}
>
{/* <View
style={[
tw.style('rounded-full bg-black bg-opacity-20 z-50'),
@ -43,34 +48,36 @@ function Video({
]}></View> */}
<Image
source={item.poster}
style={tw.style('w-full h-full absolute left-0 top-0')}
style={tw.style("w-full h-full absolute left-0 top-0")}
/>
<Image
source={{uri: item.imageUrl}}
source={{ uri: item.imageUrl }}
style={[
tw.style('rounded-md h-full absolute left-2 bottom-2 rounded-md'),
{width: width / 5, height: height / 7},
tw.style("rounded-md h-full absolute left-2 bottom-2 rounded-md"),
{ width: width / 5, height: height / 7 },
]}
/>
</View>
<Text style={{fontSize: width / 22, marginTop: 5, color: '#05335F'}}>
<Text style={{ fontSize: width / 22, marginTop: 5, color: "#05335F" }}>
{item.name}
</Text>
<View
style={tw.style('w-full flex flex-row justify-between items-center')}>
style={tw.style("w-full flex flex-row justify-between items-center")}
>
<Text
style={[
tw.style('font-semibold'),
{marginTop: 10, color: '#132F52'},
]}>
tw.style("font-semibold"),
{ marginTop: 10, color: "#132F52" },
]}
>
{item.price}
</Text>
<Text style={{color: '#196EC0', fontSize: width / 32, marginTop: 5}}>
{'پایه' + ' ' + item.grade}
<Text style={{ color: "#196EC0", fontSize: width / 32, marginTop: 5 }}>
{"پایه" + " " + item.grade}
</Text>
</View>
</View>
</Pressable>
);
}

@ -1,57 +1,75 @@
import React, {useState} from 'react';
import React, { useState } from "react";
import {View, ScrollView, StyleSheet, Dimensions} from 'react-native';
import tw from 'tailwind-react-native-classnames';
import {
View,
ScrollView,
StyleSheet,
Dimensions,
SafeAreaView,
StatusBar,
} from "react-native";
import tw from "tailwind-react-native-classnames";
import {connect} from 'react-redux';
import Book from './components/Book';
import Video from './components/Video';
import Search from '../../components/Search';
import Select from '../../components/Select';
import { connect } from "react-redux";
import Book from "./components/Book";
import Video from "./components/Video";
import Search from "../../components/Search";
import Select from "../../components/Select";
import Navbar from "../../components/Navbar";
function Products({grades, productTypes}) {
const [productType, setProductType] = useState('');
const [grade, setGrade] = useState('');
const [search, setSearch] = useState('');
function Products({ grades, productTypes }) {
const [productType, setProductType] = useState("");
const [grade, setGrade] = useState("");
const [search, setSearch] = useState("");
const onChange = (name, value) => {};
return (
<SafeAreaView
style={{
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0,
}}
>
<Navbar />
<ScrollView
contentContainerStyle={styles.contentContainerStyle}
style={styles.container}>
style={styles.container}
>
<Search
value={search}
onChange={setSearch}
placeholder={'نام کتاب یا دوره را جستجو کنید'}
placeholder={"نام کتاب یا دوره را جستجو کنید"}
/>
<View
style={[
tw.style('flex flex-1 flex-row justify-between items-center'),
{marginTop: 10, width: '100%'},
]}>
tw.style("flex flex-1 flex-row justify-between items-center"),
{ marginTop: 10, width: "100%" },
]}
>
<Select
defaultValue={'کتاب فیزیکی'}
defaultValue={"کتاب فیزیکی"}
value={productType}
onChange={setProductType}
options={productTypes}
width={'48%'}
width={"48%"}
/>
<Select
defaultValue={'همه پایه'}
defaultValue={"همه پایه"}
value={grade}
onChange={setGrade}
options={grades}
width={'48%'}
width={"48%"}
/>
</View>
<View
style={tw.style(
'flex flex-1 w-full py-5 flex-row flex-wrap justify-between bg-white',
)}>
"flex flex-1 w-full py-5 flex-row flex-wrap justify-between bg-white"
)}
>
{[0, 1, 2, 3, 4, 5, 6, 7].map((item, i) =>
productType === 'ویدئوها' ? <Video /> : <Book />,
productType === "ویدئوها" ? <Video /> : <Book />
)}
</View>
</ScrollView>
</SafeAreaView>
);
}
@ -60,10 +78,10 @@ const styles = StyleSheet.create({
paddingBottom: 50,
},
container: {
width: Dimensions.get('window').width,
backgroundColor: 'white',
flexDirection: 'column',
paddingVertical: 5,
width: Dimensions.get("window").width,
backgroundColor: "white",
flexDirection: "column",
paddingVertical: 0,
paddingHorizontal: 10,
},
});
@ -72,19 +90,19 @@ export default Products;
Products.defaultProps = {
grades: [
'پیش دبستان',
'اول',
'دوم',
'سوم',
'چهارم',
'پنجم',
'ششم',
'هفتم',
'هشتم',
'نهم',
'دهم',
'یازدهم',
'دوازدهم',
"پیش دبستان",
"اول",
"دوم",
"سوم",
"چهارم",
"پنجم",
"ششم",
"هفتم",
"هشتم",
"نهم",
"دهم",
"یازدهم",
"دوازدهم",
],
productTypes: ['کتاب فیزیکی', 'کتاب دیجیتال', 'ویدئوها', 'اشتراک'],
productTypes: ["کتاب فیزیکی", "کتاب دیجیتال", "ویدئوها", "اشتراک"],
};

@ -17,7 +17,7 @@ export default function Links({links}) {
</Pressable>
))}
</View>
<Image source={linkIcon} style={{width: 45, height: 50}} />
<Image source={linkIcon} style={{width: 40, height: 40}} />
</View>
);
}

@ -12,7 +12,7 @@ export default function PDF({name, file}) {
<Text style={tw.style('text-right text-xs text-red-900')}>
{name}
</Text>
<Image source={pdfIcon} style={{width: 47, height: 50}} />
<Image source={pdfIcon} style={{width: 40, height: 40}} />
</View>
);
}

@ -12,7 +12,7 @@ export default function PPT({name, file}) {
<Text style={tw.style('text-right text-xs text-green-900')}>
{name}
</Text>
<Image source={pptIcon} style={{width: 45, height: 50}} />
<Image source={pptIcon} style={{width: 40, height: 40}} />
</View>
);
}

@ -1,11 +1,37 @@
import React from 'react'
import { View, Text } from 'react-native'
import tw from 'tailwind-react-native-classnames';
import React, { useState, useEffect } from 'react';
import { Text, View, StyleSheet, Button } from 'react-native';
import { BarCodeScanner } from 'expo-barcode-scanner';
export default function App() {
const [hasPermission, setHasPermission] = useState(null);
const [scanned, setScanned] = useState(false);
useEffect(() => {
(async () => {
const { status } = await BarCodeScanner.requestPermissionsAsync();
setHasPermission(status === 'granted');
})();
}, []);
const handleBarCodeScanned = ({ type, data }) => {
setScanned(true);
alert(`Bar code with type ${type} and data ${data} has been scanned!`);
};
if (hasPermission === null) {
return <Text>Requesting for camera permission</Text>;
}
if (hasPermission === false) {
return <Text>No access to camera</Text>;
}
export default function Scanner() {
return (
<View>
<Text></Text>
<View style={{width : '100%', position : 'relative'}}>
<BarCodeScanner
onBarCodeScanned={scanned ? undefined : handleBarCodeScanned}
style={{width : '100%', height : 300}}
/>
{scanned && <Button title={'Tap to Scan Again'} onPress={() => setScanned(false)} />}
</View>
)
);
}

@ -1,85 +1,97 @@
import React from 'react';
import React, {useState} from "react";
import {
StyleSheet,
View,
Text,
ScrollView,
SafeAreaView,
Image,
Dimensions,
} from 'react-native';
import {connect} from 'react-redux';
import tw from 'tailwind-react-native-classnames';
StatusBar,
} from "react-native";
import { connect } from "react-redux";
import tw from "tailwind-react-native-classnames";
// import Content from './Content';
// import Scanner from './Scanner';
import Voice from './Content/Voice';
import Video from './Content/Video';
import PPT from './Content/PPT';
import PDF from './Content/PDF';
import Links from './Content/Links';
import Scanner from './Scanner';
import Navbar from "../../components/Navbar";
import Voice from "./Content/Voice";
import Video from "./Content/Video";
import PPT from "./Content/PPT";
import PDF from "./Content/PDF";
import Links from "./Content/Links";
import bookmarkIcon from '../../assets/icons/bookmark.png';
import bookmarkIcon from "../../assets/icons/bookmark.png";
const width = Dimensions.get('window').width;
function QR({data}) {
const width = Dimensions.get("window").width;
function QR({ data }) {
return (
<SafeAreaView>
<ScrollView>
<View style={tw.style('flex flex-1 flex-col px-3')}>
<SafeAreaView
style={{
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0,
}}
>
<Navbar />
<ScrollView
contentContainerStyle={styles.contentContainerStyle}
style={styles.container}
>
<Scanner />
{/* <View style={tw.style("flex flex-1 flex-col px-3")}>
<View
style={tw.style(
'flex w-full flex-row-reverse justify-between py-3',
)}>
<View style={tw.style('flex flex-row-reverse')}>
"flex w-full flex-row-reverse justify-between py-3"
)}
>
<View style={tw.style("flex flex-row-reverse")}>
<Image
source={{uri: 'https://dnvn.ir/api/v1/file/2094'}}
style={[tw.style('rounded'), {width: width / 5, height: 120}]}
source={{ uri: "https://dnvn.ir/api/v1/file/2094" }}
style={[tw.style("rounded"), { width: width / 5, height: 120 }]}
/>
<View
style={tw.style('flex flex-column items-end self-end pr-3')}>
<Text style={tw.style('text-md text-green-500 font-semibold')}>
style={tw.style("flex flex-column items-end self-end pr-3")}
>
<Text style={tw.style("text-md text-green-500 font-semibold")}>
{data.name}
</Text>
<Text
style={tw.style('text-xs text-gray-500 font-normal mt-1')}>
style={tw.style("text-xs text-gray-500 font-normal mt-1")}
>
{data.grade}
</Text>
<Text
style={tw.style('text-xs text-gray-500 font-normal mt-1')}>
شما در حال مطالعه{' '}
style={tw.style("text-xs text-gray-500 font-normal mt-1")}
>
شما در حال مطالعه{" "}
<Text
style={tw.style('text-xs text-blue-500 font-medium mt-1')}>
{'صفحه' + ' ' + data.page}
</Text>{' '}
style={tw.style("text-xs text-blue-500 font-medium mt-1")}
>
{"صفحه" + " " + data.page}
</Text>{" "}
هستید.
</Text>
<Text
style={tw.style('text-xs text-gray-500 font-normal mt-1')}>
پیشرفت شما در مطالعه کتاب{' '}
<Text style={tw.style('text-xs text-green-500 font-medium')}>
{data.percent + '' + 'درصد'}
</Text>{' '}
style={tw.style("text-xs text-gray-500 font-normal mt-1")}
>
پیشرفت شما در مطالعه کتاب{" "}
<Text style={tw.style("text-xs text-green-500 font-medium")}>
{data.percent + "" + "درصد"}
</Text>{" "}
میباشد.
</Text>
</View>
</View>
<Image source={bookmarkIcon} style={{width: 27, height: 33}} />
<Image source={bookmarkIcon} style={{ width: 27, height: 33 }} />
</View>
{data.voice && (
<Voice name={data.voice.name} file={data.voice.file} />
)}
{
data.video && <Video name={data.video.name} file={data.voice.file} />
}
{
data.ppt && <PPT name={data.ppt.name} file={data.ppt.file} />
}
{
data.pdf && <PDF name={data.ppt.name} file={data.ppt.file} />
}
{
data.links && <Links links={data.links} />
}
</View>
{data.video && (
<Video name={data.video.name} file={data.voice.file} />
)}
{data.ppt && <PPT name={data.ppt.name} file={data.ppt.file} />}
{data.pdf && <PDF name={data.ppt.name} file={data.ppt.file} />}
{data.links && <Links links={data.links} />}
</View> */}
</ScrollView>
</SafeAreaView>
);
@ -87,16 +99,35 @@ function QR({data}) {
export default QR;
const styles = StyleSheet.create({
contentContainerStyle: {
paddingBottom: 100,
},
container: {
width: Dimensions.get("window").width,
backgroundColor: "white",
flexDirection: "column",
paddingVertical: 5,
paddingHorizontal: 10,
},
});
QR.defaultProps = {
data: {
name: 'ریاضیات گسسته خیلی پیشرفته',
grade: 'پایه هفتم ابتدایی',
page: '67',
percent: '62',
voice: {name: 'استاد رضایی: فصل پنجم توضیح در مورد آتش فشان ها', file: 1},
video: {name: 'ویدئوی آزمایش آتشفشان سرکه ای', file: 1},
pdf: {name : 'فایل پاورپوینت ارائه درس آتشفشان ها', file: 1},
ppt: {name: 'فایل پاورپوینت ارائه درس آتشفشان ها', file: 1},
links: [ "وبسایت آموزشی دانوین" , "وبسایت رسمی مدیریت راهبردی کشور", "سازمان تبلیغات صنایع سبک " ]
name: "ریاضیات گسسته خیلی پیشرفته",
grade: "پایه هفتم ابتدایی",
page: "67",
percent: "62",
voice: { name: "استاد رضایی: فصل پنجم توضیح در مورد آتش فشان ها", file: 1 },
video: { name: "ویدئوی آزمایش آتشفشان سرکه ای", file: 1 },
pdf: { name: "فایل پاورپوینت ارائه درس آتشفشان ها", file: 1 },
ppt: { name: "فایل پاورپوینت ارائه درس آتشفشان ها", file: 1 },
links: [
"وبسایت آموزشی دانوین",
"وبسایت رسمی مدیریت راهبردی کشور",
"سازمان تبلیغات صنایع سبک ",
],
},
};

@ -13,18 +13,18 @@ export default function Product({product}) {
return (
<View
style={[
tw.style('flex flex-row justify-between py-5'),
tw.style('flex flex-row-reverse justify-between py-5'),
{borderBottomWidth: 1, borderColor: '#7070701a', direction: 'rtl'},
]}>
<View style={tw.style('flex flex-row')}>
<View style={tw.style('flex flex-row-reverse')}>
<Image
source={bookImage}
style={[
tw.style('rounded-md'),
{width: width / 4, height: height / 6},
{width: 80, height: 120},
]}
/>
<View style={tw.style('flex flex-col items-start pl-2')}>
<View style={tw.style('flex flex-col items-end pr-2')}>
<Text
style={{fontsize: width / 20, color: '#05335F', marginBottom: 5}}>
علوم اجتماعی
@ -38,10 +38,10 @@ export default function Product({product}) {
</Text>
</View>
</View>
<View style={tw.style('flex flex-col justify-between items-end')}>
<View style={tw.style('flex flex-col justify-between items-start')}>
<Image source={deleteIcon} style={{width: 17, height: 17}} />
<View style={tw.style('flex flex-col items-center')}>
<View style={tw.style('flex flex-row items-center mb-3')}>
<View style={tw.style('flex flex-row-reverse items-center mb-3')}>
<Pressable
style={[
tw.style(

@ -1,4 +1,4 @@
import React, {useState} from 'react';
import React, { useState } from "react";
import {
View,
Text,
@ -6,36 +6,41 @@ import {
Dimensions,
StyleSheet,
Pressable,
Image
} from 'react-native';
import Product from './components/Product';
import Code from './components/Code';
import CustomPressable from '../../components/Pressable';
import tw from 'tailwind-react-native-classnames';
import alertIcon from './assets/alert.png';
Image,
SafeAreaView,
StatusBar,
} from "react-native";
import Product from "./components/Product";
import Code from "./components/Code";
import CustomPressable from "../../components/Pressable";
import Navbar from "../../components/Navbar";
import tw from "tailwind-react-native-classnames";
import alertIcon from "./assets/alert.png";
import {connect} from 'react-redux';
import { connect } from "react-redux";
const width = Dimensions.get('window').width;
const width = Dimensions.get("window").width;
const PriceStatus = ({name, value, type}) => {
const PriceStatus = ({ name, value, type }) => {
return (
<View style={tw.style('w-full flex flex-row-reverse justify-between py-2')}>
<View style={tw.style("w-full flex flex-row-reverse justify-between py-2")}>
<Text
style={[
tw.style('font-light'),
{fontSize: width / 27, color: '#132F52'},
]}>
tw.style("font-light"),
{ fontSize: width / 27, color: "#132F52" },
]}
>
{name}
</Text>
<Text
style={[
tw.style('font-normal'),
tw.style("font-normal"),
{
color: type === 'error' ? '#F1420D' : '#246E8A',
color: type === "error" ? "#F1420D" : "#246E8A",
fontSize: width / 27,
},
]}>
]}
>
{value}
</Text>
</View>
@ -44,18 +49,30 @@ const PriceStatus = ({name, value, type}) => {
function ShoppingCart({}) {
return (
<SafeAreaView
style={{
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0,
}}
>
<Navbar />
<ScrollView
contentContainerStyle={styles.contentContainerStyle}
style={styles.container}>
style={styles.container}
>
{[0, 1].map((product, index) => (
<Product key={index} product={product} />
))}
<Code />
<View
style={tw.style(
'flex flex-col w-full border-t py-2 border-gray-300 border-b mt-6',
)}>
<PriceStatus name="مبلغ سبد خرید" value="265000 تومان" type="normal" />
"flex flex-col w-full border-t py-2 border-gray-300 border-b mt-6"
)}
>
<PriceStatus
name="مبلغ سبد خرید"
value="265000 تومان"
type="normal"
/>
<PriceStatus name="میزان تخفیف" value="0 تومان" type="error" />
<PriceStatus
name="مالیات بر ارزش افزوده"
@ -65,37 +82,48 @@ function ShoppingCart({}) {
</View>
<View
style={tw.style(
'flex flex-row-reverse justify-between items-center w-full py-3',
)}>
<Text style={[tw.style('font-medium'), {fontSize: width / 25}]}>
"flex flex-row-reverse justify-between items-center w-full py-3"
)}
>
<Text style={[tw.style("font-medium"), { fontSize: width / 25 }]}>
جمع کل سبد خرید
</Text>
<Text
style={[
tw.style('font-medium'),
{fontSize: width / 27, color: '#246E8A'},
]}>
tw.style("font-medium"),
{ fontSize: width / 27, color: "#246E8A" },
]}
>
235.000 تومان
</Text>
</View>
<Pressable
style={[
tw.style('w-full rounded-md flex flex-row justify-end items-center py-3.5 px-3 my-5'),
{backgroundColor: '#196EC01a'},
]}>
<Text style={[tw.style(''), {color: '#275077', fontSize: width / 30}]}>
tw.style(
"w-full rounded-md flex flex-row justify-center items-center py-3.5 px-3 my-5"
),
{ backgroundColor: "#196EC01a" },
]}
>
<Text
style={[tw.style(""), { color: "#275077", fontSize: width / 30 }]}
>
هزینه ارسال کالا پس از تعیین محل آدرس مشخص میشود
</Text>
<Image source={alertIcon} style={{width: 18, height: 18, marginLeft : 5}} />
<Image
source={alertIcon}
style={{ width: 18, height: 18, marginLeft: 5 }}
/>
</Pressable>
<CustomPressable
title={'ادامه فرایند خرید'}
title={"ادامه فرایند خرید"}
backgroundColor="#196EC0"
color={'white'}
border={{color: '#196EC0', width: 0}}
width={'100%'}
color={"white"}
border={{ color: "#196EC0", width: 0 }}
width={"100%"}
/>
</ScrollView>
</SafeAreaView>
);
}
@ -103,12 +131,12 @@ export default ShoppingCart;
const styles = StyleSheet.create({
contentContainerStyle: {
paddingBottom: 50,
paddingBottom: 100,
},
container: {
width: Dimensions.get('window').width,
backgroundColor: 'white',
flexDirection: 'column',
width: Dimensions.get("window").width,
backgroundColor: "white",
flexDirection: "column",
paddingVertical: 5,
paddingHorizontal: 10,
},

File diff suppressed because it is too large Load Diff

@ -1227,6 +1227,13 @@
"@types/yargs" "^15.0.0"
chalk "^4.0.0"
"@koale/useworker@^4.0.2":
version "4.0.2"
resolved "https://registry.yarnpkg.com/@koale/useworker/-/useworker-4.0.2.tgz#cb540a2581cd6025307c3ca6685bc60748773e58"
integrity sha512-xPIPADtom8/3/4FLNj7MvNcBM/Z2FleH85Fdx2O869eoKW8+PoEgtSVvoxWjCWMA46Sm9A5/R1TyzNGc+yM0wg==
dependencies:
dequal "^1.0.0"
"@nodelib/fs.scandir@2.1.5":
version "2.1.5"
resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5"
@ -1248,7 +1255,7 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"
"@react-native-async-storage/async-storage@~1.15.0":
"@react-native-async-storage/async-storage@^1.13.4", "@react-native-async-storage/async-storage@~1.15.0":
version "1.15.14"
resolved "https://registry.yarnpkg.com/@react-native-async-storage/async-storage/-/async-storage-1.15.14.tgz#8165d3f78798b46e693169795b62e40142064273"
integrity sha512-eJF2horabXazwszCyyXDe4w7sBSWlB0WPA8akKXuN2n7WXKHYeQJPN41lS9OahrhSZuZwqftNFE9VWgPXA8wyA==
@ -2565,6 +2572,11 @@ depd@~1.1.2:
resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9"
integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=
dequal@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/dequal/-/dequal-1.0.1.tgz#dbbf9795ec626e9da8bd68782f4add1d23700d8b"
integrity sha512-Fx8jxibzkJX2aJgyfSdLhr9tlRoTnHKrRJuu2XHlAgKioN2j19/Bcbe0d4mFXYZ3+wpE2KVobUVTfDutcD17xQ==
destroy@~1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80"
@ -2737,6 +2749,23 @@ expo-asset@~8.4.5:
path-browserify "^1.0.0"
url-parse "^1.4.4"
expo-barcode-scanner@~11.2.0:
version "11.2.0"
resolved "https://registry.yarnpkg.com/expo-barcode-scanner/-/expo-barcode-scanner-11.2.0.tgz#9d316a36962f74f117f19f7c722de1334a4fd8d2"
integrity sha512-Dmp6KTzkMa9E561gR7kRP8ZXfVdAn9SLUwQ5DdeEGTC7D1NIqEO8WmyfVtWSLUUSArF6QxL+oYOZyzJ+LVjkHA==
dependencies:
"@expo/config-plugins" "^4.0.2"
expo-image-loader "~3.1.0"
expo-camera@~12.1.0:
version "12.1.0"
resolved "https://registry.yarnpkg.com/expo-camera/-/expo-camera-12.1.0.tgz#d968b282d2155956655e217b35bade66ed361ad7"
integrity sha512-FWzgexrsd1v2XYmtXpeZsXMJf2G6ctX7wmU3xi2KEL7vYMdrCCZi+aX5vj7WQz5DDEu/TH1fkHnqU/hek8ZGMA==
dependencies:
"@expo/config-plugins" "^4.0.2"
"@koale/useworker" "^4.0.2"
invariant "^2.2.4"
expo-constants@~13.0.0:
version "13.0.0"
resolved "https://registry.yarnpkg.com/expo-constants/-/expo-constants-13.0.0.tgz#e167b0e4d064029e53a0bc89c8cffcb7cb8f2a0a"
@ -2772,6 +2801,11 @@ expo-font@~10.0.4:
dependencies:
fontfaceobserver "^2.1.0"
expo-image-loader@~3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/expo-image-loader/-/expo-image-loader-3.1.0.tgz#d60d57d6d36d1ea9b07ed2e8bed87574edd2ad1e"
integrity sha512-86oT25SDTO018hWO61HGnoB4l+DEgT9sOoW24rvXX99VBe/MPheGo+DDNKtLNf6k06n/OFL3LgtR0m9YpOCT8Q==
expo-keep-awake@~10.0.1:
version "10.0.1"
resolved "https://registry.yarnpkg.com/expo-keep-awake/-/expo-keep-awake-10.0.1.tgz#9f1176216c41eee20843c8232acfdca2bc32d334"
@ -2801,7 +2835,7 @@ expo-status-bar@~1.2.0:
resolved "https://registry.yarnpkg.com/expo-status-bar/-/expo-status-bar-1.2.0.tgz#16e73205da563f9536f562e439081e30e318a82e"
integrity sha512-pVZZ/kDCXFK79E4dCtRecs3XLC8aiwlciutSd/fFmUPJSQZ1Txia6hlKajPt0GAYft8/YnT0V3URXzWZOBniYQ==
expo@~44.0.0:
expo@^44.0.1:
version "44.0.1"
resolved "https://registry.yarnpkg.com/expo/-/expo-44.0.1.tgz#998a29c8e7eeab1c72d4e51d907494e16a49ed1c"
integrity sha512-r3UXg8d2ypcK2I8ds5r9WP6luOLKH4tTqtdgOS+rQt3jpMpkF89VRnNB/Ux3GnzxHnxIHcEmTYBmfoI3qA4abg==
@ -3381,6 +3415,11 @@ inline-style-prefixer@^6.0.0:
dependencies:
css-in-js-utils "^2.0.0"
install@^0.13.0:
version "0.13.0"
resolved "https://registry.yarnpkg.com/install/-/install-0.13.0.tgz#6af6e9da9dd0987de2ab420f78e60d9c17260776"
integrity sha512-zDml/jzr2PKU9I8J/xyZBQn8rPCAY//UOYNmR01XwNwyfhEWObo2SWfSl1+0tm1u6PhxLwDnfsT/6jB7OUxqFA==
interpret@^1.0.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e"
@ -4933,7 +4972,7 @@ prompts@^2.4.0:
kleur "^3.0.3"
sisteransi "^1.0.5"
prop-types@^15.6.0, prop-types@^15.7.2:
prop-types@^15.5.10, prop-types@^15.6.0, prop-types@^15.7.2:
version "15.8.0"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.0.tgz#d237e624c45a9846e469f5f31117f970017ff588"
integrity sha512-fDGekdaHh65eI3lMi5OnErU6a8Ighg2KjcjQxO7m8VHyWjcPyj5kiOgV1LQDOOOgVy3+5FgjXvdSSX7B8/5/4g==
@ -5052,6 +5091,20 @@ react-native-codegen@^0.0.6:
jscodeshift "^0.11.0"
nullthrows "^1.1.1"
react-native-permissions@^2.0.2:
version "2.2.2"
resolved "https://registry.yarnpkg.com/react-native-permissions/-/react-native-permissions-2.2.2.tgz#3d2a63f6b7d6be52fc86e30f77412a9566283028"
integrity sha512-ihf4shQDSX5Oo9ChQXb9kr13mmyyNem5MaEvOpr3dCjhBOBWyEMztXm9/uPK1Qg5PsNpaYLa1KpcPZDCw87LXg==
react-native-qrcode-scanner@^1.5.4:
version "1.5.4"
resolved "https://registry.yarnpkg.com/react-native-qrcode-scanner/-/react-native-qrcode-scanner-1.5.4.tgz#5e96189260942db3287739545eb3f6a16f7c0178"
integrity sha512-FqY6C+vi+1u7XUunCfCBoBGTjEhK9mIOhthOBgmCWH2xAXZkytrRV7ycCmnkTIFMqOIWzomlfSc7l+2vF01BzA==
dependencies:
"@react-native-async-storage/async-storage" "^1.13.4"
prop-types "^15.5.10"
react-native-permissions "^2.0.2"
react-native-restart@^0.0.22:
version "0.0.22"
resolved "https://registry.yarnpkg.com/react-native-restart/-/react-native-restart-0.0.22.tgz#81fcb7f31e35951d85410c68b9556acf3ab88705"

Loading…
Cancel
Save