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
4e42c0d9
Commit
4e42c0d9
authored
Nov 07, 2022
by
Lyza Danger Gardner
Committed by
Lyza Gardner
Nov 08, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert FilterStatus to TypeScript
parent
3cf30772
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
20 deletions
+28
-20
FilterStatus.tsx
src/sidebar/components/FilterStatus.tsx
+28
-20
No files found.
src/sidebar/components/FilterStatus.
js
→
src/sidebar/components/FilterStatus.
tsx
View file @
4e42c0d9
...
@@ -13,28 +13,36 @@ import { useSidebarStore } from '../store';
...
@@ -13,28 +13,36 @@ import { useSidebarStore } from '../store';
import
{
useRootThread
}
from
'./hooks/use-root-thread'
;
import
{
useRootThread
}
from
'./hooks/use-root-thread'
;
/**
type
FilterStatusMessageProps
=
{
* @typedef FilterStatusMessageProps
/**
* @prop {number} [additionalCount=0] -
* A count of items that are visible but do not match the filters (i.e. items
* A count of items that are visible but do not match the filters
* that have been "forced visible" by the user)
* @prop {string} [entitySingular="annotation"] -
*/
* singular variant of the "thing" being shown (e.g. "result" when there is
additionalCount
?:
number
;
* a query string)
* @prop {string} [entityPlural="annotations"]
/** Singular unit of the items being shown, e.g. "result" or "annotation" */
* @prop {string|null} [filterQuery] - Currently-applied filter query string, if any
entitySingular
?:
string
;
* @prop {string|null} [focusDisplayName] -
* Display name for the user currently being focused
/** Plural unit of the items being shown */
* @prop {number} resultCount -
entityPlural
?:
string
;
* The number of "things" that match the current filter(s). When searching by
* query or focusing on a user, this value includes annotations and replies.
/** Currently-applied filter query string, if any */
* When there are selected annotations, this number includes only top-level
filterQuery
?:
string
|
null
;
* annotations.
*/
/** Display name for the user currently focused, if any */
focusDisplayName
?:
string
|
null
;
/**
* The number of items that match the current filter(s). When searching by
* query or focusing on a user, this value includes annotations and replies.
* When there are selected annotations, this number includes only top-level
* annotations.
*/
resultCount
:
number
;
};
/**
/**
* Render status text describing the currently-applied filters.
* Render status text describing the currently-applied filters.
*
* @param {FilterStatusMessageProps} props
*/
*/
function
FilterStatusMessage
({
function
FilterStatusMessage
({
additionalCount
=
0
,
additionalCount
=
0
,
...
@@ -43,7 +51,7 @@ function FilterStatusMessage({
...
@@ -43,7 +51,7 @@ function FilterStatusMessage({
filterQuery
,
filterQuery
,
focusDisplayName
,
focusDisplayName
,
resultCount
,
resultCount
,
})
{
}
:
FilterStatusMessageProps
)
{
return
(
return
(
<>
<>
{
resultCount
>
0
&&
<
span
>
Showing
</
span
>
}
{
resultCount
>
0
&&
<
span
>
Showing
</
span
>
}
...
...
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