Skip to content
Snippets Groups Projects
Unverified Commit 0a93e82c authored by Kyle Doherty's avatar Kyle Doherty Committed by GitHub
Browse files

hide filters if no unpinned items (#8057)

* hide filters if no unpinned items

* pad new collection link properly when only collections exist
parent ca3c9b15
No related branches found
No related tags found
No related merge requests found
......@@ -282,68 +282,70 @@ class DefaultLanding extends React.Component {
/>
</Box>
</GridItem>
<GridItem w={itemWidth}>
<Box>
<ItemTypeFilterBar />
<Card mt={1} className="relative">
{unpinnedItems.length > 0 ? (
<PinDropTarget pinIndex={null} margin={8}>
<Box
style={{
position: "relative",
height: ROW_HEIGHT * unpinnedItems.length,
}}
>
<VirtualizedList
items={unpinnedItems}
rowHeight={ROW_HEIGHT}
renderItem={({ item, index }) => (
<Box className="relative">
<ItemDragSource
item={item}
selection={selection}
>
<NormalItem
key={`${item.type}:${item.id}`}
{unpinned.length > 0 && (
<GridItem w={itemWidth}>
<Box>
<ItemTypeFilterBar />
<Card mt={1} className="relative">
{unpinnedItems.length > 0 ? (
<PinDropTarget pinIndex={null} margin={8}>
<Box
style={{
position: "relative",
height: ROW_HEIGHT * unpinnedItems.length,
}}
>
<VirtualizedList
items={unpinnedItems}
rowHeight={ROW_HEIGHT}
renderItem={({ item, index }) => (
<Box className="relative">
<ItemDragSource
item={item}
collection={collection}
selection={selection}
onToggleSelected={onToggleSelected}
onMove={moveItems =>
this.setState({ moveItems })
}
/>
</ItemDragSource>
</Box>
)}
/>
</Box>
</PinDropTarget>
) : (
<Box>
{location.query.type &&
EMPTY_STATES[location.query.type]}
<PinDropTarget
pinIndex={null}
hideUntilDrag
margin={10}
>
{({ hovered }) => (
<div
className={cx(
"m2 flex layout-centered",
hovered ? "text-brand" : "text-grey-2",
>
<NormalItem
key={`${item.type}:${item.id}`}
item={item}
collection={collection}
selection={selection}
onToggleSelected={onToggleSelected}
onMove={moveItems =>
this.setState({ moveItems })
}
/>
</ItemDragSource>
</Box>
)}
>
{t`Drag here to un-pin`}
</div>
)}
/>
</Box>
</PinDropTarget>
</Box>
)}
</Card>
</Box>
</GridItem>
) : (
<Box>
{location.query.type &&
EMPTY_STATES[location.query.type]}
<PinDropTarget
pinIndex={null}
hideUntilDrag
margin={10}
>
{({ hovered }) => (
<div
className={cx(
"m2 flex layout-centered",
hovered ? "text-brand" : "text-grey-2",
)}
>
{t`Drag here to un-pin`}
</div>
)}
</PinDropTarget>
</Box>
)}
</Card>
</Box>
</GridItem>
)}
</Grid>
</Box>
</Box>
......
......@@ -75,6 +75,7 @@ class CollectionList extends React.Component {
to={Urls.newCollection(currentCollection.id)}
color={normal.grey2}
hover={{ color: normal.blue }}
p={w === 1 ? [1, 2] : 0}
>
<Flex align="center" py={1}>
<Icon name="add" mr={1} bordered />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment