-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1db7d7d
commit a0bfc32
Showing
10 changed files
with
287 additions
and
138 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
import React, {useState} from 'react'; | ||
import { View, Text, FlatList } from 'react-native'; | ||
import React from 'react'; | ||
import { Text } from 'react-native'; | ||
import { LinearGradient } from 'expo-linear-gradient'; | ||
import Icon from 'react-native-vector-icons/Feather'; | ||
import styles from './styles'; | ||
|
||
const Header = props => { | ||
|
||
return ( | ||
<LinearGradient | ||
colors={['#7AC14E', '#5A8D3B']} | ||
style={styles.top} | ||
> | ||
<Text style={styles.pageTitle}>{props.title}</Text> | ||
</LinearGradient> | ||
); | ||
} | ||
const Header = ({ title, onPressBack }) => ( | ||
<LinearGradient | ||
colors={['#7AC14E', '#5A8D3B']} | ||
style={styles.top} | ||
> | ||
{onPressBack ? <Icon onPress={onPressBack} name="arrow-left" size={24} color="#ffffff" style={styles.back} /> : null} | ||
<Text style={styles.pageTitle}>{title}</Text> | ||
</LinearGradient> | ||
); | ||
|
||
export default Header; | ||
export default Header; |
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 |
---|---|---|
@@ -1,24 +1,33 @@ | ||
import { StyleSheet } from 'react-native'; | ||
|
||
const styles = StyleSheet.create({ | ||
top: { | ||
height: 250, | ||
width: 300, | ||
alignSelf: 'center', | ||
top: -100, | ||
borderBottomLeftRadius: 1000, | ||
borderBottomRightRadius: 1000, | ||
transform: [{scaleX: 2}] | ||
}, | ||
pageTitle: { | ||
fontSize: 20, | ||
color: '#ffffff', | ||
lineHeight: 22, | ||
fontFamily: 'Fjalla-One', | ||
top: 175, | ||
alignSelf: 'center', | ||
transform: [{scaleX: 1/2}], | ||
}, | ||
top: { | ||
height: 250, | ||
width: 300, | ||
alignSelf: 'center', | ||
top: -100, | ||
borderBottomLeftRadius: 1000, | ||
borderBottomRightRadius: 1000, | ||
transform: [{ scaleX: 2 }], | ||
}, | ||
pageTitle: { | ||
fontSize: 20, | ||
color: '#ffffff', | ||
lineHeight: 22, | ||
fontFamily: 'Fjalla-One', | ||
top: 175, | ||
alignSelf: 'center', | ||
transform: [{ scaleX: 1 / 2 }], | ||
height: 30, | ||
textAlignVertical: 'center', | ||
}, | ||
back: { | ||
position: 'absolute', | ||
top: 172.5, | ||
left: 70, | ||
/* alignSelf: 'center', */ | ||
transform: [{ scaleX: 1 / 2 }], | ||
}, | ||
}); | ||
|
||
export default styles; | ||
export default styles; |
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,32 @@ | ||
import React from 'react'; | ||
import { View, Text } from 'react-native'; | ||
import Icon from 'react-native-vector-icons/EvilIcons'; | ||
|
||
import styles from './styles'; | ||
|
||
const Description = (type, name) => { | ||
switch (type) { | ||
case 'NOTIFICATION_MESSAGE': | ||
return (<Text style={styles.description}>{`${name} te enviou uma mensangem`}</Text>); | ||
case 'NOTIFICATION_PROJECT_ACCEPTED': | ||
return (<Text style={styles.description}>{`${name} te aceitou no projeto`}</Text>); | ||
case 'NOTIFICATION_PROJECT_REQUEST': | ||
return (<Text style={styles.description}>{`${name} pediu para fazer parte do seu projeto`}</Text>); | ||
case 'NOTIFICATION_PROJECT_INVITE': | ||
return (<Text style={styles.description}>{`${name} pediu para fazer parte deste projeto`}</Text>); | ||
default: | ||
return null; | ||
} | ||
}; | ||
|
||
const Notification = ({ name, type }) => ( | ||
<View style={styles.card}> | ||
<View> | ||
<Text style={styles.name}>{name}</Text> | ||
{Description(type, name)} | ||
</View> | ||
<Icon size={20} name="close" style={styles.quit} /> | ||
</View> | ||
); | ||
|
||
export default Notification; |
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,32 @@ | ||
import { StyleSheet } from 'react-native'; | ||
|
||
const styles = StyleSheet.create({ | ||
card: { | ||
backgroundColor: '#ffffff', | ||
height: 85, | ||
width: 300, | ||
borderRadius: 8, | ||
margin: 10, | ||
justifyContent: 'space-between', | ||
alignItems: 'center', | ||
flexDirection: 'row', | ||
}, | ||
name: { | ||
fontFamily: 'Fjalla-One', | ||
fontSize: 14, | ||
marginVertical: 5, | ||
marginLeft: 65, | ||
}, | ||
quit: { | ||
padding: 30, | ||
}, | ||
description: { | ||
fontFamily: 'Fjalla-One', | ||
fontSize: 12, | ||
color: '#888888', | ||
marginLeft: 65, | ||
width: 150, | ||
}, | ||
}); | ||
|
||
export default styles; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import React, { useState } from 'react'; | ||
import { View, FlatList, Text } from 'react-native'; | ||
import Header from '../../components/Header'; | ||
import Notification from '../../components/notification'; | ||
|
||
import styles from './styles'; | ||
|
||
const Notifications = () => { | ||
const [notifications, updateNotifications] = useState([ | ||
{ | ||
name: 'Ateldy Brasil', | ||
type: 'NOTIFICATION_PROJECT_ACCEPTED', | ||
date: '10/04/2020', | ||
project: 'Ada Bot', | ||
}, | ||
{ | ||
name: 'João Vitor', | ||
type: 'NOTIFICATION_MESSAGE', | ||
date: '12/04/2020', | ||
project: 'Hub Care', | ||
}, | ||
{ | ||
name: 'Alan Marques', | ||
type: 'NOTIFICATION_PROJECT_REQUEST', | ||
date: '11/04/2020', | ||
project: 'IFB', | ||
}, | ||
]); | ||
|
||
return ( | ||
<View style={styles.container}> | ||
<Header title="Notificações" /> | ||
<Text style={styles.subtitle}>PROJETOS DISPONÍVEIS</Text> | ||
<FlatList | ||
style={styles.list} | ||
keyExtractor={(item, index) => index.toString()} | ||
data={notifications} | ||
renderItem={(notification) => ( | ||
<Notification | ||
name={notification.item.name} | ||
type={notification.item.type} | ||
project={notification.item.project} | ||
/> | ||
)} | ||
/> | ||
</View> | ||
); | ||
}; | ||
|
||
export default Notifications; |
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,26 @@ | ||
import { StyleSheet } from 'react-native'; | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
alignItems: 'center', | ||
backgroundColor: '#F5F7FB', | ||
}, | ||
list: { | ||
flex: 1, | ||
top: -75, | ||
}, | ||
subtitle: { | ||
top: -75, | ||
alignSelf: 'flex-start', | ||
left: 30, | ||
color: 'rgba(56, 79, 125, .8)', | ||
fontSize: 13, | ||
letterSpacing: 1, | ||
lineHeight: 16, | ||
fontFamily: 'Fjalla-One', | ||
marginBottom: 10, | ||
}, | ||
}); | ||
|
||
export default styles; |
Oops, something went wrong.