Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
0f8c7909
Commit
0f8c7909
authored
Jun 23, 2020
by
Lyza Danger Gardner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor HelpPanel styling
parent
e8d2a035
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
56 deletions
+22
-56
help-panel.js
src/sidebar/components/help-panel.js
+6
-9
help-panel-test.js
src/sidebar/components/test/help-panel-test.js
+12
-6
help-panel.scss
src/styles/sidebar/components/help-panel.scss
+4
-41
No files found.
src/sidebar/components/help-panel.js
View file @
0f8c7909
...
@@ -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__subtit
le"
>
<
div
className
=
"
u-layout-row--align-midd
le"
>
<
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
>
...
...
src/sidebar/components/test/help-panel-test.js
View file @
0f8c7909
...
@@ -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'
);
...
...
src/styles/sidebar/components/help-panel.scss
View file @
0f8c7909
@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
;
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment