From fe2d4143b007aedf7c353c1a2f66d4b2b55bb5af Mon Sep 17 00:00:00 2001 From: levithomason Date: Sat, 13 Feb 2016 12:50:55 -0800 Subject: [PATCH 1/3] update stardust --- package.json | 2 +- src/layouts/AppLayout/AppLayout.js | 21 ++++++++++++++------- src/layouts/AppLayout/AppLayout.scss | 7 ------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 9306d9b..42a7694 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "redux-localstorage-filter": "^0.1.1", "redux-simple-router": "^1.0.2", "redux-thunk": "^1.0.3", - "stardust": "^0.11.0" + "stardust": "^0.12.0" }, "devDependencies": { "autobind-decorator": "^1.3.2", diff --git a/src/layouts/AppLayout/AppLayout.js b/src/layouts/AppLayout/AppLayout.js index 8efbb25..28b886d 100644 --- a/src/layouts/AppLayout/AppLayout.js +++ b/src/layouts/AppLayout/AppLayout.js @@ -1,6 +1,7 @@ import React from 'react' import Header from 'components/Header/Header' -import classes from './AppLayout.scss' +import './AppLayout.scss' +import { Grid } from 'stardust' class AppLayout extends React.Component { static propTypes = { @@ -9,12 +10,18 @@ class AppLayout extends React.Component { render() { return ( -
-
-
- {this.props.children} -
-
+ + +
+ + + + + {this.props.children} + + + + ) } } diff --git a/src/layouts/AppLayout/AppLayout.scss b/src/layouts/AppLayout/AppLayout.scss index c386aa7..9b1c788 100644 --- a/src/layouts/AppLayout/AppLayout.scss +++ b/src/layouts/AppLayout/AppLayout.scss @@ -1,10 +1,3 @@ :global { @import 'core'; } - -.mainLayout { - display: flex; - flex: 1 0 0; - flex-flow: column wrap; - padding-top: 3.75em; -} From 0b40a21172d1d56725500233fc09e0b96a618dab Mon Sep 17 00:00:00 2001 From: levithomason Date: Sat, 13 Feb 2016 12:52:38 -0800 Subject: [PATCH 2/3] update views to use new stardust --- src/components/Header/Header.js | 7 ++++--- src/components/LoginForm/LoginForm.js | 7 +------ src/views/LoginView/LoginView.js | 5 ++--- src/views/ProfileView/ProfileView.js | 19 +++++++++++-------- 4 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/components/Header/Header.js b/src/components/Header/Header.js index 6590ff7..81ddb66 100644 --- a/src/components/Header/Header.js +++ b/src/components/Header/Header.js @@ -1,15 +1,16 @@ import React, { Component } from 'react' -import { Menu, MenuItem } from 'stardust' +import { Menu } from 'stardust' import { Link } from 'react-router' + export default class Header extends Component { render() { return ( - Profile + Profile - Dashboard + Dashboard ) diff --git a/src/components/LoginForm/LoginForm.js b/src/components/LoginForm/LoginForm.js index 9babd92..a1443f4 100644 --- a/src/components/LoginForm/LoginForm.js +++ b/src/components/LoginForm/LoginForm.js @@ -15,11 +15,6 @@ import { import { login } from 'services/session' -const FORM_SETTINGS = { - // stop Semantic UI from submitting form - onSuccess: () => false, -} - export default class LoginForm extends Component { static propTypes = { actions: PropTypes.object.isRequired, @@ -75,7 +70,7 @@ export default class LoginForm extends Component { return ( -
+ {this.renderErrorMessage()} return ( - + 3 Strand Code - + ) } diff --git a/src/views/ProfileView/ProfileView.js b/src/views/ProfileView/ProfileView.js index e48e006..b0cd2b8 100644 --- a/src/views/ProfileView/ProfileView.js +++ b/src/views/ProfileView/ProfileView.js @@ -1,17 +1,20 @@ -import React, { Component, PropTypes } from 'react' -import { - Grid, - Header, - Column, -} from 'stardust' +import React, { Component } from 'react' +import { Grid, Header, Button } from 'stardust' class ProfileView extends Component { render() { return ( - + Profile - + + + + + ) } From 74864d5698f2b138b04a1d5e311a38538697dc17 Mon Sep 17 00:00:00 2001 From: levithomason Date: Sun, 28 Feb 2016 23:54:27 -0800 Subject: [PATCH 3/3] wip --- src/components/Header/Header.js | 16 +++++---- src/components/LoginForm/LoginForm.js | 9 +++-- src/layouts/AppLayout/AppLayout.js | 14 ++++---- src/resources/tsc/index.js | 19 ++++++---- src/views/ProfileView/ProfileView.js | 51 +++++++++++++++++++++------ 5 files changed, 74 insertions(+), 35 deletions(-) diff --git a/src/components/Header/Header.js b/src/components/Header/Header.js index 81ddb66..f94bcdd 100644 --- a/src/components/Header/Header.js +++ b/src/components/Header/Header.js @@ -1,17 +1,19 @@ import React, { Component } from 'react' -import { Menu } from 'stardust' +import { Container, Menu } from 'stardust' import { Link } from 'react-router' export default class Header extends Component { render() { return ( - - Profile - - - Dashboard - + + + Profile + + + Dashboard + + ) } diff --git a/src/components/LoginForm/LoginForm.js b/src/components/LoginForm/LoginForm.js index a1443f4..7a4213d 100644 --- a/src/components/LoginForm/LoginForm.js +++ b/src/components/LoginForm/LoginForm.js @@ -6,7 +6,6 @@ import { connect } from 'react-redux' import { bindActionCreators } from 'redux' import { Button, - Field, Form, Input, Message, @@ -72,7 +71,7 @@ export default class LoginForm extends Component { {this.renderErrorMessage()} - + - - + + - + diff --git a/src/layouts/AppLayout/AppLayout.js b/src/layouts/AppLayout/AppLayout.js index 28b886d..11db2bb 100644 --- a/src/layouts/AppLayout/AppLayout.js +++ b/src/layouts/AppLayout/AppLayout.js @@ -1,7 +1,7 @@ import React from 'react' import Header from 'components/Header/Header' import './AppLayout.scss' -import { Grid } from 'stardust' +import { Container, Grid } from 'stardust' class AppLayout extends React.Component { static propTypes = { @@ -15,11 +15,13 @@ class AppLayout extends React.Component {
- - - {this.props.children} - - + + + + {this.props.children} + + + ) diff --git a/src/resources/tsc/index.js b/src/resources/tsc/index.js index eb04b1c..ae455b1 100644 --- a/src/resources/tsc/index.js +++ b/src/resources/tsc/index.js @@ -22,16 +22,19 @@ const DEFAULT_HEADERS = { 'Content-Type': 'application/json', } +const API_URL = 'https://threesc-api.herokuapp.com/' + const ENDPOINTS = { applicants: 'api/applicants/', assignments: 'api/assignments/', + connectGithub: 'login/github/', recipes: 'api/recipes/', - passwordReset: '/rest-auth/password/reset/', - passwordConfirm: '/rest-auth/password/reset/confirm/', - passwordChange: '/rest-auth/password/change/', - login: '/rest-auth/login/', - logout: '/rest-auth/logout/', - user: '/rest-auth/user/', + passwordReset: 'rest-auth/password/reset/', + passwordConfirm: 'rest-auth/password/reset/confirm/', + passwordChange: 'rest-auth/password/change/', + login: 'rest-auth/login/', + logout: 'rest-auth/logout/', + user: 'rest-auth/user/', } // ---------------------------------------------------- @@ -39,7 +42,7 @@ const ENDPOINTS = { // ---------------------------------------------------- const ajax = axios.create({ - baseURL: 'https://threesc-api.herokuapp.com', + baseURL: API_URL, }) ajax.interceptors.request.use(config => { @@ -94,6 +97,8 @@ tsc.logout = () => { return Promise.resolve() } +tsc.connectGithub = () => window.location = API_URL + ENDPOINTS.connectGithub + // ---------------------------------------------------- // Namespaces (resources/models) // ---------------------------------------------------- diff --git a/src/views/ProfileView/ProfileView.js b/src/views/ProfileView/ProfileView.js index b0cd2b8..4f9f002 100644 --- a/src/views/ProfileView/ProfileView.js +++ b/src/views/ProfileView/ProfileView.js @@ -1,20 +1,51 @@ import React, { Component } from 'react' -import { Grid, Header, Button } from 'stardust' +import { Button, Form, Grid, Header, Input, Segment } from 'stardust' +import tsc from 'resources/tsc' class ProfileView extends Component { + handleClickGithub() { + tsc.connectGithub() + } + render() { return ( - - Profile - + + + Profile + + + + + + + + Connect Services + + + + + - - - + + + + + + + + + + + + + + + + ) }