Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 45 additions & 5 deletions src/NotesMainPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ import React from 'react';
import {
Alert,
AppRegistry,
Button,
Dimensions,
FlatList,
NativeModules,
StyleSheet,
Text,
View,
} from 'react-native';
import NoteWidget from './Widgets/NoteWidget';
Expand Down Expand Up @@ -63,12 +65,33 @@ class NotesMainPanel extends React.Component {
return <NoteWidget width={noteWidgetWidth} ID={notes.item.key} title={notes.item.title} shortMessage={notes.item.shortMessage}/>
};

render() {

renderWelcomePage = () => {
return(
<View style={styles.welcomePage}>
<Text style={styles.logoText}>ReactNativeNotes</Text>
<Text style={styles.introductionText}>Create your first note by clicking</Text>
<Text style={styles.plusIcon}>+</Text>
<Text style={styles.introductionText}>on the navigation panel</Text>
</View>
)
};

renderNotesPage = () => {
return(
<View style={styles.mainContainer}>
<FlatList key={this.state.columns} numColumns={this.state.columns} data={this.state.notes} renderItem={this.renderNote}/>
</View>
);
)
}

render() {
if(this.state.notes.length > 0){
return this.renderNotesPage();
}
else {
return this.renderWelcomePage();
}
}
};

Expand All @@ -81,9 +104,26 @@ const styles = StyleSheet.create({
backgroundColor: "transparent",
justifyContent: "space-around",
},
welcomeText: {
fontSize: 25,
fontFamily: "Papyrus",
welcomePage: {
flex: 1,
justifyContent: "center",
alignItems: "center"
},
logoText: {
fontSize: 35,
margin: 25,
color: "white"
},
plusIcon: {
fontSize: 30,
fontWeight: "bold",
color: "white"
},
introductionText: {
fontSize: 18,
margin: 0,
fontFamily: "Calibri",
color: "white"
}
});

Expand Down