Commit 0f8c7909 authored by Lyza Danger Gardner's avatar Lyza Danger Gardner

Refactor HelpPanel styling

parent e8d2a035
...@@ -99,15 +99,15 @@ function HelpPanel({ auth, session }) { ...@@ -99,15 +99,15 @@ function HelpPanel({ auth, session }) {
panelName={uiConstants.PANEL_HELP} panelName={uiConstants.PANEL_HELP}
onActiveChanged={onActiveChanged} onActiveChanged={onActiveChanged}
> >
<div className="help-panel__content"> <div className="help-panel__content u-vertical-rhythm">
<div className="help-panel__subtitle"> <div className="u-layout-row--align-middle">
<h3 className="help-panel__sub-panel-title"> <h3 className="help-panel__sub-panel-title">
{subPanelTitles[activeSubPanel]} {subPanelTitles[activeSubPanel]}
</h3> </h3>
<div className="help-panel__navigation"> <div>
{activeSubPanel === 'versionInfo' && ( {activeSubPanel === 'versionInfo' && (
<button <button
className="help-panel__sub-panel-link" className="help-panel__sub-panel-navigation-button"
onClick={e => openSubPanel(e, 'tutorial')} onClick={e => openSubPanel(e, 'tutorial')}
aria-label="Show tutorial panel" aria-label="Show tutorial panel"
> >
...@@ -120,15 +120,12 @@ function HelpPanel({ auth, session }) { ...@@ -120,15 +120,12 @@ function HelpPanel({ auth, session }) {
)} )}
{activeSubPanel === 'tutorial' && ( {activeSubPanel === 'tutorial' && (
<button <button
className="help-panel__sub-panel-link" className="help-panel__sub-panel-navigation-button"
onClick={e => openSubPanel(e, 'versionInfo')} onClick={e => openSubPanel(e, 'versionInfo')}
aria-label="Show version information panel" aria-label="Show version information panel"
> >
About this version About this version
<SvgIcon <SvgIcon name="arrow-right" />
name="arrow-right"
className="help-panel__sub-panel-link-icon"
/>
</button> </button>
)} )}
</div> </div>
......
...@@ -58,14 +58,16 @@ describe('HelpPanel', function () { ...@@ -58,14 +58,16 @@ describe('HelpPanel', function () {
it('should show navigation link to versionInfo sub-panel', () => { it('should show navigation link to versionInfo sub-panel', () => {
const wrapper = createComponent(); const wrapper = createComponent();
const link = wrapper.find('.help-panel__sub-panel-link'); const link = wrapper.find('.help-panel__sub-panel-navigation-button');
assert.equal(link.text(), 'About this version'); assert.equal(link.text(), 'About this version');
}); });
it('should switch to versionInfo sub-panel when footer link clicked', () => { it('should switch to versionInfo sub-panel when footer link clicked', () => {
const wrapper = createComponent(); const wrapper = createComponent();
wrapper.find('.help-panel__sub-panel-link').simulate('click'); wrapper
.find('.help-panel__sub-panel-navigation-button')
.simulate('click');
assert.equal( assert.equal(
wrapper.find('.help-panel__sub-panel-title').text(), wrapper.find('.help-panel__sub-panel-title').text(),
...@@ -83,9 +85,11 @@ describe('HelpPanel', function () { ...@@ -83,9 +85,11 @@ describe('HelpPanel', function () {
context('when viewing versionInfo sub-panel', () => { context('when viewing versionInfo sub-panel', () => {
it('should show navigation link back to tutorial sub-panel', () => { it('should show navigation link back to tutorial sub-panel', () => {
const wrapper = createComponent(); const wrapper = createComponent();
wrapper.find('.help-panel__sub-panel-link').simulate('click'); wrapper
.find('.help-panel__sub-panel-navigation-button')
.simulate('click');
const link = wrapper.find('.help-panel__sub-panel-link'); const link = wrapper.find('.help-panel__sub-panel-navigation-button');
assert.isTrue(wrapper.find('VersionInfo').exists()); assert.isTrue(wrapper.find('VersionInfo').exists());
assert.isFalse(wrapper.find('Tutorial').exists()); assert.isFalse(wrapper.find('Tutorial').exists());
...@@ -96,9 +100,11 @@ describe('HelpPanel', function () { ...@@ -96,9 +100,11 @@ describe('HelpPanel', function () {
const wrapper = createComponent(); const wrapper = createComponent();
// Click to get to version-info sub-panel... // Click to get to version-info sub-panel...
wrapper.find('.help-panel__sub-panel-link').simulate('click'); wrapper
.find('.help-panel__sub-panel-navigation-button')
.simulate('click');
const link = wrapper.find('.help-panel__sub-panel-link'); const link = wrapper.find('.help-panel__sub-panel-navigation-button');
// Click again to get back to tutorial sub-panel // Click again to get back to tutorial sub-panel
link.simulate('click'); link.simulate('click');
......
@use "../../mixins/buttons"; @use "../../mixins/buttons";
@use "../../mixins/layout"; @use "../../mixins/layout";
@use "../../mixins/molecules";
@use "../../mixins/utils"; @use "../../mixins/utils";
@use "../../variables" as var; @use "../../variables" as var;
.help-panel { .help-panel {
&__content {
@include layout.vertical_rhythm;
}
&__subtitle {
@include layout.row($justify: right, $align: center);
}
&__sub-panel-title { &__sub-panel-title {
@include utils.font--large; @include utils.font--large;
flex-grow: 1; flex-grow: 1;
...@@ -20,7 +13,6 @@ ...@@ -20,7 +13,6 @@
&__subcontent { &__subcontent {
@include utils.border-top; @include utils.border-top;
@include utils.border-bottom; @include utils.border-bottom;
padding: 0.5em 0;
a { a {
text-decoration: underline; text-decoration: underline;
...@@ -31,40 +23,11 @@ ...@@ -31,40 +23,11 @@
@include utils.icon--xsmall; @include utils.icon--xsmall;
} }
&__sub-panel-link { &__sub-panel-navigation-button {
@include buttons.reset-native-btn-styles; @include buttons.button--navigation;
@include layout.row($align: center);
margin-left: auto;
color: var.$color-brand;
&-icon {
margin-left: 2px;
width: 12px;
height: 12px;
}
} }
&-tabs { &-tabs {
@include layout.row($align: center); @include molecules.panel-tabs;
&__tab {
@include utils.font--large;
@include utils.border-right;
flex: 1 1;
text-align: center;
color: var.$color-text-light;
&:last-of-type {
border-right: none;
}
}
&__link {
color: var.$color-text-light;
}
&__icon {
@include utils.icon--xsmall;
}
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment