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
4c3b5e13
Commit
4c3b5e13
authored
Apr 06, 2021
by
Lyza Danger Gardner
Committed by
Lyza Gardner
Apr 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `LinkButton` instead of `Button`
parent
6ef66155
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
21 deletions
+17
-21
AnnotationHeader.js
src/sidebar/components/Annotation/AnnotationHeader.js
+4
-7
AnnotationHeader-test.js
...debar/components/Annotation/test/AnnotationHeader-test.js
+2
-2
LoggedOutMessage.js
src/sidebar/components/LoggedOutMessage.js
+7
-5
LoggedOutMessage-test.js
src/sidebar/components/test/LoggedOutMessage-test.js
+1
-1
AnnotationHeader.scss
src/styles/sidebar/components/AnnotationHeader.scss
+0
-5
LoggedOutMessage.scss
src/styles/sidebar/components/LoggedOutMessage.scss
+3
-1
No files found.
src/sidebar/components/Annotation/AnnotationHeader.js
View file @
4c3b5e13
...
@@ -13,7 +13,7 @@ import {
...
@@ -13,7 +13,7 @@ import {
import
{
annotationDisplayName
}
from
'../../helpers/annotation-user'
;
import
{
annotationDisplayName
}
from
'../../helpers/annotation-user'
;
import
{
isPrivate
}
from
'../../helpers/permissions'
;
import
{
isPrivate
}
from
'../../helpers/permissions'
;
import
Button
from
'../Button
'
;
import
{
LinkButton
}
from
'../../../shared/components/buttons
'
;
import
AnnotationDocumentInfo
from
'./AnnotationDocumentInfo'
;
import
AnnotationDocumentInfo
from
'./AnnotationDocumentInfo'
;
import
AnnotationShareInfo
from
'./AnnotationShareInfo'
;
import
AnnotationShareInfo
from
'./AnnotationShareInfo'
;
...
@@ -133,12 +133,9 @@ function AnnotationHeader({
...
@@ -133,12 +133,9 @@ function AnnotationHeader({
displayName
=
{
authorDisplayName
}
displayName
=
{
authorDisplayName
}
/
>
/
>
{
showReplyButton
&&
(
{
showReplyButton
&&
(
<
Button
<
LinkButton
onClick
=
{
onReplyCountClick
}
title
=
"Expand replies"
>
className
=
"AnnotationHeader__reply-toggle"
{
replyButtonText
}
buttonText
=
{
replyButtonText
}
<
/LinkButton
>
onClick
=
{
onReplyCountClick
}
title
=
"Expand replies"
/>
)}
)}
{
showTimestamps
&&
(
{
showTimestamps
&&
(
...
...
src/sidebar/components/Annotation/test/AnnotationHeader-test.js
View file @
4c3b5e13
...
@@ -149,7 +149,7 @@ describe('AnnotationHeader', () => {
...
@@ -149,7 +149,7 @@ describe('AnnotationHeader', () => {
describe
(
'expand replies toggle button'
,
()
=>
{
describe
(
'expand replies toggle button'
,
()
=>
{
const
findReplyButton
=
wrapper
=>
const
findReplyButton
=
wrapper
=>
wrapper
.
find
(
'
Button'
).
filter
(
'.AnnotationHeader__reply-toggle
'
);
wrapper
.
find
(
'
LinkButton[title="Expand replies"]
'
);
it
(
'should render if annotation is a collapsed reply and there are replies to show'
,
()
=>
{
it
(
'should render if annotation is a collapsed reply and there are replies to show'
,
()
=>
{
fakeIsReply
.
returns
(
true
);
fakeIsReply
.
returns
(
true
);
...
@@ -223,7 +223,7 @@ describe('AnnotationHeader', () => {
...
@@ -223,7 +223,7 @@ describe('AnnotationHeader', () => {
threadIsCollapsed
:
true
,
threadIsCollapsed
:
true
,
});
});
const
replyCollapseButton
=
findReplyButton
(
wrapper
);
const
replyCollapseButton
=
findReplyButton
(
wrapper
);
assert
.
equal
(
replyCollapseButton
.
props
().
buttonText
,
testCase
.
expected
);
assert
.
equal
(
replyCollapseButton
.
props
().
children
,
testCase
.
expected
);
});
});
});
});
});
});
...
...
src/sidebar/components/LoggedOutMessage.js
View file @
4c3b5e13
...
@@ -2,7 +2,7 @@ import { SvgIcon } from '@hypothesis/frontend-shared';
...
@@ -2,7 +2,7 @@ import { SvgIcon } from '@hypothesis/frontend-shared';
import
{
withServices
}
from
'../service-context'
;
import
{
withServices
}
from
'../service-context'
;
import
Button
from
'./Button
'
;
import
{
LinkButton
}
from
'../../shared/components/buttons
'
;
/** @typedef {import('../services/service-url').ServiceUrlGetter} ServiceUrlGetter */
/** @typedef {import('../services/service-url').ServiceUrlGetter} ServiceUrlGetter */
...
@@ -34,11 +34,13 @@ function LoggedOutMessage({ onLogin, serviceUrl }) {
...
@@ -34,11 +34,13 @@ function LoggedOutMessage({ onLogin, serviceUrl }) {
create
a
free
account
create
a
free
account
<
/a>{' '
}
<
/a>{' '
}
or
{
' '
}
or
{
' '
}
<
Button
<
Link
Button
className
=
"
LoggedOutMessage__link
"
className
=
"
InlineLinkButton
"
onClick
=
{
onLogin
}
onClick
=
{
onLogin
}
buttonText
=
"log in"
variant
=
"dark"
/>
>
log
in
<
/LinkButton
>
.
.
<
/span
>
<
/span
>
<
div
className
=
"LoggedOutMessage__logo"
>
<
div
className
=
"LoggedOutMessage__logo"
>
...
...
src/sidebar/components/test/LoggedOutMessage-test.js
View file @
4c3b5e13
...
@@ -39,7 +39,7 @@ describe('LoggedOutMessage', () => {
...
@@ -39,7 +39,7 @@ describe('LoggedOutMessage', () => {
const
fakeOnLogin
=
sinon
.
stub
();
const
fakeOnLogin
=
sinon
.
stub
();
const
wrapper
=
createLoggedOutMessage
({
onLogin
:
fakeOnLogin
});
const
wrapper
=
createLoggedOutMessage
({
onLogin
:
fakeOnLogin
});
const
loginLink
=
wrapper
.
find
(
'
.LoggedOutMessage__link'
).
at
(
1
);
const
loginLink
=
wrapper
.
find
(
'
LinkButton'
);
assert
.
equal
(
loginLink
.
prop
(
'onClick'
),
fakeOnLogin
);
assert
.
equal
(
loginLink
.
prop
(
'onClick'
),
fakeOnLogin
);
});
});
...
...
src/styles/sidebar/components/AnnotationHeader.scss
View file @
4c3b5e13
...
@@ -16,11 +16,6 @@
...
@@ -16,11 +16,6 @@
color
:
var
.
$color-text
;
color
:
var
.
$color-text
;
}
}
&
__reply-toggle
{
@include
buttons
.
button--link
;
padding
:
0
var
.
$layout-space--xsmall
;
}
// Timestamps are right aligned in a flex row
// Timestamps are right aligned in a flex row
&
__timestamps
{
&
__timestamps
{
flex-grow
:
1
;
flex-grow
:
1
;
...
...
src/styles/sidebar/components/LoggedOutMessage.scss
View file @
4c3b5e13
...
@@ -11,11 +11,13 @@
...
@@ -11,11 +11,13 @@
}
}
.LoggedOutMessage__link
{
.LoggedOutMessage__link
{
@include
buttons
.
button--link
;
padding
:
0
;
padding
:
0
;
display
:
inline
;
display
:
inline
;
color
:
var
.
$color-text
;
color
:
var
.
$color-text
;
text-decoration
:
underline
;
text-decoration
:
underline
;
&
:hover
{
text-decoration
:
underline
;
}
}
}
.LoggedOutMessage__logo
{
.LoggedOutMessage__logo
{
...
...
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