Skip to content
Open
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
ba5a466
Merge pull request #1 from CPSECapstone/main
cayalame Oct 1, 2020
9f55063
Merge pull request #2 from CPSECapstone/master
cayalame Oct 21, 2020
5c6c336
Merge branch 'develop' of https://github.com/CPSECapstone/Turtle into…
cayalame Oct 21, 2020
a85ad39
deve
cayalame Oct 22, 2020
ce0eb64
finished merge
cayalame Oct 22, 2020
af06a1b
updated
cayalame Oct 27, 2020
6835691
package
cayalame Oct 27, 2020
ae759ef
deleted extra prettier
cayalame Oct 27, 2020
dc935d6
Merge branch 'develop' of https://github.com/CPSECapstone/Turtle into…
cayalame Oct 29, 2020
a896397
Merge branch 'develop' of https://github.com/CPSECapstone/Turtle into…
cayalame Oct 29, 2020
cb45f1c
Merge branch 'develop' of https://github.com/CPSECapstone/Turtle into…
cayalame Oct 29, 2020
4560398
Mer:ge branch 'develop' of https://github.com/CPSECapstone/Turtle int…
cayalame Nov 5, 2020
069a435
Merge branch 'develop' of https://github.com/CPSECapstone/Turtle into…
cayalame Nov 5, 2020
f957178
package
cayalame Nov 5, 2020
8c4c52c
force
cayalame Nov 5, 2020
ec0632e
made newPage on start
cayalame Nov 10, 2020
325312e
Merge pull request #3 from cayalame/TUR-35n
cayalame Nov 10, 2020
888a723
erge branch 'develop' of https://github.com/CPSECapstone/Turtle into …
cayalame Nov 19, 2020
74a45a0
Initial Home.jsx change
cayalame Nov 4, 2020
91d5a75
changed folder name to EmptyPage
cayalame Nov 4, 2020
716d4e0
commented code
cayalame Nov 5, 2020
354c4e1
fixed routes
cayalame Nov 10, 2020
e135b3a
Update README.md
cayalame Nov 5, 2020
7a13f0a
removed commented code on index.js
cayalame Nov 10, 2020
713bebb
working test table
cayalame Nov 12, 2020
68c8a49
deleted leftover merge files
cayalame Nov 19, 2020
4f40142
switched default route to login
cayalame Nov 29, 2020
c26ead2
put background image
cayalame Nov 30, 2020
e4a78c0
added styled nav bar
cayalame Dec 1, 2020
2c772da
finished nav
cayalame Dec 2, 2020
edf2abf
fixed some things on login like spacing
cayalame Dec 2, 2020
eaa765c
finished login and register
cayalame Dec 3, 2020
28a2361
started mission statement
cayalame Dec 3, 2020
d87697b
Merge pull request #5 from cayalame/TUR-41
cayalame Dec 3, 2020
b351046
removed comments
cayalame Dec 3, 2020
7381b51
Merge branch 'develop' of https://github.com/CPSECapstone/Turtle into…
cayalame Dec 3, 2020
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Glossary

**UserInterface-as-a-Service** Date and UI compenents that can be effortlessly inserted into any apllications UI
**UserInterface-as-a-Service** Date and UI components that can be effortlessly inserted into any apllications UI

**Tokenization** The process of turning sensitive pieces of data into a non-sensitive random string of characters that has no value if breached.

Expand Down
37 changes: 21 additions & 16 deletions frontend/src/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ import { Provider } from 'react-redux';
import store from '../store';

import NavBar from '../components/NavBar/NavBar';
import Register from '../pages/Register';
import Login from '../pages/Login';
import Register from '../pages/Register/Register';
import Login from '../pages/Login/Login';
import Home from '../pages/Home/Home';
import PrivateRoute from '../components/private-route/PrivateRoute';
import NewPage from '../components/NewPage/NewPage';


// Check for token to keep user logged in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove da comments

if (localStorage.jwtToken) {
Expand All @@ -33,28 +35,31 @@ if (localStorage.jwtToken) {
// Logout user
store.dispatch(logoutUser());

// Redirect to login
window.location.href = './login';
// Redirect to NewPage, was login
window.location.href = './';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove .

}
}

function App () {
return (
return (
<Provider store={store}>
<Router>
<div>
<NavBar />
<div>
<NavBar />

<Switch>
<Route
exact
path='/'
component={() => <Redirect to='/login' />}
/>
<Route exact path='/login' component={Login} />
<Route exact path='/register' component={Register} />
<PrivateRoute exact path='/home' component={Home} />
</Switch>
<Switch>
<Route
exact
path='/'
component={() => <Redirect to='/login' />}
/>
<Route exact path='/newpage' component={NewPage}/>
<Route exact path='/login' component={Login} />
<Route exact path='/register' component={Register} />
<PrivateRoute exact path='/home' component={Home} />
</Switch>
</div>
</div>
</Router>
</Provider>
Expand Down
32 changes: 21 additions & 11 deletions frontend/src/components/NavBar/NavBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,35 @@ import { Link, withRouter } from "react-router-dom";
import PropTypes from "prop-types";
import { connect } from "react-redux";
import { logoutUser } from "../../actions/authActions";
import { MainNav, NavLogo, StyledLinked, Header, NavItemLocation} from "./NavBar.styled";
import logo from '../../images/real.png';

class NavBar extends Component {
render() {
const { auth, logoutUser } = this.props;

return (
<>
{auth.isAuthenticated ? (
<MainNav>
<NavLogo>
<img src={logo}/>
</NavLogo>
<Header>Cloud Haven</Header>
<NavItemLocation>
<>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont need empty <>

<button onClick={logoutUser}>Sign out</button>
<p key={3}>{`Logged in as: You`}</p>
{auth.isAuthenticated ? (
<>
<button onClick={logoutUser}>Sign out</button>
<p key={3}>{`Logged in as: You`}</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why key?

</>
) : (
<>
<StyledLinked to="login">Login</StyledLinked>
<StyledLinked to="register">Register </StyledLinked>
</>
)}
</>
) : (
<>
<Link to="/login">Login</Link>
<Link to="/register">Register</Link>
</>
)}
</>
</NavItemLocation>
</MainNav>
);
}
}
Expand Down
56 changes: 56 additions & 0 deletions frontend/src/components/NavBar/NavBar.styled.js
Original file line number Diff line number Diff line change
@@ -1 +1,57 @@
import styled from 'styled-components';
import { Link } from "react-router-dom";

export const MainNav = styled.a`
align-items: center;
background: gray;
display: flex;
flex-flow: row nowrap;
-webkit-font-smoothing: antialiased;
height: 60px;
padding: 0 30px;
box-shadow: 0 2px 4px 0 rgba(0,0,0,.2);
`;

export const NavLogo = styled.a`
display: flex;
height: 100%;
margin-right: 10px;
transition: opacity 0.2s ease-in-out;
:hover {
cursor: pointer;
opacity: 0.5;
}
> img {
margin: auto;
}
`;

export const StyledLinked = styled(Link)`
font-family: 'Trebuchet MS', sans-serif;
color: white;
text-decoration: none;
height: 100%;
padding: 0px 20px;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sure spacing like this is everywhere before a :hover or &something

:hover {
color: black;
transition: all 0.3s ease;
}
`;

export const Header = styled.h2`
text-align: center;
color: black;
font-family: 'Trebuchet MS', sans-serif;
:hover {
cursor: pointer;
}
`;

export const NavItemLocation = styled.div`
display: flex;
flex-flow: row nowrap;
align-items: center;
margin-left: auto;
justify-content: space-between;
`;
50 changes: 50 additions & 0 deletions frontend/src/components/NewPage/NewPage.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import React, { Component } from "react";

class NewPage extends Component {

constructor(props) {
super(props);
this.state = {
students: [
{ id: 1, name: 'Joe', age: 21, email: '[email protected]'},
{ id: 2, name: 'Bob', age: 22, email: '[email protected]'}
]
}
}

returnTableData() {
return this.state.students.map((student, index) => {
let col = Object.keys(student)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wheres you ; bro

return (
<tr key={student.id}>
{col.map((val, index) => {
return <td key={index}>{student[col[index]]}</td>
})}
</tr>
)
})
}

renderTableHeader() {
let header = Object.keys(this.state.students[0])
return header.map((key, index) => {
return <th key={index}>{key.toUpperCase()}</th>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

key should probably be key... isn't key and index the same?

})
}

render() {
return (
<div>
<h1 id='title'>TESTING TABLE PAGE</h1>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove id and replace with styled components

<table id='students'>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

<tbody>
<tr>{this.renderTableHeader()}</tr>
{this.returnTableData()}
</tbody>
</table>
</div>
)
}
}

export default NewPage;
2 changes: 2 additions & 0 deletions frontend/src/components/NewPage/NewPage.styled.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import styled from 'styled-components';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we rename newpage to something more specific


Empty file.
Binary file added frontend/src/images/gray.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 frontend/src/images/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 frontend/src/images/real.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 frontend/src/images/test.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 frontend/src/images/testLOGO.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 15 additions & 2 deletions frontend/src/pages/Home/Home.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
import React, { Component } from "react";

export default class Home extends Component {
export default class EmptyPage extends Component {
constructor(props) {
super(props);
}

// parser(input) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove all comments

// return <div>
// <h3>Hello</h3>
// </div>;
// }

render() {
//const { children } = parser(this.props);

return (
<div>
Welcome Home
{/* { children } */}
<h3>Hello</h3>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

umm why?

</div>
)
}
Expand Down
102 changes: 0 additions & 102 deletions frontend/src/pages/Login.jsx

This file was deleted.

Loading