Skip to content

Commit 8411ed2

Browse files
committed
fix: Make scrolling, custom card templates and other styling work with fixed lane header
1 parent 2ef94b3 commit 8411ed2

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

src/components/Lane.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ class Lane extends Component {
145145
}
146146
}
147147

148-
renderDragContainer = () => {
148+
renderDragContainer = (isDraggingOver) => {
149149
const {laneSortFunction, editable, tagStyle, cardStyle, draggable} = this.props
150150
const {addCardMode} = this.state
151151

@@ -171,7 +171,7 @@ class Lane extends Component {
171171
))
172172

173173
return (
174-
<ScrollableLane innerRef={this.laneDidMount}>
174+
<ScrollableLane innerRef={this.laneDidMount} isDraggingOver={isDraggingOver}>
175175
<DraggableList>{cardList}</DraggableList>
176176
{editable && !addCardMode && this.renderAddCardLink()}
177177
{addCardMode && this.renderNewCard()}
@@ -215,7 +215,7 @@ class Lane extends Component {
215215
isDraggingOver={isDraggingOver}
216216
{...dropProvided.draggableProps}>
217217
{this.renderHeader()}
218-
{this.renderDragContainer()}
218+
{this.renderDragContainer(isDraggingOver)}
219219
{loading && <Loader />}
220220
</Section>
221221
)

src/styles/Base.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,26 @@ export const Section = styled.section`
3939
position: relative;
4040
padding: 10px;
4141
min-width: 250px;
42-
padding-bottom: ${props => (props.isDraggingOver ? '130px' : '30px')};
4342
display: flex;
4443
height: auto;
4544
max-height: 90%;
4645
flex-direction: column;
46+
display: flex;
4747
`
4848

4949
export const LaneHeader = styled(Header)`
50-
margin-bottom: 10px;
50+
z-index: 1000;
51+
padding: 0px 5px;
52+
margin-bottom: 0px;
5153
`
5254

5355
export const ScrollableLane = styled.div`
54-
flex: 1;
55-
overflow-y: auto;
56+
flex: 1;
57+
overflow-y: auto;
58+
overflow-x: hidden;
59+
height: 100%;
60+
padding-bottom: ${props => (props.isDraggingOver ? '130px' : '30px')};
61+
margin-top: 10px;
5662
`
5763

5864
export const Title = styled.span`
@@ -81,6 +87,7 @@ export const CardWrapper = styled.article`
8187
cursor: pointer;
8288
transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
8389
max-width: 250px;
90+
min-width: 230px;
8491
`
8592

8693
export const MovableCardWrapper = styled(CardWrapper)`

src/styles/Elements.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const DeleteWrapper = styled.div`
55
text-align: center;
66
position: absolute;
77
top: -8px;
8-
right: 0px;
8+
right: -1px;
99
`
1010

1111
export const DeleteIcon = styled.span`

stories/CustomLaneStyling.story.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,6 @@ storiesOf('Custom Templates', module).add(
7575
]
7676
}
7777

78-
return <Board data={data} customLancustomLaneHeadereHeader={<CustomLaneHeader />} />
78+
return <Board data={data} customLaneHeader={<CustomLaneHeader />} />
7979
})
8080
)

0 commit comments

Comments
 (0)