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

adding swipe feature - updated dropdown feature to match bootstrap theme with log in page #9

Merged
merged 24 commits into from
Aug 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
af96959
added dropdown file requirement
jv-cortez Aug 14, 2017
79f7607
added react-swipe-card package
jv-cortez Aug 14, 2017
491e269
imported Main.jsx file and replaced h1 text
jv-cortez Aug 14, 2017
9b1d368
added swipe card code
jv-cortez Aug 14, 2017
209b9e5
added card stack css
jv-cortez Aug 14, 2017
f0fbf9b
fixed spacing
jv-cortez Aug 14, 2017
e06b42b
added and updated css for the card, menu and navbar
jv-cortez Aug 15, 2017
ec7326e
added comments regarding bugs
jv-cortez Aug 15, 2017
4b3e23c
added comments about card design and functions. removed h1.
jv-cortez Aug 15, 2017
5e0bb76
Merge pull request #4 from yowiputra/master
jv-cortez Aug 15, 2017
201c748
added pulled code from master repo
jv-cortez Aug 15, 2017
28f5823
resolved conflicts from merges
jv-cortez Aug 15, 2017
d779498
deleted .env example and debug log
jv-cortez Aug 15, 2017
a0dc38e
deleted Dropdown in place of NavigationBar
jv-cortez Aug 15, 2017
43e7236
replaced border on hover with background color change, changed font-…
jv-cortez Aug 15, 2017
e688784
deleted extra space
jv-cortez Aug 16, 2017
81b404c
removed react-menu css
jv-cortez Aug 16, 2017
1a679d7
transfered sign up and login links to Dropdown.jsx file
jv-cortez Aug 16, 2017
496ee9d
fixed spacing
jv-cortez Aug 16, 2017
7bd9af2
replaced react-menu with react-bootstrap
jv-cortez Aug 16, 2017
4bab2eb
removed react-menu package and added react-bootstrap package
jv-cortez Aug 16, 2017
8af13ff
removed Dropdown requirement and fixed spacing
jv-cortez Aug 16, 2017
3f5d657
Merge pull request #5 from jv-cortez/feature/swipe
jv-cortez Aug 16, 2017
84d1750
Merge branch 'master' into master
jv-cortez Aug 16, 2017
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
3 changes: 2 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@
"node-sass": "^4.5.3",
"prop-types": "^15.5.10",
"react": "^15.6.1",
"react-bootstrap": "^0.31.2",
"react-dom": "^15.6.1",
"react-menu": "0.0.10",
"react-redux": "^5.0.6",
"react-router": "^4.1.2",
"react-router-dom": "^4.1.2",
"react-swipe-card": "^0.1.4",
"react-tap-event-plugin": "^2.0.1",
"redux": "^3.7.2",
"redux-devtools-extension": "^2.13.2",
Expand Down
9 changes: 9 additions & 0 deletions client/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React, { Component } from 'react';
import injectTapEventPlugin from 'react-tap-event-plugin';
import { BrowserRouter as Router, Route } from 'react-router-dom';
import io from 'socket.io-client';
import Main from './Main.jsx';
import SignupPage from './SignupPage.jsx';
import { BrowserRouter as Router, Route, Redirect } from 'react-router-dom';
import Greetings from './Greetings.jsx';
Expand Down Expand Up @@ -32,6 +34,13 @@ class App extends Component {
const { isAuthenticated } = this.props.auth;

return (
<div>
<div className="container">
<NavigationBar />
</div>
<h1><strong>Here are your matches:</strong></h1>
<Main />

<div className="container">
<NavigationBar />
<Route exact path="/" component={Greetings} />
Expand Down
36 changes: 9 additions & 27 deletions client/src/Dropdown.jsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,16 @@
import React, { Component } from 'react';
import Menu from 'react-menu'

const MenuTrigger = Menu.MenuTrigger;
const MenuOptions = Menu.MenuOptions;
const MenuOption = Menu.MenuOption;
import { DropdownButton } from 'react-bootstrap';
import { MenuItem } from 'react-bootstrap';

class Dropdown extends Component {
render (){
render () {
return (
<Menu>
<MenuTrigger>
<p className="dropdown">
&#9776;
</p>
</MenuTrigger>
<MenuOptions>
<MenuOption>
Profile
</MenuOption>
<MenuOption>
Log In
</MenuOption>
<MenuOption>
Log Out
</MenuOption>
<MenuOption>
Quit
</MenuOption>
</MenuOptions>
</Menu>
<DropdownButton title="&#9776;">
<MenuItem href="#">Profile</MenuItem>
<MenuItem href="/signup">Sign Up</MenuItem>
<MenuItem href="/login">Log In</MenuItem>
<MenuItem href="#">Log Out </MenuItem>
</DropdownButton>
)
}
}
Expand Down
29 changes: 29 additions & 0 deletions client/src/Main.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React, { Component } from 'react';
import Cards, { Card } from 'react-swipe-card';

export default class Main extends Component {
render() {
// data will be an array of objects(most probably JSON), which each objects will contain the information from a user: username, text description, avatar, etc
// Each card should have an output for showing username, avatar, text description, and a button to send an invite
const data = ['Match #1', 'Match #2', 'Match #3', 'Match #4', 'Match #5', 'Match #6'];
return (
<div>
<Cards onEnd={() => console.log('end')} className='master-root'>
{data.map(item =>
//make card and card border bigger
//make sure it's mobile responsive
<Card
onSwipeLeft={() => console.log('swipe left')}
onSwipeRight={() => console.log('swipe right')}>
<h2>{item}</h2>
<img className="avatar" src="" alt="avatar image"/>
<p>Username</p>
<p className="card-text-description">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas vitae risus risus.</p>
<button className="btn-poke">Poke!</button>
</Card>
)}
</Cards>
</div>
)
}
}
8 changes: 8 additions & 0 deletions client/src/NavigationBar.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import Dropdown from './Dropdown.jsx';
import { connect } from 'react-redux';
import { logout } from '../actions/loginActions.jsx'


class NavigationBar extends Component {

logout(e) {
Expand All @@ -29,6 +31,12 @@ class NavigationBar extends Component {
</ul>
);


<div className="collapse navbar-collapse">
<ul className="nav navbar-nav navbar-right">
<Dropdown className="navbar-brand" />
</ul>

return (
<nav className="navbar navbar-default">
<div className="container-fluid">
Expand Down
14 changes: 7 additions & 7 deletions client/src/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require('../styles/main.scss');

import React from 'react';
import {render} from 'react-dom';
import { render } from 'react-dom';
import { BrowserRouter as Router, Route } from 'react-router-dom';
import ReactDOM from 'react-dom'
import App from './App.jsx';
Expand Down Expand Up @@ -29,9 +29,9 @@ if (localStorage.jwtToken) {
setAuthorizationToken(localStorage.jwtToken);

ReactDOM.render((
<Provider store={store}>
<Router>
<Route path="/" component={App}>
</Route>
</Router>
</Provider> ), document.getElementById('react-root'));
<Provider store={store}>
<Router>
<Route path="/" component={ App }>
</Route>
</Router>
</Provider> ), document.getElementById('react-root'));
123 changes: 122 additions & 1 deletion client/styles/main.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,126 @@
$brand-color: tomato;

h1 {
body{
background: white;
margin: 0;
}
h1, h2 {
color: $brand-color;
display: flex;
justify-content: center;
}
nav {
background: peachpuff;
display: flex;
justify-content: space-between;
padding: 10px;
}
.title {
margin: 0;
}
.dropdown {
margin: 0;
}

.navbar, .navbar-default{
display: block;
}

.caret {
display: none;
}

.master-root {
margin: 20px auto;
height: 50px;
position: relative;
min-height: 400px;
max-height: 100px;
width: 300px;
overflow: hidden;
border: 1px solid grey;
padding: 0px 0px 10px 0px;

}

.card {
background: peachpuff;
background-size: cover;
box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
cursor: pointer;
height: 300px;
text-align: center;
margin: 0 auto;
position: absolute;
transition: box-shadow .3s;
width: 180px;
}

.card:hover {
background: khaki;
}

.card-text-description {
font-size: small;
overflow-wrap: break-word;
}
.btn-poke{
margin: 50px;

}
.animate {
transition: transform .3s;
box-shadow: none;
}

.inactive {
box-shadow: none;
}

.alert {
width: 45%;
min-height: 10%;
position: absolute;
z-index: 9999;
opacity: 0;
transition: opacity .5s;
color: white;
vertical-align: middle;
line-height: 3rem;
}

.alert-visible {
opacity: 1;
}

.alert-right {
top: 0;
right: 0;
background: green;
border-top-left-radius: 50px;
border-bottom-left-radius: 50px;
}

.alert-left {
top: 0;
left: 0;
background: red;
border-top-right-radius: 50px;
border-bottom-right-radius: 50px;
}

.alert-top {
background: purple;
border-radius: 50px;
transform: translate(-50%, 0);
margin-left: 50%;
}

.alert-bottom {
bottom: 0;
background: blue;
border-top-left-radius: 50px;
border-radius: 50px;
transform: translate(-50%, 0);
margin-left: 50%;
}
9 changes: 0 additions & 9 deletions server/.env.example

This file was deleted.

13 changes: 6 additions & 7 deletions server/views/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css">



<title>Hello React</title>
</head>
<body>
<div id="react-root"></div>
<script src="/socket.io/socket.io.js"></script>
<script src='http://localhost:<%=process.env.WEBPACK_DEV_PORT%>/bundle.js'></script>
</body>
<body>
<div id="react-root"></div>
<script src="/socket.io/socket.io.js"></script>
<script src='http://localhost:<%=process.env.WEBPACK_DEV_PORT%>/bundle.js'></script>
</body>
</html>