-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from IICMenoringETCEPro/ayan/dev
Ayan/dev
- Loading branch information
Showing
35 changed files
with
857 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import React from 'react'; | ||
import {View, Text, StyleSheet} from 'react-native'; | ||
|
||
/* | ||
* | ||
Define props | ||
block : flex view | ||
margin | ||
padding | ||
width | ||
height | ||
border | ||
borderWidth | ||
borderColor | ||
color => is background color of view | ||
.... your can custom if you want | ||
*/ | ||
|
||
const styles = StyleSheet.create({ | ||
block: { | ||
flex: 1, | ||
}, | ||
}); | ||
|
||
const Block = ({ | ||
block, | ||
margin, | ||
padding, | ||
paddingHorizontal, | ||
paddingVertical, | ||
width, | ||
height, | ||
border, | ||
borderWidth, | ||
borderColor, | ||
centered, | ||
color, | ||
style, | ||
direction, | ||
middle, | ||
children, | ||
justifyContent, | ||
borderRadius, | ||
shadow, | ||
...props | ||
}) => { | ||
const styleComponent = [ | ||
block && styles.block, | ||
margin && {margin}, | ||
padding && {padding}, | ||
width && {width}, | ||
height && {height}, | ||
border && {borderWidth: 1, borderColor: 'gray'}, | ||
borderWidth && {borderWidth}, | ||
borderColor && {borderColor}, | ||
color && {backgroundColor: color}, | ||
centered && {justifyContent: 'center'}, | ||
justifyContent && {justifyContent}, | ||
direction && {flexDirection: direction}, | ||
paddingVertical && {paddingVertical}, | ||
paddingHorizontal && {paddingHorizontal}, | ||
middle && {alignItems: 'center'}, | ||
borderRadius && {borderRadius}, | ||
shadow && { | ||
shadowOpacity: 0.12, | ||
shadowRadius: 15, | ||
shadowColor: 'gray', | ||
shadowOffset: {height: 0, width: 0}, | ||
}, | ||
style, | ||
]; | ||
return ( | ||
<View style={styleComponent} {...props}> | ||
{children} | ||
</View> | ||
); | ||
}; | ||
|
||
export default Block; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import React from 'react'; | ||
import {TouchableOpacity, Text, StyleSheet} from 'react-native'; | ||
|
||
/** | ||
* define props => same Block | ||
* | ||
* TouchableOpacity is very cool | ||
*/ | ||
|
||
const styles = StyleSheet.create({ | ||
block: { | ||
flex: 1, | ||
}, | ||
}); | ||
|
||
const Button = ({ | ||
block, | ||
margin, | ||
padding, | ||
width, | ||
height, | ||
border, | ||
borderWidth, | ||
borderColor, | ||
borderRadius, | ||
color, | ||
fontSize, | ||
textColor, | ||
style, | ||
textStyle, | ||
centered, | ||
middle, | ||
children, | ||
shadow, | ||
...props | ||
}) => { | ||
const styleComponent = [ | ||
block && styles.block, | ||
margin && {margin}, | ||
padding && {padding}, | ||
width && {width}, | ||
height && {height}, | ||
border && {borderWidth: 1, borderColor: 'gray'}, | ||
borderWidth && {borderWidth}, | ||
borderColor && {borderColor}, | ||
borderRadius && {borderRadius}, | ||
color && {backgroundColor: color}, | ||
centered && {justifyContent: 'center'}, | ||
middle && {alignItems: 'center'}, | ||
shadow && { | ||
shadowOpacity: 0.12, | ||
shadowRadius: 15, | ||
shadowColor: 'gray', | ||
shadowOffset: {height: 0, width: 0}, | ||
}, | ||
style, | ||
]; | ||
const styleText = [ | ||
fontSize && {fontSize}, | ||
textColor && {color: textColor}, | ||
textStyle, | ||
]; | ||
|
||
if (typeof children == 'string') { | ||
return ( | ||
<TouchableOpacity style={styleComponent} {...props}> | ||
<Text style={styleText}>{children}</Text> | ||
</TouchableOpacity> | ||
); | ||
} | ||
|
||
return ( | ||
<TouchableOpacity style={styleComponent} {...props}> | ||
{children} | ||
</TouchableOpacity> | ||
); | ||
}; | ||
|
||
export default Button; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import React from 'react'; | ||
import {View, Text, TextInput} from 'react-native'; | ||
|
||
/** | ||
* define props | ||
* margin, | ||
* padding, | ||
* value, | ||
* onTextChange => event change value | ||
* | ||
* | ||
* vvv..... | ||
* ...props => inheritance props of component InputText | ||
* | ||
*/ | ||
|
||
const Input = ({ | ||
margin, | ||
padding, | ||
value, | ||
border, | ||
radius, | ||
onTextChange, | ||
secureTextEntry, | ||
style, | ||
placeholder, | ||
fontSize, // fontSize | ||
...props | ||
}) => { | ||
const styleComponent = [ | ||
margin && {margin}, | ||
padding && {padding}, | ||
border && {borderWidth: 1, borderColor: 'gray'}, | ||
radius && {borderRadius: 8}, | ||
fontSize && {fontSize}, | ||
style, | ||
]; | ||
return ( | ||
<TextInput | ||
style={styleComponent} | ||
value={value} | ||
placeholder={placeholder} | ||
onChangeText={onTextChange} | ||
{...props} | ||
/> | ||
); | ||
}; | ||
|
||
export default Input; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import React from 'react'; | ||
import {View, Text} from 'react-native'; | ||
|
||
/** | ||
* define props | ||
* margin | ||
* padding | ||
* bgColor => background color for text | ||
* color => color of text | ||
* size => fontSize | ||
* bold => if text is bold | ||
* define heading size | ||
* vv..... | ||
*/ | ||
|
||
const TextView = ({ | ||
margin, | ||
padding, | ||
bgColor, | ||
color, | ||
size, | ||
bold, | ||
center, | ||
h1, | ||
h2, | ||
h3, | ||
h4, | ||
h5, | ||
h6, | ||
style, | ||
children, | ||
...props | ||
}) => { | ||
const styleComponet = [ | ||
{fontSize: 14}, // default h6 | ||
margin && {margin}, | ||
padding && {padding}, | ||
bgColor && {backgroundColor: bgColor}, | ||
color && {color}, | ||
size && {fontSize: size}, | ||
bold && {fontWeight: 'bold'}, | ||
h1 && {fontSize: 44, fontWeight: 'bold'}, | ||
h2 && {fontSize: 38, fontWeight: 'bold'}, | ||
h3 && {fontSize: 32, fontWeight: 'bold'}, | ||
h4 && {fontSize: 28, fontWeight: 'bold'}, | ||
h5 && {fontSize: 22, fontWeight: 'bold'}, | ||
h6 && {fontSize: 18, fontWeight: 'bold'}, | ||
center && {textAlign: 'center'}, | ||
style, | ||
]; | ||
return ( | ||
<Text style={styleComponet} {...props}> | ||
{children} | ||
</Text> | ||
); | ||
}; | ||
|
||
export default TextView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import Block from './Block'; | ||
import TextView from './TextView'; | ||
import Input from './Input'; | ||
import Button from './Button'; | ||
|
||
export {Block, TextView, Input, Button}; |
Oops, something went wrong.