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
1adb25a4
Commit
1adb25a4
authored
May 09, 2022
by
Lyza Danger Gardner
Committed by
Lyza Gardner
May 11, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate `GroupList` to tailwind
parent
6757da21
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
32 deletions
+16
-32
GroupList.js
src/sidebar/components/GroupList/GroupList.js
+16
-3
GroupList.scss
src/styles/sidebar/components/GroupList.scss
+0
-28
_index.scss
src/styles/sidebar/components/_index.scss
+0
-1
No files found.
src/sidebar/components/GroupList/GroupList.js
View file @
1adb25a4
import
classnames
from
'classnames'
;
import
{
useMemo
,
useState
}
from
'preact/hooks'
;
import
{
serviceConfig
}
from
'../../config/service-config'
;
...
...
@@ -86,9 +87,21 @@ function GroupList({ settings }) {
// and pass an empty string.
const
altName
=
orgName
(
focusedGroup
)
?
orgName
(
focusedGroup
)
:
''
;
label
=
(
<
span
className
=
"GroupList__menu-label"
>
<
span
className
=
{
classnames
(
// Don't allow this label to shrink (wrap to next line)
'shrink-0 flex items-center gap-x-1 text-lg text-color-text font-bold'
)}
>
{
icon
&&
(
<
img
className
=
"GroupList__menu-icon"
src
=
{
icon
}
alt
=
{
altName
}
/
>
<
img
className
=
{
classnames
(
// Tiny adjustment to make H logo align better with group name
'relative top-[1px] w-4 h-4'
)}
src
=
{
icon
}
alt
=
{
altName
}
/
>
)}
{
focusedGroup
.
name
}
<
/span
>
...
...
@@ -114,7 +127,7 @@ function GroupList({ settings }) {
return
(
<
Menu
align
=
"left"
contentClass
=
"
GroupList__content
"
contentClass
=
"
min-w-[250px]
"
label
=
{
label
}
onOpenChanged
=
{()
=>
setExpandedGroup
(
null
)}
title
=
{
menuTitle
}
...
...
src/styles/sidebar/components/GroupList.scss
deleted
100644 → 0
View file @
6757da21
@use
'../../variables'
as
var
;
@use
'../../mixins/utils'
;
.GroupList__content
{
min-width
:
250px
;
}
.GroupList__menu-label
{
@include
utils
.
font--large
;
align-items
:
center
;
color
:
var
.
$color-text
;
display
:
flex
;
// Prevent label from wrapping if top bar is too narrow to fit all of its
// items.
flex-shrink
:
0
;
font-weight
:
bold
;
}
.GroupList__menu-icon
{
@include
utils
.
icon--medium
;
margin-right
:
4px
;
// A minor adjustment to make the default icon (the Hypothesis logo) align
// better with the text.
position
:
relative
;
top
:
1px
;
}
src/styles/sidebar/components/_index.scss
View file @
1adb25a4
...
...
@@ -10,7 +10,6 @@
// UI (Preact) Components
// ----------
@use
'./FilterSelect'
;
@use
'./GroupList'
;
@use
'./StyledText'
;
// TODO: Evaluate all classes below after components have been converted to
...
...
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