Skip to content

Commit

Permalink
#21 Notification component review
Browse files Browse the repository at this point in the history
  • Loading branch information
DLBrianPina committed Apr 20, 2020
1 parent a0bfc32 commit 5e1ba17
Show file tree
Hide file tree
Showing 12 changed files with 96 additions and 82 deletions.
1 change: 1 addition & 0 deletions mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"react-native-reanimated": "^1.7.0",
"react-native-safe-area-context": "^0.7.3",
"react-native-screens": "^2.3.0",
"react-native-vector-icons": "^6.6.0",
"react-native-web": "~0.11.7"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion mobile/src/components/notification/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const Description = (type, name) => {

const Notification = ({ name, type }) => (
<View style={styles.card}>
<View>
<View style={styles.text}>
<Text style={styles.name}>{name}</Text>
{Description(type, name)}
</View>
Expand Down
7 changes: 4 additions & 3 deletions mobile/src/components/notification/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const styles = StyleSheet.create({
fontFamily: 'Fjalla-One',
fontSize: 14,
marginVertical: 5,
marginLeft: 65,
},
quit: {
padding: 30,
Expand All @@ -24,8 +23,10 @@ const styles = StyleSheet.create({
fontFamily: 'Fjalla-One',
fontSize: 12,
color: '#888888',
marginLeft: 65,
width: 150,
width: 200,
},
text: {
marginLeft: 20,
},
});

Expand Down
70 changes: 40 additions & 30 deletions mobile/src/components/projectCard/index.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,50 @@
import React, {useState} from 'react';
import { View, Image, Text, FlatList } from 'react-native';
import { ListItem, Card } from 'react-native-elements'
import {
View, Image, Text, FlatList,
} from 'react-native';
import React, { useState } from 'react';
import { ListItem, Card } from 'react-native-elements';
import styles from './styles';

const Label = ({name}) =>{
return (
<View style={styles.labelView}><Text style={styles.labelText}>{name.item}</Text></View>
)};
const Label = ({ name }) => (
<View style={styles.labelView}><Text style={styles.labelText}>{name.item}</Text></View>
);

const Project = props =>
{
const project = props.project;
const {projectName, ownerName, avatar, labels} = project.item;
const Project = (props) => {
const { project } = props;
const {
projectName, ownerName, labels,
} = project.item;

return(
return (
<Card containerStyle={styles.card}>
<ListItem
title={
<Text style={styles.projectName}>{projectName}</Text>
<ListItem
title={
<Text style={styles.projectName}>{projectName}</Text>
}
subtitle={
<>
<Text style={styles.ownerName}>
{ownerName}
</Text>
<View style={styles.labelList}>
<FlatList horizontal data={labels} keyExtractor={(item, index) => index.toString()} renderItem={(label) => <Label name={label} />}/>
</View>
</>
}
leftAvatar={(
<Image style={styles.image} source={require('../../../assets/icon.png')} />
subtitle={(
<>
<Text style={styles.ownerName}>
{ownerName}
</Text>
<View style={styles.labelList}>
<FlatList
horizontal
data={labels}
keyExtractor={(item, index) => index.toString()}
renderItem={(label) => <Label name={label} />}
/>
</View>
</>
)}
leftAvatar={(
<Image
style={styles.image}
source={require('../../../assets/icon.png')}
/>
)}
/>
/>
</Card>
);
);
};

export default Project;
export default Project;
33 changes: 17 additions & 16 deletions mobile/src/components/searchBar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@ import { Input } from 'react-native-elements';
import Icon from 'react-native-vector-icons/Ionicons';
import styles from './styles';

const SearchBar = ({changeSearchText, searchText, placeholder}) =>(
<Input
placeholder={placeholder}
onChangeText={changeSearchText}
value={searchText}
containerStyle={styles.searchBar}
inputContainerStyle={styles.searchBarContainer}
inputStyle={styles.searchBarText}
leftIcon={
<Icon name='ios-search'
size={20}
color='rgba(125,125,125, .5)'
/>
}
/>
const SearchBar = ({ changeSearchText, searchText, placeholder }) => (
<Input
placeholder={placeholder}
onChangeText={changeSearchText}
value={searchText}
containerStyle={styles.searchBar}
inputContainerStyle={styles.searchBarContainer}
inputStyle={styles.searchBarText}
leftIcon={(
<Icon
name="ios-search"
size={20}
color="rgba(125,125,125, .5)"
/>
)}
/>
);

export default SearchBar;
export default SearchBar;
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React from 'react';
import { View, Text, Image, TouchableOpacity } from 'react-native';
import {
View, Text, Image, TouchableOpacity,
} from 'react-native';
import { Button, Input } from 'react-native-elements';

import styles from './styles';
Expand All @@ -8,7 +10,7 @@ function LoginPage() {
return (
<View style={styles.container}>
<View style={styles.container_logo}>
<Image source={require('../../../../assets/Logo.png')} />
<Image source={require('../../../assets/Logo.png')} />
</View>
<View style={styles.container_input_data}>
<Text style={styles.signin}>
Expand All @@ -22,19 +24,20 @@ function LoginPage() {
Password
</Text>
<Input containerStyle={styles.input_password} placeholder="********" />
</ View>
</View>
<View style={styles.container_button}>
<Button contanerStyle={styles.button_login}
buttonStyle={styles.button_login}
title='SIGN IN'
<Button
contanerStyle={styles.button_login}
buttonStyle={styles.button_login}
title="SIGN IN"
/>
<TouchableOpacity
style={styles.button_create_account}
onPress={() => {}}
>
<Text>Novo aqui? Crie uma conta</Text>
</TouchableOpacity>
</ View>
</View>
</View>
);
}
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions mobile/src/pages/Main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import React, { useState } from 'react';
import { View, Text, FlatList } from 'react-native';
import { LinearGradient } from 'expo-linear-gradient';
import { Button } from 'react-native-elements';
import Project from '../../components/projectCard';
import Project from '../../components/ProjectCard';
import Header from '../../components/Header';
import SearchBar from '../../components/searchBar';
import SearchBar from '../../components/SearchBar';

import styles from './styles';

Expand Down
4 changes: 2 additions & 2 deletions mobile/src/pages/Notifications/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from 'react';
import { View, FlatList, Text } from 'react-native';
import Header from '../../components/Header';
import Notification from '../../components/notification';
import Notification from '../../components/Notification';

import styles from './styles';

Expand Down Expand Up @@ -30,7 +30,7 @@ const Notifications = () => {
return (
<View style={styles.container}>
<Header title="Notificações" />
<Text style={styles.subtitle}>PROJETOS DISPONÍVEIS</Text>
<Text style={styles.subtitle}>NOTIFICAÇÕES</Text>
<FlatList
style={styles.list}
keyExtractor={(item, index) => index.toString()}
Expand Down
4 changes: 2 additions & 2 deletions mobile/src/pages/Projects/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { useState } from 'react';
import { View, Text, FlatList } from 'react-native';
import { Button } from 'react-native-elements';
import Project from '../../components/projectCard';
import Project from '../../components/ProjectCard';
import Header from '../../components/Header';
import SearchBar from '../../components/searchBar';
import SearchBar from '../../components/SearchBar';

import styles from './styles';

Expand Down
34 changes: 16 additions & 18 deletions mobile/src/pages/Splash/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,21 @@ import { View, Text } from 'react-native';
import LottieView from 'lottie-react-native';
import styles from './styles';

const Splash = ({ navigation }) =>
{
const Splash = ({ navigation }) => {
useEffect(() => {
setTimeout(() => {
navigation.replace('Main');
}, 3000);
}, []);

useEffect(() => {
setTimeout(() => {
navigation.replace('Main');
}, 3000);
}, []);
return (
<View style={styles.container}>
<LottieView style={styles.animationContainer} source={require('../../../assets/animations/lamp.json')} autoPlay loop={false} />
<View style={styles.circle} />
<Text style={styles.text}>Orc'lamp</Text>
<Text style={styles.text}>Tenha ideias. Crie um projeto. Convoque um time.</Text>
</View>
);
};

return(
<View style={styles.container}>
<LottieView style={styles.animationContainer} source={require('../../../assets/animations/lamp.json')} autoPlay loop={false} />
<View style={styles.circle}/>
<Text style={styles.text}>Orc'lamp</Text>
<Text style={styles.text}>Tenha ideias. Crie um projeto. Convoque um time.</Text>
</View>
);
}

export default Splash;
export default Splash;
2 changes: 1 addition & 1 deletion mobile/src/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Icon from 'react-native-vector-icons/Ionicons';
import * as Font from 'expo-font';
import { Text } from 'react-native';
import Main from './pages/Main';
import LoginPage from './pages/Main/LoginPage';
import LoginPage from './pages/LoginPage';
import Splash from './pages/Splash';
import Projects from './pages/Projects';
import Notifications from './pages/Notifications';
Expand Down

0 comments on commit 5e1ba17

Please sign in to comment.