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
d4096622
Commit
d4096622
authored
Feb 10, 2021
by
Kyle Keating
Committed by
Kyle Keating
Feb 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename svg-icon.scss to SvgIcon.scss
Rename "svg-icon" class to "SvgIcon"
parent
de48c42f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
8 deletions
+8
-8
SvgIcon.js
frontend-shared/src/components/SvgIcon.js
+1
-1
SvgIcon-test.js
frontend-shared/src/components/test/SvgIcon-test.js
+4
-4
_index.scss
frontend-shared/styles/_index.scss
+1
-1
SvgIcon.scss
frontend-shared/styles/components/SvgIcon.scss
+1
-1
layout.scss
src/styles/mixins/layout.scss
+1
-1
No files found.
frontend-shared/src/components/SvgIcon.js
View file @
d4096622
...
@@ -68,7 +68,7 @@ export function SvgIcon({ name, className = '', inline = false, title = '' }) {
...
@@ -68,7 +68,7 @@ export function SvgIcon({ name, className = '', inline = false, title = '' }) {
return
(
return
(
<
span
<
span
className
=
{
classnames
(
'
svg-icon'
,
{
'svg-i
con--inline'
:
inline
})}
className
=
{
classnames
(
'
SvgIcon'
,
{
'SvgI
con--inline'
:
inline
})}
dangerouslySetInnerHTML
=
{{
__html
:
markup
}}
dangerouslySetInnerHTML
=
{{
__html
:
markup
}}
ref
=
{
element
}
ref
=
{
element
}
{...
spanProps
}
{...
spanProps
}
...
...
frontend-shared/src/components/test/SvgIcon-test.js
View file @
d4096622
...
@@ -65,16 +65,16 @@ describe('SvgIcon', () => {
...
@@ -65,16 +65,16 @@ describe('SvgIcon', () => {
const
container
=
document
.
createElement
(
'div'
);
const
container
=
document
.
createElement
(
'div'
);
render
(
<
SvgIcon
name
=
"arrow-left"
/>
,
container
);
render
(
<
SvgIcon
name
=
"arrow-left"
/>
,
container
);
const
wrapper
=
container
.
querySelector
(
'span'
);
const
wrapper
=
container
.
querySelector
(
'span'
);
assert
.
isTrue
(
wrapper
.
classList
.
contains
(
'
svg-i
con'
));
assert
.
isTrue
(
wrapper
.
classList
.
contains
(
'
SvgI
con'
));
assert
.
isFalse
(
wrapper
.
classList
.
contains
(
'
svg-i
con--inline'
));
assert
.
isFalse
(
wrapper
.
classList
.
contains
(
'
SvgI
con--inline'
));
});
});
it
(
'appends an inline class to wrapper if `inline` prop is `true`'
,
()
=>
{
it
(
'appends an inline class to wrapper if `inline` prop is `true`'
,
()
=>
{
const
container
=
document
.
createElement
(
'div'
);
const
container
=
document
.
createElement
(
'div'
);
render
(
<
SvgIcon
name
=
"arrow-left"
inline
=
{
true
}
/>, container
)
;
render
(
<
SvgIcon
name
=
"arrow-left"
inline
=
{
true
}
/>, container
)
;
const
wrapper
=
container
.
querySelector
(
'span'
);
const
wrapper
=
container
.
querySelector
(
'span'
);
assert
.
isTrue
(
wrapper
.
classList
.
contains
(
'
svg-i
con'
));
assert
.
isTrue
(
wrapper
.
classList
.
contains
(
'
SvgI
con'
));
assert
.
isTrue
(
wrapper
.
classList
.
contains
(
'
svg-i
con--inline'
));
assert
.
isTrue
(
wrapper
.
classList
.
contains
(
'
SvgI
con--inline'
));
});
});
it
(
'sets a title to the containing `span` element if `title` is present'
,
()
=>
{
it
(
'sets a title to the containing `span` element if `title` is present'
,
()
=>
{
...
...
frontend-shared/styles/_index.scss
View file @
d4096622
...
@@ -3,4 +3,4 @@
...
@@ -3,4 +3,4 @@
// e.g.
// e.g.
// @use '@hypothesis/frontend-shared/styles'
// @use '@hypothesis/frontend-shared/styles'
@use
'./components/
svg-i
con'
;
@use
'./components/
SvgI
con'
;
frontend-shared/styles/components/
svg-i
con.scss
→
frontend-shared/styles/components/
SvgI
con.scss
View file @
d4096622
/* Make the wrapper element's size match the contained `svg` element */
/* Make the wrapper element's size match the contained `svg` element */
.
svg-i
con
{
.
SvgI
con
{
display
:
flex
;
display
:
flex
;
&
--inline
{
&
--inline
{
...
...
src/styles/mixins/layout.scss
View file @
d4096622
...
@@ -76,7 +76,7 @@
...
@@ -76,7 +76,7 @@
* @FIXME Find workaround for SvgIcon exception
* @FIXME Find workaround for SvgIcon exception
*/
*/
@mixin
vertical-rhythm
(
$size
:
var
.
$layout-space
)
{
@mixin
vertical-rhythm
(
$size
:
var
.
$layout-space
)
{
&
>
*
+
*
:not
([
class
*=
'
svg-i
con--inline'
])
{
&
>
*
+
*
:not
([
class
*=
'
SvgI
con--inline'
])
{
margin-top
:
$size
;
margin-top
:
$size
;
}
}
}
}
...
...
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