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
c97e8c8a
Commit
c97e8c8a
authored
Nov 16, 2023
by
Alejandro Celaya
Committed by
Alejandro Celaya
Nov 17, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove dependency on rounded_corners feature flag
parent
846a18ff
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
43 deletions
+7
-43
HypothesisApp.tsx
src/sidebar/components/HypothesisApp.tsx
+1
-15
HypothesisApp-test.js
src/sidebar/components/test/HypothesisApp-test.js
+0
-18
tailwind-annotator.config.mjs
tailwind-annotator.config.mjs
+0
-10
tailwind.config.mjs
tailwind.config.mjs
+6
-0
No files found.
src/sidebar/components/HypothesisApp.tsx
View file @
c97e8c8a
import
classnames
from
'classnames'
;
import
classnames
from
'classnames'
;
import
{
useEffect
,
use
LayoutEffect
,
use
Memo
}
from
'preact/hooks'
;
import
{
useEffect
,
useMemo
}
from
'preact/hooks'
;
import
{
confirm
}
from
'../../shared/prompts'
;
import
{
confirm
}
from
'../../shared/prompts'
;
import
type
{
SidebarSettings
}
from
'../../types/config'
;
import
type
{
SidebarSettings
}
from
'../../types/config'
;
...
@@ -49,20 +49,6 @@ function HypothesisApp({
...
@@ -49,20 +49,6 @@ function HypothesisApp({
const
route
=
store
.
route
();
const
route
=
store
.
route
();
const
isModalRoute
=
route
===
'notebook'
||
route
===
'profile'
;
const
isModalRoute
=
route
===
'notebook'
||
route
===
'profile'
;
const
roundedCornersEnabled
=
store
.
isFeatureEnabled
(
'rounded_corners'
);
useLayoutEffect
(()
=>
{
const
html
=
document
.
querySelector
(
'html'
);
html
?.
style
.
setProperty
(
'--h-border-radius'
,
roundedCornersEnabled
?
'0.25rem'
:
null
,
);
html
?.
style
.
setProperty
(
'--h-border-radius-lg'
,
roundedCornersEnabled
?
'0.5rem'
:
null
,
);
},
[
roundedCornersEnabled
]);
const
backgroundStyle
=
useMemo
(
const
backgroundStyle
=
useMemo
(
()
=>
applyTheme
([
'appBackgroundColor'
],
settings
),
()
=>
applyTheme
([
'appBackgroundColor'
],
settings
),
[
settings
],
[
settings
],
...
...
src/sidebar/components/test/HypothesisApp-test.js
View file @
c97e8c8a
...
@@ -142,24 +142,6 @@ describe('HypothesisApp', () => {
...
@@ -142,24 +142,6 @@ describe('HypothesisApp', () => {
});
});
});
});
[
true
,
false
].
forEach
(
roundedCornersEnabled
=>
{
it
(
'defines border-radius CSS vars when the feature flag is enabled'
,
()
=>
{
fakeStore
.
isFeatureEnabled
.
returns
(
roundedCornersEnabled
);
createComponent
();
const
styles
=
document
.
querySelector
(
'html'
)?.
style
;
assert
.
equal
(
styles
.
getPropertyValue
(
'--h-border-radius'
),
roundedCornersEnabled
?
'0.25rem'
:
''
,
);
assert
.
equal
(
styles
.
getPropertyValue
(
'--h-border-radius-lg'
),
roundedCornersEnabled
?
'0.5rem'
:
''
,
);
});
});
describe
(
'auto-opening tutorial'
,
()
=>
{
describe
(
'auto-opening tutorial'
,
()
=>
{
it
(
'should open tutorial on profile load when criteria are met'
,
()
=>
{
it
(
'should open tutorial on profile load when criteria are met'
,
()
=>
{
fakeShouldAutoDisplayTutorial
.
returns
(
true
);
fakeShouldAutoDisplayTutorial
.
returns
(
true
);
...
...
tailwind-annotator.config.mjs
View file @
c97e8c8a
...
@@ -9,14 +9,4 @@ export default {
...
@@ -9,14 +9,4 @@ export default {
// This module references `sidebar-frame` and related classes
// This module references `sidebar-frame` and related classes
'./src/annotator/sidebar.{js,ts,tsx}'
,
'./src/annotator/sidebar.{js,ts,tsx}'
,
],
],
theme
:
{
extend
:
{
borderRadius
:
{
// Equivalent to tailwind defaults, but overriding values from frontend-shared preset
// Once the preset stops defining borderRadius, we can remove this
DEFAULT
:
'0.25rem'
,
lg
:
'0.5rem'
,
},
}
}
};
};
tailwind.config.mjs
View file @
c97e8c8a
...
@@ -24,6 +24,12 @@ export default {
...
@@ -24,6 +24,12 @@ export default {
'pulse-fade-out'
:
'pulse-fade-out 5s ease-in-out forwards'
,
'pulse-fade-out'
:
'pulse-fade-out 5s ease-in-out forwards'
,
'slide-in-from-right'
:
'slide-in-from-right 0.3s forwards ease-in-out'
,
'slide-in-from-right'
:
'slide-in-from-right 0.3s forwards ease-in-out'
,
},
},
borderRadius
:
{
// Equivalent to tailwind defaults, but overriding values from frontend-shared preset
// Once the preset stops defining borderRadius, we can remove this
DEFAULT
:
'0.25rem'
,
lg
:
'0.5rem'
,
},
boxShadow
:
{
boxShadow
:
{
// A more prominent shadow than the one used by tailwind, intended for
// A more prominent shadow than the one used by tailwind, intended for
// popovers and menus
// popovers and menus
...
...
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