|
|
|
@ -1,4 +1,4 @@ |
|
|
|
|
import React, {useState} from 'react'; |
|
|
|
|
import React, { useState } from "react"; |
|
|
|
|
import { |
|
|
|
|
View, |
|
|
|
|
StyleSheet, |
|
|
|
@ -8,17 +8,25 @@ import { |
|
|
|
|
Pressable, |
|
|
|
|
Image, |
|
|
|
|
TextInput, |
|
|
|
|
} from 'react-native'; |
|
|
|
|
import tw from 'tailwind-react-native-classnames'; |
|
|
|
|
import Header from '../../components/Header'; |
|
|
|
|
import CustomPressable from '../../components/Pressable'; |
|
|
|
|
import Or from '../../components/Or'; |
|
|
|
|
import bgQr from './assets/bgQr.png'; |
|
|
|
|
import qrIcon from './assets/qr.png'; |
|
|
|
|
import alertIcon from './assets/alert.png'; |
|
|
|
|
import bookIcon from './assets/book.png'; |
|
|
|
|
SafeAreaView, |
|
|
|
|
StatusBar, |
|
|
|
|
Platform, |
|
|
|
|
LayoutAnimation |
|
|
|
|
} from "react-native"; |
|
|
|
|
import tw from "tailwind-react-native-classnames"; |
|
|
|
|
import Header from "../../components/Header"; |
|
|
|
|
import Navbar from "../../components/Navbar"; |
|
|
|
|
import Drawer from "../../components/Drawer"; |
|
|
|
|
import CustomPressable from "../../components/Pressable"; |
|
|
|
|
import Or from "../../components/Or"; |
|
|
|
|
|
|
|
|
|
const width = Dimensions.get('window').width; |
|
|
|
|
//assets
|
|
|
|
|
import bgQr from "./assets/bgQr.png"; |
|
|
|
|
import qrIcon from "./assets/qr.png"; |
|
|
|
|
import alertIcon from "./assets/alert.png"; |
|
|
|
|
import bookIcon from "./assets/book.png"; |
|
|
|
|
|
|
|
|
|
const width = Dimensions.get("window").width; |
|
|
|
|
|
|
|
|
|
function Activation(props) { |
|
|
|
|
const [formData, setFormData] = useState({ |
|
|
|
@ -27,79 +35,98 @@ function Activation(props) { |
|
|
|
|
message: null, |
|
|
|
|
file: null, |
|
|
|
|
}); |
|
|
|
|
const [position, setPosition] = useState("100%"); |
|
|
|
|
|
|
|
|
|
const setBoxPosition = () => { |
|
|
|
|
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut); |
|
|
|
|
setPosition(position === "100%" ? "0%" : "100%"); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const onChange = (name, value) => { |
|
|
|
|
setFormData({...formData, [name]: value}); |
|
|
|
|
setFormData({ ...formData, [name]: value }); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<ScrollView |
|
|
|
|
contentContainerStyle={styles.contentContainerStyle} |
|
|
|
|
style={[tw.style('bg-white flex flex-col'), {width: width}]}> |
|
|
|
|
<SafeAreaView |
|
|
|
|
style={{ |
|
|
|
|
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0, |
|
|
|
|
position: "relative", |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
<Navbar setBoxPosition={setBoxPosition} /> |
|
|
|
|
<Drawer setBoxPosition={setBoxPosition} position={position} /> |
|
|
|
|
<Header |
|
|
|
|
background={bgQr} |
|
|
|
|
title={'فعالسازی کتاب دیجیتال'} |
|
|
|
|
description={''} |
|
|
|
|
icon={qrIcon} |
|
|
|
|
/> |
|
|
|
|
<View style={tw.style('flex flex-row w-full flex-wrap p-2')}> |
|
|
|
|
<View style={tw.style('w-full flex flex-row justify-center mb-7')}> |
|
|
|
|
<Image source={bookIcon} style={[{width: 113, height: 113}]} /> |
|
|
|
|
</View> |
|
|
|
|
<Pressable |
|
|
|
|
style={[ |
|
|
|
|
tw.style( |
|
|
|
|
'w-full rounded-md flex flex-row justify-end items-center py-3.5 px-3', |
|
|
|
|
), |
|
|
|
|
{backgroundColor: '#196EC01a'}, |
|
|
|
|
]}> |
|
|
|
|
<Text |
|
|
|
|
style={[ |
|
|
|
|
tw.style('text-right flex-1'), |
|
|
|
|
{color: '#275077', fontSize: width / 30}, |
|
|
|
|
]}> |
|
|
|
|
دانش آموز گرامی پس از خرید فیزیکی کتاب، یک کارت فعالسازی در درون |
|
|
|
|
کتاب قرار داده شده که شما میتوانید با وارد کردن کد در قسمت زیر و یا |
|
|
|
|
اسکن کد QR با دوربین موبایل خود اقدام به فعالسازی امکانات ویژه برای |
|
|
|
|
کتاب خود نمائید |
|
|
|
|
</Text> |
|
|
|
|
<View style={tw.style('p-2')}> |
|
|
|
|
<Image |
|
|
|
|
source={alertIcon} |
|
|
|
|
style={{width: 30, height: 30, marginLeft: 5}} |
|
|
|
|
/> |
|
|
|
|
</View> |
|
|
|
|
</Pressable> |
|
|
|
|
<TextInput |
|
|
|
|
placeholder="کد فعالسازی" |
|
|
|
|
placeholderTextColor="#70707070" |
|
|
|
|
style={[ |
|
|
|
|
tw.style('w-full mt-4 mb-3 rounded-md text-center py-4'), |
|
|
|
|
{ |
|
|
|
|
backgroundColor: '#F9F9F9', |
|
|
|
|
borderColor: '#DFDFDF', |
|
|
|
|
borderWidth: 1, |
|
|
|
|
fontSize: width / 27, |
|
|
|
|
}, |
|
|
|
|
]} |
|
|
|
|
background={bgQr} |
|
|
|
|
title={"فعالسازی کتاب دیجیتال"} |
|
|
|
|
description={""} |
|
|
|
|
icon={qrIcon} |
|
|
|
|
/> |
|
|
|
|
<CustomPressable |
|
|
|
|
title={'تایید کد'} |
|
|
|
|
backgroundColor="#196EC0" |
|
|
|
|
color={'white'} |
|
|
|
|
border={{color: '#196EC0', width: 0}} |
|
|
|
|
width={'100%'} |
|
|
|
|
/> |
|
|
|
|
<Or /> |
|
|
|
|
<CustomPressable |
|
|
|
|
title={'فعالسازی با کد QR'} |
|
|
|
|
backgroundColor="#98B2CB" |
|
|
|
|
color={'white'} |
|
|
|
|
border={{color: '#196EC0', width: 0}} |
|
|
|
|
width={'100%'} |
|
|
|
|
/> |
|
|
|
|
</View> |
|
|
|
|
</ScrollView> |
|
|
|
|
<ScrollView |
|
|
|
|
contentContainerStyle={styles.contentContainerStyle} |
|
|
|
|
style={[tw.style("bg-white flex flex-col"), { width: width }]} |
|
|
|
|
> |
|
|
|
|
<View style={tw.style("flex flex-col w-full flex-wrap p-2")}> |
|
|
|
|
<View style={tw.style("w-full flex flex-row justify-center mb-7")}> |
|
|
|
|
<Image source={bookIcon} style={[{ width: 90, height: 90 }]} /> |
|
|
|
|
</View> |
|
|
|
|
{/* <Pressable |
|
|
|
|
style={[ |
|
|
|
|
tw.style( |
|
|
|
|
"w-full rounded-md flex flex-row justify-end items-center py-3.5 px-3" |
|
|
|
|
), |
|
|
|
|
{ backgroundColor: "#196EC01a" }, |
|
|
|
|
]} |
|
|
|
|
> |
|
|
|
|
<Text |
|
|
|
|
style={[ |
|
|
|
|
tw.style("text-right flex-1"), |
|
|
|
|
{ color: "#275077", fontSize: width / 30 }, |
|
|
|
|
]} |
|
|
|
|
> |
|
|
|
|
دانش آموز گرامی پس از خرید فیزیکی کتاب، یک کارت فعالسازی در درون |
|
|
|
|
کتاب قرار داده شده که شما میتوانید با وارد کردن کد در قسمت زیر و |
|
|
|
|
یا اسکن کد QR با دوربین موبایل خود اقدام به فعالسازی امکانات ویژه |
|
|
|
|
برای کتاب خود نمائید |
|
|
|
|
</Text> |
|
|
|
|
<View style={tw.style("p-2")}> |
|
|
|
|
<Image |
|
|
|
|
source={alertIcon} |
|
|
|
|
style={{ width: 30, height: 30, marginLeft: 5 }} |
|
|
|
|
/> |
|
|
|
|
</View> |
|
|
|
|
</Pressable> */} |
|
|
|
|
<TextInput |
|
|
|
|
placeholder="کد فعالسازی" |
|
|
|
|
placeholderTextColor="#70707070" |
|
|
|
|
style={[ |
|
|
|
|
tw.style("w-full mt-4 mb-3 rounded-md text-center py-2"), |
|
|
|
|
{ |
|
|
|
|
backgroundColor: "#F9F9F9", |
|
|
|
|
borderColor: "#DFDFDF", |
|
|
|
|
borderWidth: 1, |
|
|
|
|
fontSize: width / 31, |
|
|
|
|
fontFamily: "light", |
|
|
|
|
}, |
|
|
|
|
]} |
|
|
|
|
/> |
|
|
|
|
<CustomPressable |
|
|
|
|
title={"تایید کد"} |
|
|
|
|
backgroundColor="#196EC0" |
|
|
|
|
color={"white"} |
|
|
|
|
border={{ color: "#196EC0", width: 0 }} |
|
|
|
|
width={"100%"} |
|
|
|
|
/> |
|
|
|
|
<Or /> |
|
|
|
|
<CustomPressable |
|
|
|
|
title={"فعالسازی با کد QR"} |
|
|
|
|
backgroundColor="#98B2CB" |
|
|
|
|
color={"white"} |
|
|
|
|
border={{ color: "#196EC0", width: 0 }} |
|
|
|
|
width={"100%"} |
|
|
|
|
/> |
|
|
|
|
</View> |
|
|
|
|
</ScrollView> |
|
|
|
|
</SafeAreaView> |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -107,14 +134,14 @@ function Activation(props) { |
|
|
|
|
const styles = StyleSheet.create({ |
|
|
|
|
contentContainerStyle: { |
|
|
|
|
paddingBottom: 50, |
|
|
|
|
alignItems: 'flex-end', |
|
|
|
|
alignItems: "flex-end", |
|
|
|
|
}, |
|
|
|
|
container: { |
|
|
|
|
width: Dimensions.get('window').width, |
|
|
|
|
backgroundColor: 'white', |
|
|
|
|
flexDirection: 'column', |
|
|
|
|
width: Dimensions.get("window").width, |
|
|
|
|
backgroundColor: "white", |
|
|
|
|
flexDirection: "column", |
|
|
|
|
paddingVertical: 5, |
|
|
|
|
paddingHorizontal: 10, |
|
|
|
|
paddingHorizontal: 16, |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|