Skip to content

Commit

Permalink
fix: Make scrolling, custom card templates and other styling work wit…
Browse files Browse the repository at this point in the history
…h fixed lane header
  • Loading branch information
rcdexta committed Jan 21, 2018
1 parent 2ef94b3 commit 8411ed2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/components/Lane.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class Lane extends Component {
}
}

renderDragContainer = () => {
renderDragContainer = (isDraggingOver) => {
const {laneSortFunction, editable, tagStyle, cardStyle, draggable} = this.props
const {addCardMode} = this.state

Expand All @@ -171,7 +171,7 @@ class Lane extends Component {
))

return (
<ScrollableLane innerRef={this.laneDidMount}>
<ScrollableLane innerRef={this.laneDidMount} isDraggingOver={isDraggingOver}>
<DraggableList>{cardList}</DraggableList>
{editable && !addCardMode && this.renderAddCardLink()}
{addCardMode && this.renderNewCard()}
Expand Down Expand Up @@ -215,7 +215,7 @@ class Lane extends Component {
isDraggingOver={isDraggingOver}
{...dropProvided.draggableProps}>
{this.renderHeader()}
{this.renderDragContainer()}
{this.renderDragContainer(isDraggingOver)}
{loading && <Loader />}
</Section>
)
Expand Down
15 changes: 11 additions & 4 deletions src/styles/Base.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,26 @@ export const Section = styled.section`
position: relative;
padding: 10px;
min-width: 250px;
padding-bottom: ${props => (props.isDraggingOver ? '130px' : '30px')};
display: flex;
height: auto;
max-height: 90%;
flex-direction: column;
display: flex;
`

export const LaneHeader = styled(Header)`
margin-bottom: 10px;
z-index: 1000;
padding: 0px 5px;
margin-bottom: 0px;
`

export const ScrollableLane = styled.div`
flex: 1;
overflow-y: auto;
flex: 1;
overflow-y: auto;
overflow-x: hidden;
height: 100%;
padding-bottom: ${props => (props.isDraggingOver ? '130px' : '30px')};
margin-top: 10px;
`

export const Title = styled.span`
Expand Down Expand Up @@ -81,6 +87,7 @@ export const CardWrapper = styled.article`
cursor: pointer;
transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
max-width: 250px;
min-width: 230px;
`

export const MovableCardWrapper = styled(CardWrapper)`
Expand Down
2 changes: 1 addition & 1 deletion src/styles/Elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const DeleteWrapper = styled.div`
text-align: center;
position: absolute;
top: -8px;
right: 0px;
right: -1px;
`

export const DeleteIcon = styled.span`
Expand Down
2 changes: 1 addition & 1 deletion stories/CustomLaneStyling.story.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ storiesOf('Custom Templates', module).add(
]
}

return <Board data={data} customLancustomLaneHeadereHeader={<CustomLaneHeader />} />
return <Board data={data} customLaneHeader={<CustomLaneHeader />} />
})
)

0 comments on commit 8411ed2

Please sign in to comment.