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
594a1130
Commit
594a1130
authored
Mar 03, 2023
by
Robert Knight
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert remaining annotator components to TypeScript
parent
83e5973d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
7 deletions
+14
-7
Banners.tsx
src/annotator/components/Banners.tsx
+10
-0
ContentInfoBanner.tsx
src/annotator/components/ContentInfoBanner.tsx
+4
-7
No files found.
src/annotator/components/Banners.
js
→
src/annotator/components/Banners.
tsx
View file @
594a1130
import
type
{
ComponentChildren
}
from
'preact'
;
export
type
BannersProps
=
{
children
:
ComponentChildren
};
/**
* Render banners at the top of a document in a stacked column.
*
* @param {object} props
* @param {import("preact").ComponentChildren} props.children
*/
export
default
function
Banners
({
children
})
{
export
default
function
Banners
({
children
}
:
BannersProps
)
{
return
<
div
className=
"flex flex-col"
>
{
children
}
</
div
>;
}
src/annotator/components/ContentInfoBanner.
js
→
src/annotator/components/ContentInfoBanner.
tsx
View file @
594a1130
...
...
@@ -6,9 +6,9 @@ import {
}
from
'@hypothesis/frontend-shared/lib/next'
;
import
classnames
from
'classnames'
;
/**
* @typedef {import('../../types/annotator').ContentInfoConfig} ContentInfoConfig
*/
import
type
{
ContentInfoConfig
}
from
'../../types/annotator'
;
export
type
ContentInfoBannerProps
=
{
info
:
ContentInfoConfig
};
/**
* A banner that displays information about the current document and the entity
...
...
@@ -18,11 +18,8 @@ import classnames from 'classnames';
* - Logo
* - Container title (only shown on screens at `2xl` breakpoint and wider)
* - Item title with previous and next links
*
* @param {object} props
* @param {ContentInfoConfig} props.info
*/
export
default
function
ContentInfoBanner
({
info
})
{
export
default
function
ContentInfoBanner
({
info
}
:
ContentInfoBannerProps
)
{
// Format item title to show subtitle
let
itemTitle
=
info
.
item
.
title
;
if
(
info
.
item
.
subtitle
)
{
...
...
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