Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

company logo and styles #48

Merged
merged 2 commits into from
Apr 14, 2019
Merged
Show file tree
Hide file tree
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
14 changes: 7 additions & 7 deletions client/dist/bundle.js

Large diffs are not rendered by default.

Binary file added client/dist/checked_contact.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/dist/company_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/dist/unchecked_contact.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion client/src/components/ButtonList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const ButtonList = ({selectView, uploadedView, purchasedView, renderContactList
return (
<div>
<div>
<h3>{'DASHBOARD'}</h3>
<h3>Dashboard</h3>
</div>
<div onClick={()=>{uploadedView(); }}>
<Button size="medium">
Expand Down
13 changes: 10 additions & 3 deletions client/src/components/DashBody.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class DashBody extends React.Component {
contact: null,
searchedContacts: [],
contactView: null,
renderContactList: false
renderContactList: false,
username: ''
};
const { classes } = props;
DashBody.propTypes = {
Expand All @@ -45,9 +46,11 @@ class DashBody extends React.Component {
componentWillMount(){
this.props.history.push('/dashboard')
document.body.style.backgroundImage = 'none';
this.props.getUserPoints();
this.props.getUserPoints();

}


componentWillUnmount(){
document.body.style.backgroundImage = "url('./leaddeal.png')"
}
Expand Down Expand Up @@ -175,7 +178,11 @@ render(){
<Grid container spacing={24}>
<Grid item xs>
<div className="left-top-display">
<ButtonList selectView={this.selectView} uploadedView={this.uploadedView} purchasedView={this.purchasedView} renderContactList={this.renderContactList}/>
<ButtonList
selectView={this.selectView}
uploadedView={this.uploadedView}
purchasedView={this.purchasedView}
renderContactList={this.renderContactList}/>
</div>

<div className="left-bottom-display">
Expand Down
3 changes: 2 additions & 1 deletion client/src/components/DashboardHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ function DashboardHeader(props) {
<div className={classes.root}>
<AppBar position="static">
<Toolbar>
<img src="./company_logo.png" height="60x" alt="logo" />
<Typography variant="h6" color="inherit" className={classes.grow}>
Lead the Deal

</Typography>

{ isLoggedIn ?
Expand Down
6 changes: 5 additions & 1 deletion client/src/components/LeadInfo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ const Practice = ({currentLead, contactView, contactPurchase}) => {
<CardActionArea>
<CardContent>
<Typography gutterBottom variant="h5" component="h2">
<div>{currentLead.name}</div>
<div>
{currentLead.name}
{currentLead.verified ? <span> <img src="./checked_contact.jpg" width="20px" alt="verified icon"/></span> :
<span> <img src="./unchecked_contact.jpg" width="20px" alt="unverified icon"/></span> }
</div>
</Typography>
<Divider/>
<div className="contact-info">
Expand Down
7 changes: 5 additions & 2 deletions client/src/components/UserHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,12 @@ class UserHeader extends React.Component {
<div className={classes.root}>
<AppBar position="static">
<Toolbar>
You have <div> - {this.props.points} - </div> points
<img src="./company_logo.png" height="60x" alt="logo"/>
&emsp;
&emsp;
&emsp;
<Typography variant="h6" color="inherit" className={classes.grow}>
Lead the Deal
<span>@{this.props.username}, you have <span>-{this.props.points}-</span> points </span>
</Typography>

<div>
Expand Down
10 changes: 5 additions & 5 deletions client/src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,15 @@ const styles = {
};




class App extends React.Component {


constructor(props){
super(props)
this.state = {
isLoggedin: false,
userId: null,
redirectTo: '',
username: '',
points: null
}
this.registerUser = this.registerUser.bind(this);
Expand Down Expand Up @@ -98,7 +96,8 @@ loginUser(username, password){
console.log(res);
this.setState({
isLoggedin: true,
userId: res.id
userId: res.id,
username: res.username
})

}).catch((err) => {
Expand All @@ -123,9 +122,10 @@ logOutUser(){

{this.state.isLoggedin ?
<div>
<UserHeader logOutUser={this.logOutUser} userId={this.state.userId} points={this.state.points}/>
<UserHeader logOutUser={this.logOutUser} userId={this.state.userId} points={this.state.points} username={this.state.username}/>
<DashBody auth={this.Auth}
userId={this.state.userId}
username={this.state.username}
updatePoints={this.updatePoints}
getUserPoints={this.getUserPoints}
points={this.state.points}/>
Expand Down
179 changes: 2 additions & 177 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ app.use(express.static(path.join(__dirname, '../client/dist')));
// })

//////////////////////////////////////////////////////////
///////////// AUTHENTICATION ////////////////////////////
///////////// ROUTES ////////////////////////////
//////////////////////////////////////////////////////

// app.use(session({secret: 'cat', resave: false, saveUninitialized: false}));
Expand All @@ -38,155 +38,9 @@ app.use(express.static(path.join(__dirname, '../client/dist')));

app.use('/api/auth', authRoutes);

app.use('/api/users', usersRoute)


///////////////////////////////////////////////////////////
///////////////////////////////Routes/////////////////////
//////////////////////////////////////////////////////////


//////////////////
/////USERS////////
//////////////////


//////GET ALL USERS /////////////

// app.get('/api/users', (req, res) => {

// db.User.findAll()
// .then((users) => {
// res.send(users);
// }).catch((err) => {
// console.error(err)
// res.send(err);
// });


// })

/////////SEARCH API ///////////////

//added to users.js
// app.post('/api/search', (req, res)=>{
// const query = req.body;
// ////// SETTING LOGIC TO HANDLE UNDEFINED VALUES ///////////////////////////
// if (!query.name){
// query.name = {[Op.ne]: 'UNDEFINED'}
// }
// else {
// query.name= {[Op.substring]: query.name}
// }
// //------------------------------------------------
// if (!query.company) {
// query.company = { [Op.ne]: 'UNDEFINED' }
// }
// else {
// query.company = { [Op.eq]: query.company }
// }
// //------------------------------------------------
// if (!query.industry) {
// query.industry = { [Op.ne]: 'UNDEFINED' }
// }
// else {
// query.industry = { [Op.eq]: query.industry }
// }
// //----------------------------------------------------

// if (!query.position) {
// query.position = { [Op.ne]: 'UNDEFINED' }
// }
// else {
// query.position = { [Op.eq]: query.position }
// }
// //------------------------------------------------------
// if (!query.address) {
// query.address = { [Op.ne]: 'UNDEFINED' }
// }
// else {
// query.address = { [Op.substring]: query.address }
// }

// db.Purchase.findAll({
// where:{
// user_id: 1 /// --------------------------------------------------will be changed when passport works
// }
// })
// .then((contacts)=>{
// let contactId = contacts.map((contact)=> contact.contact_id)

// db.Contact.findAll({
// where: {
// name: query.name,
// company: query.company,
// industry: query.industry,
// position: query.position,
// Address: query.address,
// id: { [Op.notIn]: contactId }
// }
// })
// .then((contacts)=>{

// const noContactInfo = contacts.map((contact)=>{
// const searchRes = {};
// searchRes.name = contact.name;
// searchRes.id = contact.id;
// searchRes.company = contact.company
// searchRes.industry = contact.industry;
// searchRes.position = contact.position;
// return searchRes;
// })
// res.send(noContactInfo)
// })
// .catch((err)=>{
// res.send(err)
// })

// })


// });


////////// UPLOAD API ///////////////////
// app.post('/api/users', usersRoute) ----------------------------------------------------------------------------!!!!!!!!!!!!!!

// app.post('/api/upload', (req, res)=>{
// const upload = req.body
// db.Contact.create({
// name: upload.name,
// position: upload.position,
// company: upload.company,
// industry: upload.industry,
// phone: upload.phone,
// email: upload.email,
// Address: upload.address,
// times_purchased: 0,
// userId: 1
// })
// .then((result)=>{
// console.log(result)
// })
// .catch((err)=>{
// console.log(err)
// })
// })
///////////////////////// PURCHASE CONTACT HANDLER ///////////////////////////////////

// app.post('/api/contact_purchase/:contactId', (req, res)=>{
// const contactId = req.params.contactId.slice(1)
// db.Purchase.create({
// user_id: 1, /////------------------------------------------------------------passport todo
// contact_id: contactId,
// })
// .then((result)=>{
// console.log(result)
// })
// .catch((err)=>{
// console.log(err)
// })
// })



/////INDIVIDUAL USER INFO/////////////
Expand All @@ -200,23 +54,7 @@ app.get('/api/users/:id', (req, res) => {
});
})

app.use('/api/users', usersRoute) //-----------------------------------------------------------!!!!!!

// app.get('/api/users/:id/uploaded_contacts', (req, res) => {
// req.params.id = 1;
// db.User.findAll({ where: { id: req.params.id } })
// .then((result) => {
// result[0].getUploads()
// .then((result) => {
// res.send(result);
// }).catch((err) => {
// res.send('there was an error locating uploaded users');
// });
// }).catch((err) => {
// res.send(err);
// });

// })


//added to users.js
Expand Down Expand Up @@ -251,19 +89,6 @@ app.delete('/api/users/:id', (req, res) => {
////// CONTACTS ////////
////////////////////////

// app.get('/api/contacts', (req, res) => {

// db.Contact.findAll()
// .then((contacts) => {
// res.send(contacts);
// }).catch((err) => {
// console.error(err)
// res.send(err);
// });


// })

app.get('/api/contacts/:id', (req, res) => {

})
Expand Down