-
Notifications
You must be signed in to change notification settings - Fork 47
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
PCD-1309 Fix/css refactor 2 #326
Changes from all commits
893b901
9aad782
2708f41
eca86a4
8bfcab7
17aa95d
441a260
3490502
e4806e5
5e2bef4
f67f51a
dc416c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.data-model-graph { | ||
position: relative; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.explorer-component { | ||
display: flex; | ||
padding: 40px 0; | ||
background-color: #ecebeb; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. where did this color come from? |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.index-page { | ||
width: 1220px; | ||
padding: 75px 0px 40px 0px; | ||
} | ||
|
||
.index-page__top { | ||
width: 100%; | ||
display: inline-flex; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,9 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import querystring from 'querystring'; | ||
import PropTypes from 'prop-types'; // see https://github.com/facebook/prop-types#prop-types | ||
|
||
import { basename, appname } from '../localconf'; | ||
import SlidingWindow from '../components/SlidingWindow'; | ||
|
||
const CentralBox = styled.div` | ||
text-align: center; | ||
width: 756px; | ||
margin: auto 0px; | ||
padding: 0px 100px; | ||
vertical-align: middle; | ||
display: table-cell; | ||
color: #000000; | ||
`; | ||
|
||
const LoginFrame = styled.div` | ||
display: table; | ||
`; | ||
|
||
const LeftBox = styled.div` | ||
width: 257px; | ||
text-align: center; | ||
padding: 0px; | ||
float: left; | ||
min-height: 100%; | ||
`; | ||
|
||
const RightBox = styled.div` | ||
width: 257px; | ||
text-align: center; | ||
padding: 0px; | ||
float: right; | ||
min-height: 100%; | ||
`; | ||
|
||
const Line = styled.hr` | ||
width: 30px; | ||
height: 5px; | ||
text-align: center; | ||
color: #9b9b9b; | ||
background-color: #9b9b9b; | ||
text-align: center; | ||
margin: 17px auto; | ||
`; | ||
|
||
export const LoginButton = styled.a` | ||
font-size: 1em; | ||
`; | ||
import './Login.less'; | ||
|
||
const getInitialState = height => ({ height }); | ||
|
||
|
@@ -93,29 +48,33 @@ class Login extends React.Component { | |
next = basename === '/' ? queryParams.next : basename + queryParams.next; | ||
} | ||
return ( | ||
<LoginFrame> | ||
<LeftBox style={{ height: `${this.state.height}px` }}> | ||
<div className="login-page"> | ||
<div className="login-page__side-box"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
<SlidingWindow | ||
iconName={'gene'} | ||
dictIcons={this.props.dictIcons} | ||
height={this.state.height} | ||
scrollY={window.scrollY} | ||
/> | ||
</LeftBox> | ||
<CentralBox> | ||
<div className="h1-typo" style={{ marginBottom: '11px', lineHeight: '40px' }}>{this.props.data.title}</div> | ||
<div className="high-light" style={{ textTransform: 'uppercase' }}>{this.props.data.subTitle}</div> | ||
<Line /> | ||
</div> | ||
<div className="login-page__central-content"> | ||
<div className="h1-typo login-page__title"> | ||
{this.props.data.title} | ||
</div> | ||
<div className="high-light login-page__sub-title"> | ||
{this.props.data.subTitle} | ||
</div> | ||
<hr className="login-page__separator" /> | ||
<div className="body-typo">{this.props.data.text}</div> | ||
{ | ||
this.props.providers.map( | ||
p => ( | ||
<div key={p.id} style={{ margin: '25px 0px' }}> | ||
<LoginButton href={`${p.url}?redirect=${window.location.origin}${next}`}> | ||
<div key={p.id} className="login-page__entries"> | ||
<a href={`${p.url}?redirect=${window.location.origin}${next}`}> | ||
<button className="button-primary-orange"> | ||
{p.name} | ||
</button> | ||
</LoginButton> | ||
</a> | ||
</div> | ||
), | ||
) | ||
|
@@ -126,16 +85,16 @@ class Login extends React.Component { | |
{this.props.data.email} | ||
</a>{'.'} | ||
</div> | ||
</CentralBox> | ||
<RightBox style={{ height: `${this.state.height}px` }}> | ||
</div> | ||
<div className="login-page__side-box"> | ||
<SlidingWindow | ||
iconName={'gene'} | ||
dictIcons={this.props.dictIcons} | ||
height={this.state.height} | ||
scrollY={window.scrollY} | ||
/> | ||
</RightBox> | ||
</LoginFrame> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
.login-page { | ||
display: flex; | ||
justify-content: space-between; | ||
} | ||
|
||
.login-page__side-box { | ||
width: 257px; | ||
min-width: 257px; | ||
text-align: center; | ||
display: flex; | ||
justify-content: center; | ||
} | ||
|
||
.login-page__side-box svg { | ||
display: block; | ||
} | ||
|
||
.login-page__central-content { | ||
text-align: center; | ||
width: 756px; | ||
margin: auto; | ||
padding: 0 100px; | ||
color: #000000; | ||
} | ||
|
||
.login-page__title { | ||
margin-bottom: 11px; | ||
line-height: 40px; | ||
} | ||
|
||
.login-page__sub-title { | ||
text-transform: uppercase; | ||
} | ||
|
||
.login-page__separator { | ||
width: 30px; | ||
height: 5px; | ||
text-align: center; | ||
background-color: #9b9b9b; | ||
margin: 17px auto; | ||
} | ||
|
||
.login-page__entries { | ||
margin: 25px 0; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import React from 'react'; | ||
import { Redirect } from 'react-router-dom'; | ||
import styled from 'styled-components'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import { fetchUser, fetchOAuthURL, fetchWithCreds, fetchProjects } from '../actions'; | ||
import Spinner from '../components/Spinner'; | ||
import getReduxStore from '../reduxStore'; | ||
|
@@ -12,13 +10,6 @@ import ReduxAuthTimeoutPopup from '../Popup/ReduxAuthTimeoutPopup'; | |
let lastAuthMs = 0; | ||
let lastTokenRefreshMs = 0; | ||
|
||
const Body = styled.div` | ||
background: ${props => props.background}; | ||
margin-left: auto; | ||
margin-right: auto; | ||
width: 1220px; | ||
`; | ||
|
||
/** | ||
* Redux listener - just clears auth-cache on logout | ||
*/ | ||
|
@@ -61,7 +52,6 @@ export function intersection(aList, bList) { | |
* @param history from react-router | ||
* @param match from react-router.match | ||
* @param public default false - set true to disable auth-guard | ||
* @param background passed through to <Box background> wrapper for page.jsx-level background | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need this param for anything? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did some global searching, and found that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. awesome, makes sense to me |
||
* @param filter {() => Promise} optional filter to apply before rendering the child component | ||
*/ | ||
class ProtectedContent extends React.Component { | ||
|
@@ -76,13 +66,11 @@ class ProtectedContent extends React.Component { | |
}, | ||
).isRequired, | ||
public: PropTypes.bool, | ||
background: PropTypes.string, | ||
filter: PropTypes.func, | ||
}; | ||
|
||
static defaultProps = { | ||
public: false, | ||
background: null, | ||
filter: null, | ||
}; | ||
|
||
|
@@ -302,32 +290,29 @@ class ProtectedContent extends React.Component { | |
params = this.props.match.params || {}; | ||
} | ||
window.scrollTo(0, 0); | ||
const styleProps = { | ||
background: this.props.background, | ||
}; | ||
if (this.state.redirectTo) { | ||
return (<Redirect to={this.state.redirectTo} />); | ||
} else if (this.props.public && (!this.props.filter || typeof this.props.filter !== 'function')) { | ||
return ( | ||
<Body {...styleProps}> | ||
<div> | ||
<Component params={params} location={this.props.location} history={this.props.history} /> | ||
</Body> | ||
</div> | ||
); | ||
} else if (!this.props.public && this.state.authenticated) { | ||
return ( | ||
<Body {...styleProps}> | ||
<div> | ||
<ReduxAuthTimeoutPopup /> | ||
<Component params={params} location={this.props.location} history={this.props.history} /> | ||
</Body> | ||
</div> | ||
); | ||
} else if (this.props.public && this.state.dataLoaded) { | ||
return ( | ||
<Body {...styleProps}> | ||
<div> | ||
<Component params={params} location={this.props.location} history={this.props.history} /> | ||
</Body> | ||
</div> | ||
); | ||
} | ||
return (<Body {...styleProps}><Spinner /></Body>); | ||
return (<div><Spinner /></div>); | ||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to add the styles from
ToggleButton
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ToggleButton
only has 2 css attributetop
andleft
, They don't have any effect for the button in this page so I directly remove them