commit
4f0fb5dfd7
16 changed files with 13070 additions and 118 deletions
File diff suppressed because it is too large
Load Diff
After Width: | Height: | Size: 7.7 KiB |
After Width: | Height: | Size: 275 B |
@ -1,35 +1,48 @@ |
|||||||
import React from 'react'; |
import React from 'react'; |
||||||
|
import {Image} from 'react-native'; |
||||||
import SelectDropdown from 'react-native-select-dropdown'; |
import SelectDropdown from 'react-native-select-dropdown'; |
||||||
import Icon from 'react-native-vector-icons/Ionicons'; |
import dropdownIcon from '../assets/icons/dropdown.png'; |
||||||
|
|
||||||
function Select({iconPosition,options,onChange, value}) { |
function Select({iconPosition, options, onChange, value, name}) { |
||||||
return ( |
return ( |
||||||
<SelectDropdown |
<SelectDropdown |
||||||
data={options} |
data={options} |
||||||
buttonStyle={{ |
buttonStyle={{ |
||||||
width: '100%', |
width: '100%', |
||||||
borderWidth: 1, |
borderWidth: 1, |
||||||
borderColor: 'grey', |
borderColor: 'grey', |
||||||
borderRadius: 10, |
borderRadius: 6, |
||||||
}} |
backgroundColor : 'white' |
||||||
defaultButtonText="انتخاب کنید" |
}} |
||||||
statusBarTranslucent={true} |
defaultButtonText="انتخاب کنید" |
||||||
buttonTextStyle={{ |
statusBarTranslucent={true} |
||||||
textAlign: 'center', |
buttonTextStyle={{ |
||||||
justifyContent: 'flex-end', |
textAlign: 'center', |
||||||
textAlign: 'right', |
justifyContent: 'flex-end', |
||||||
flex: 0, |
textAlign: 'right', |
||||||
// display: 'inline'
|
flex: 0, |
||||||
}} |
fontSize: 14, |
||||||
dropdownIconPosition={iconPosition} |
color : '#555', |
||||||
onSelect={(selectedItem, index) => { |
// display: 'inline'
|
||||||
console.log(selectedItem, index); |
}} |
||||||
}} |
dropdownIconPosition={iconPosition} |
||||||
renderDropdownIcon={() => ( |
onSelect={(selectedItem, index) => { |
||||||
<Icon name="chevron-down" size={25} color="grey" /> |
onChange(name, selectedItem); |
||||||
)} |
}} |
||||||
/> |
renderDropdownIcon={() => ( |
||||||
|
<Image source={dropdownIcon} style={{width: 15, height: 10}} /> |
||||||
|
)} |
||||||
|
/> |
||||||
); |
); |
||||||
} |
} |
||||||
|
|
||||||
export default Select; |
export default Select; |
||||||
|
|
||||||
|
Select.defaultProps = { |
||||||
|
options : [ |
||||||
|
"1", |
||||||
|
"2", |
||||||
|
"3" |
||||||
|
], |
||||||
|
iconPosition : "left" |
||||||
|
} |
||||||
|
@ -0,0 +1,54 @@ |
|||||||
|
'use strict'; |
||||||
|
|
||||||
|
import React, {Component} from 'react'; |
||||||
|
|
||||||
|
import { |
||||||
|
AppRegistry, |
||||||
|
StyleSheet, |
||||||
|
Text, |
||||||
|
TouchableOpacity, |
||||||
|
Linking, |
||||||
|
View |
||||||
|
} from 'react-native'; |
||||||
|
|
||||||
|
import QRCodeScanner from 'react-native-qrcode-scanner'; |
||||||
|
import {RNCamera} from 'react-native-camera'; |
||||||
|
|
||||||
|
export default function ScanScreen() { |
||||||
|
const onSuccess = e => { |
||||||
|
Linking.openURL(e.data).catch(err => |
||||||
|
console.error('An error occured', err), |
||||||
|
); |
||||||
|
}; |
||||||
|
|
||||||
|
return ( |
||||||
|
<View> |
||||||
|
<QRCodeScanner |
||||||
|
onRead={() => onSuccess} |
||||||
|
flashMode={RNCamera.Constants.FlashMode.torch} |
||||||
|
cameraType={'front'} |
||||||
|
reactive={true} |
||||||
|
/> |
||||||
|
</View> |
||||||
|
); |
||||||
|
} |
||||||
|
|
||||||
|
const styles = StyleSheet.create({ |
||||||
|
centerText: { |
||||||
|
flex: 1, |
||||||
|
fontSize: 18, |
||||||
|
padding: 32, |
||||||
|
color: '#777', |
||||||
|
}, |
||||||
|
textBold: { |
||||||
|
fontWeight: '500', |
||||||
|
color: '#000', |
||||||
|
}, |
||||||
|
buttonText: { |
||||||
|
fontSize: 21, |
||||||
|
color: 'rgb(0,122,255)', |
||||||
|
}, |
||||||
|
buttonTouchable: { |
||||||
|
padding: 16, |
||||||
|
}, |
||||||
|
}); |
@ -1,13 +1,66 @@ |
|||||||
import React from 'react' |
import React, {useState} from 'react'; |
||||||
import { View, Text } from 'react-native'; |
import {View, StyleSheet, Dimensions, ScrollView, Text} from 'react-native'; |
||||||
import {connect} from 'react-redux'; |
import tw from 'tailwind-react-native-classnames'; |
||||||
|
import Select from '../../components/Select'; |
||||||
|
import CustomTextInput from '../../components/CustomTextInput'; |
||||||
|
import FormButton from '../../components/FormButton'; |
||||||
|
|
||||||
|
const width = Dimensions.get('window').width; |
||||||
|
|
||||||
|
function Support(props) { |
||||||
|
const [formData, setFormData] = useState({ |
||||||
|
title: null, |
||||||
|
department: null, |
||||||
|
message: null, |
||||||
|
file: null, |
||||||
|
}); |
||||||
|
|
||||||
|
const onChange = (name, value) => { |
||||||
|
setFormData({...formData, [name]: value}); |
||||||
|
}; |
||||||
|
|
||||||
function Support({}) { |
|
||||||
return ( |
return ( |
||||||
<View> |
<ScrollView |
||||||
<Text></Text> |
contentContainerStyle={styles.contentContainerStyle} |
||||||
</View> |
style={[tw.style('bg-white flex flex-col p-1'), {width: width}]}> |
||||||
) |
<Text style={tw.style('text-right mt-2 text-gray-500 text-sm')}> |
||||||
|
برای ارتباط با دنیای شگفت انگیز دانوین از فرم زیر استفاده کنید و پس از |
||||||
|
انتخاب دپارتمان مد نظر پیام خود را ارسال کنید. |
||||||
|
</Text> |
||||||
|
<View style={tw.style('w-full mt-10')}> |
||||||
|
<Select onChange={onChange} name="department" /> |
||||||
|
</View> |
||||||
|
<View style={tw.style('w-full mt-1')}> |
||||||
|
<CustomTextInput |
||||||
|
label={'موضوع'} |
||||||
|
onChange={onChange} |
||||||
|
name="title" |
||||||
|
value={formData.title} |
||||||
|
/> |
||||||
|
</View> |
||||||
|
<View style={tw.style('w-full mt-1')}> |
||||||
|
<CustomTextInput |
||||||
|
label={'متن'} |
||||||
|
onChange={onChange} |
||||||
|
name="message" |
||||||
|
value={formData.message} |
||||||
|
multiline={true} |
||||||
|
numberOfLines={6} |
||||||
|
/> |
||||||
|
</View> |
||||||
|
<View style={tw.style('w-full mt-4')}> |
||||||
|
<FormButton text={'ارسال'} color={'#6cbe44'} /> |
||||||
|
</View> |
||||||
|
</ScrollView> |
||||||
|
); |
||||||
} |
} |
||||||
|
|
||||||
|
// Later on in your styles..
|
||||||
|
const styles = StyleSheet.create({ |
||||||
|
contentContainerStyle: { |
||||||
|
paddingBottom: 50, |
||||||
|
alignItems: 'flex-end', |
||||||
|
}, |
||||||
|
}); |
||||||
|
|
||||||
export default Support; |
export default Support; |
||||||
|
Loading…
Reference in new issue