Update styling of Github and Google Buttons, updating styling of Account Settings

This commit is contained in:
Cassie Tarakajian 2020-02-11 16:58:08 -05:00
parent 6931741813
commit 7ae02beb2d
3 changed files with 31 additions and 46 deletions

View file

@ -9,12 +9,27 @@ import { updateSettings, initiateVerification, createApiKey, removeApiKey } from
import AccountForm from '../components/AccountForm'; import AccountForm from '../components/AccountForm';
import { validateSettings } from '../../../utils/reduxFormUtils'; import { validateSettings } from '../../../utils/reduxFormUtils';
import GithubButton from '../components/GithubButton'; import GithubButton from '../components/GithubButton';
import GoogleButton from '../components/GoogleButton';
import APIKeyForm from '../components/APIKeyForm'; import APIKeyForm from '../components/APIKeyForm';
import Nav from '../../../components/Nav'; import Nav from '../../../components/Nav';
const __process = (typeof global !== 'undefined' ? global : window).process; const __process = (typeof global !== 'undefined' ? global : window).process;
const ROOT_URL = __process.env.API_URL; const ROOT_URL = __process.env.API_URL;
function SocialLoginPanel(props) {
return (
<React.Fragment>
<AccountForm {...props} />
<h2 className="form-container__divider">Social Login</h2>
<p className="account__social-text">
Use your GitHub or Google account to log into the p5.js Web Editor.
</p>
<GithubButton buttonText="Login with GitHub" />
<GoogleButton buttonText="Login with Google" />
</React.Fragment>
);
}
class AccountView extends React.Component { class AccountView extends React.Component {
componentDidMount() { componentDidMount() {
document.body.className = this.props.theme; document.body.className = this.props.theme;
@ -44,28 +59,14 @@ class AccountView extends React.Component {
</div> </div>
</TabList> </TabList>
<TabPanel> <TabPanel>
<AccountForm {...this.props} /> <SocialLoginPanel {...this.props} />
<h2 className="form-container__divider">Social Login</h2>
<p className="account__social-text">
Link this account with your GitHub account to allow login from both.
</p>
<GithubButton buttonText="Login with GitHub" />
</TabPanel> </TabPanel>
<TabPanel> <TabPanel>
<APIKeyForm {...this.props} /> <APIKeyForm {...this.props} />
</TabPanel> </TabPanel>
</Tabs> </Tabs>
} }
{!accessTokensUIEnabled && { !accessTokensUIEnabled && <SocialLoginPanel {...this.props} /> }
<div>
<AccountForm {...this.props} />
<h2 className="form-container__divider">Social Login</h2>
<p className="account__social-text">
Link this account with your GitHub account to allow login from both.
</p>
<GithubButton buttonText="Login with GitHub" />
</div>
}
</section> </section>
</div> </div>
); );

View file

@ -3,6 +3,7 @@
color: getThemifyVariable('primary-text-color'); color: getThemifyVariable('primary-text-color');
background-color: getThemifyVariable('background-color'); background-color: getThemifyVariable('background-color');
} }
height: 100%;
} }
.account-settings { .account-settings {

View file

@ -1,28 +1,4 @@
.github-button { .github-button,
@include themify() {
@extend %button;
& path {
color: getThemifyVariable('primary-text-color');
}
&:hover path, &:active path {
fill: $white;
}
&:hover, &:active {
background-color: getThemifyVariable('secondary-text-color');
border-color: getThemifyVariable('secondary-text-color');
}
}
width: #{300 / $base-font-size}rem;
display: flex;
justify-content: center;
align-items: center;
}
.github-icon {
margin-right: #{10 / $base-font-size}rem;
}
.google-button { .google-button {
@include themify() { @include themify() {
@extend %button; @extend %button;
@ -33,16 +9,23 @@
fill: $white; fill: $white;
} }
&:hover, &:active { &:hover, &:active {
background-color: getThemifyVariable('secondary-text-color'); color: getThemifyVariable('button-hover-color');
border-color: getThemifyVariable('secondary-text-color'); background-color: getThemifyVariable('button-background-hover-color');
border-color: getThemifyVariable('button-background-hover-color');
} }
} }
margin-top: #{4 / $base-font-size}rem; width: #{300 / $base-font-size}rem;
display: flex; display: flex;
flex-direction: row;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
width: #{300 / $base-font-size}rem;
& + & {
margin-top: #{10 / $base-font-size}rem;
}
}
.github-icon {
margin-right: #{10 / $base-font-size}rem;
} }
.google-icon { .google-icon {