Skip to content

Commit

Permalink
fix(hitl2): scrollable HandoffList (#4624)
Browse files Browse the repository at this point in the history
* fix(hitl2): scrollable HandoffList

* removed unused import

* removed white space
  • Loading branch information
sebburon committed Mar 11, 2021
1 parent 1ddbae0 commit 31f4bc7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion modules/hitlnext/src/views/full/app/components/HandoffList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Context } from '../Store'
import HandoffItem from './HandoffItem'
import HandoffListHeader, { FilterType, SortType } from './HandoffListHeader'

import style from '../../style.scss'
interface Props {
handoffs: object
loading: boolean
Expand Down Expand Up @@ -63,6 +64,16 @@ const HandoffList: FC<Props> = ({ handoffs, loading }) => {
setItems(filtered)
}, [filterOptions, sortOption, handoffs, loading])

const displayHandoffList = () => {
return (
<div className={style.handoffList}>
{items.map(handoff => (
<HandoffItem key={handoff.id} {...handoff}></HandoffItem>
))}
</div>
)
}

return (
<Fragment>
<HandoffListHeader
Expand All @@ -79,7 +90,7 @@ const HandoffList: FC<Props> = ({ handoffs, loading }) => {
<EmptyState icon={<CasesIcon />} text={lang.tr('module.hitlnext.handoffs.empty')}></EmptyState>
)}

{!loading && !_.isEmpty(items) && items.map(handoff => <HandoffItem key={handoff.id} {...handoff}></HandoffItem>)}
{!loading && !_.isEmpty(items) && displayHandoffList()}
</Fragment>
)
}
Expand Down
2 changes: 1 addition & 1 deletion modules/hitlnext/src/views/full/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@

.handoffList {
background-color: var(--bg);
display: flex;
overflow-y: scroll;
flex-direction: column;
flex-grow: 1;
height: 100%;
Expand Down

0 comments on commit 31f4bc7

Please sign in to comment.