fix: group help buttons (#37671)
This commit is contained in:
committed by
Ahmad Abdolsaheb
parent
cd5131b07c
commit
3304b95213
@ -210,7 +210,6 @@ fieldset[disabled] .btn-primary.focus {
|
|||||||
.btn-cta {
|
.btn-cta {
|
||||||
background-color: #ffac33;
|
background-color: #ffac33;
|
||||||
background-image: linear-gradient(#ffcc4d, #ffac33);
|
background-image: linear-gradient(#ffcc4d, #ffac33);
|
||||||
-ms-filter: 'progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffcc4d, endColorstr=#ffac33, GradientType=0)';
|
|
||||||
border-color: #f1a02a;
|
border-color: #f1a02a;
|
||||||
color: #0a0a23 !important;
|
color: #0a0a23 !important;
|
||||||
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
|
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
|
||||||
@ -221,7 +220,6 @@ fieldset[disabled] .btn-primary.focus {
|
|||||||
.btn-cta:active:hover {
|
.btn-cta:active:hover {
|
||||||
background-color: #e99110;
|
background-color: #e99110;
|
||||||
background-image: linear-gradient(#ffcc4d, #e99110);
|
background-image: linear-gradient(#ffcc4d, #e99110);
|
||||||
-ms-filter: 'progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffcc4d, endColorstr=#e99110, GradientType=0)';
|
|
||||||
color: #0a0a23 !important;
|
color: #0a0a23 !important;
|
||||||
}
|
}
|
||||||
.btn-cta:active {
|
.btn-cta:active {
|
||||||
@ -319,11 +317,18 @@ hr {
|
|||||||
border-radius: 0px;
|
border-radius: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dropdown-menu {
|
||||||
|
background-color: var(--secondary-color);
|
||||||
|
}
|
||||||
|
|
||||||
.dropdown-menu > li > a {
|
.dropdown-menu > li > a {
|
||||||
color: var(--secondary-background);
|
color: var(--secondary-background);
|
||||||
}
|
}
|
||||||
.dropdown-menu {
|
|
||||||
background-color: var(--secondary-color);
|
.dropdown-menu > li > a:hover,
|
||||||
|
.dropdown-menu > li > a:focus {
|
||||||
|
color: var(--secondary-color);
|
||||||
|
background-color: var(--secondary-background);
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-striped > tbody > tr:nth-child(2n + 1) > td,
|
.table-striped > tbody > tr:nth-child(2n + 1) > td,
|
||||||
|
@ -3,7 +3,11 @@ import PropTypes from 'prop-types';
|
|||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import { Button } from '@freecodecamp/react-bootstrap';
|
import {
|
||||||
|
Button,
|
||||||
|
DropdownButton,
|
||||||
|
MenuItem
|
||||||
|
} from '@freecodecamp/react-bootstrap';
|
||||||
|
|
||||||
import './tool-panel.css';
|
import './tool-panel.css';
|
||||||
import { openModal, executeChallenge } from '../redux';
|
import { openModal, executeChallenge } from '../redux';
|
||||||
@ -42,7 +46,7 @@ function ToolPanel({
|
|||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<div
|
<div
|
||||||
className={`tool-panel-group ${
|
className={`tool-panel-group button-group ${
|
||||||
isMobile ? 'tool-panel-group-mobile' : ''
|
isMobile ? 'tool-panel-group-mobile' : ''
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
@ -57,35 +61,40 @@ function ToolPanel({
|
|||||||
>
|
>
|
||||||
{isMobile ? 'Reset' : 'Reset All Code'}
|
{isMobile ? 'Reset' : 'Reset All Code'}
|
||||||
</Button>
|
</Button>
|
||||||
{guideUrl ? (
|
<DropdownButton
|
||||||
<Button
|
|
||||||
block={true}
|
block={true}
|
||||||
|
bsStyle='primary'
|
||||||
|
className='btn-invert'
|
||||||
|
id='get-help-dropdown'
|
||||||
|
title={isMobile ? 'Help' : 'Get Help'}
|
||||||
|
>
|
||||||
|
{guideUrl ? (
|
||||||
|
<MenuItem
|
||||||
bsStyle='primary'
|
bsStyle='primary'
|
||||||
className='btn-invert'
|
className='btn-invert'
|
||||||
href={guideUrl}
|
href={guideUrl}
|
||||||
target='_blank'
|
target='_blank'
|
||||||
>
|
>
|
||||||
{isMobile ? 'Hint' : 'Get a hint'}
|
{'Get a Hint'}
|
||||||
</Button>
|
</MenuItem>
|
||||||
) : null}
|
) : null}
|
||||||
{videoUrl ? (
|
{videoUrl ? (
|
||||||
<Button
|
<MenuItem
|
||||||
block={true}
|
|
||||||
bsStyle='primary'
|
bsStyle='primary'
|
||||||
className='btn-invert'
|
className='btn-invert'
|
||||||
onClick={openVideoModal}
|
onClick={openVideoModal}
|
||||||
>
|
>
|
||||||
{isMobile ? 'Video' : 'Watch a video'}
|
{'Watch a video'}
|
||||||
</Button>
|
</MenuItem>
|
||||||
) : null}
|
) : null}
|
||||||
<Button
|
<MenuItem
|
||||||
block={true}
|
|
||||||
bsStyle='primary'
|
bsStyle='primary'
|
||||||
className='btn-invert'
|
className='btn-invert'
|
||||||
onClick={openHelpModal}
|
onClick={openHelpModal}
|
||||||
>
|
>
|
||||||
{isMobile ? 'Help' : 'Ask for help'}
|
{'Ask for help'}
|
||||||
</Button>
|
</MenuItem>
|
||||||
|
</DropdownButton>
|
||||||
</div>
|
</div>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
);
|
||||||
|
@ -11,11 +11,43 @@
|
|||||||
.tool-panel-group-mobile {
|
.tool-panel-group-mobile {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row-reverse;
|
flex-direction: row-reverse;
|
||||||
padding: 0 2px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.tool-panel-group-mobile .btn-block + .btn-block {
|
.tool-panel-group-mobile > .btn-block,
|
||||||
|
.tool-panel-group-mobile > .dropdown > .btn-block {
|
||||||
margin: 0 2px 0 0;
|
margin: 0 2px 0 0;
|
||||||
padding-left: 8px;
|
padding: 5px 0px;
|
||||||
padding-right: 8px;
|
}
|
||||||
|
|
||||||
|
.tool-panel-group .btn-group {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tool-panel-group-mobile .btn-group {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
margin: 0 2px 0 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tool-panel-group-mobile .btn {
|
||||||
|
margin-bottom: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tool-panel-group .dropdown-menu {
|
||||||
|
top: auto;
|
||||||
|
bottom: 100%;
|
||||||
|
width: calc(100% + 2px);
|
||||||
|
text-align: center;
|
||||||
|
min-width: 240px;
|
||||||
|
left: -1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tool-panel-group .dropdown-menu a {
|
||||||
|
padding: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
#get-help-dropdown > .caret {
|
||||||
|
transform: rotate(180deg);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user