Skip to content

Commit d833b0f

Browse files
committed
fix: Allowing lane width to expand based on card's width
#53
1 parent 73a2ba4 commit d833b0f

14 files changed

+204
-34
lines changed

src/components/Lane.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class Lane extends Component {
172172

173173
return (
174174
<ScrollableLane innerRef={this.laneDidMount} isDraggingOver={isDraggingOver}>
175-
<DraggableList>{cardList}</DraggableList>
175+
<span>{cardList}</span>
176176
{editable && !addCardMode && this.renderAddCardLink()}
177177
{addCardMode && this.renderNewCard()}
178178
</ScrollableLane>

src/styles/Base.js

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,10 @@ export const Section = styled.section`
3838
margin: 5px 5px;
3939
position: relative;
4040
padding: 10px;
41-
min-width: 250px;
42-
display: flex;
41+
display: inline-flex;
4342
height: auto;
4443
max-height: 90%;
4544
flex-direction: column;
46-
display: flex;
4745
`
4846

4947
export const LaneHeader = styled(Header)`
@@ -55,7 +53,9 @@ export const LaneHeader = styled(Header)`
5553
export const ScrollableLane = styled.div`
5654
flex: 1;
5755
overflow-y: auto;
56+
min-width: 250px;
5857
overflow-x: hidden;
58+
display: inline-flex;
5959
height: 100%;
6060
padding-bottom: ${props => (props.isDraggingOver ? '130px' : '30px')};
6161
margin-top: 10px;
@@ -66,16 +66,16 @@ export const Title = styled.span`
6666
font-size: 15px;
6767
line-height: 18px;
6868
cursor: grab;
69-
width: 100%;
69+
width: 70%;
7070
`
7171

7272
export const RightContent = styled.span`
7373
width: 30%;
7474
text-align: right;
75+
padding-right: 5px;
7576
font-size: 13px;
7677
`
7778

78-
export const DraggableList = styled.div``
7979

8080
export const CardWrapper = styled.article`
8181
border-radius: 3px;
@@ -96,16 +96,6 @@ export const MovableCardWrapper = styled(CardWrapper)`
9696
}
9797
`
9898

99-
export const Placeholder = styled.section`
100-
background-color: #ccc;
101-
margin: 5px 0;
102-
padding: 10px;
103-
min-width: 226px;
104-
height: 45px;
105-
max-height: 95%;
106-
overflow-y: auto;
107-
`
108-
10999
export const CardHeader = styled(Header)`
110100
border-bottom: 1px solid #eee;
111101
padding-bottom: 6px;
@@ -157,12 +147,3 @@ export const AddCardLink = styled.a`
157147
text-decoration: underline;
158148
}
159149
`
160-
161-
export const LaneWrapper = styled.div`
162-
background-color: ${({isDraggingOver}) => (isDraggingOver ? 'cyan' : 'white')};
163-
display: flex;
164-
flex-direction: column;
165-
opacity: ${({isDropDisabled}) => (isDropDisabled ? 0.5 : 'inherit')};
166-
transition: background-color 0.1s ease, opacity 0.1s ease;
167-
user-select: none;
168-
`

stories/AsyncLoad.story.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {storiesOf} from '@storybook/react'
44

55
import Board from '../src'
66

7-
const data = require('./data.json')
7+
const data = require('./data/base.json')
88

99
class AsyncBoard extends Component {
1010
state = {boardData: {lanes: []}}

stories/Base.story.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {storiesOf} from '@storybook/react'
44

55
import Board from '../src'
66

7-
const data = require('./data.json')
7+
const data = require('./data/base.json')
88

99
storiesOf('Basic Functions', module).add(
1010
'Full Board example',

stories/BoardStyling.story.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Board from '../src'
66

77
import './board.css'
88

9-
const data = require('./data.json')
9+
const data = require('./data/base.json')
1010

1111
storiesOf('Advanced Features', module).add(
1212
'Board Styling',

stories/DragDrop.story.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {storiesOf} from '@storybook/react'
44

55
import Board from '../src'
66

7-
const data = require('./data.json')
7+
const data = require('./data/base.json')
88

99
storiesOf('Drag-n-Drop', module).add(
1010
'Basic',

stories/EditableBoard.story.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {storiesOf} from '@storybook/react'
44

55
import Board from '../src'
66

7-
const data = require('./data.json')
7+
const data = require('./data/base.json')
88

99
class NewCard extends Component {
1010
updateField = (field, evt) => {

stories/Realtime.story.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import update from 'immutability-helper'
55

66
import Board from '../src'
77

8-
const data = require('./data.json')
8+
const data = require('./data/base.json')
99

1010
class RealtimeBoard extends Component {
1111
state = {boardData: data, eventBus: undefined}

stories/RestrictedLanes.story.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {storiesOf} from '@storybook/react'
44

55
import Board from '../src'
66

7-
const data = require('./drag-drop.json')
7+
const data = require('./data/drag-drop.json')
88

99
storiesOf('Drag-n-Drop', module).add(
1010
'Restrict lanes',

stories/Sort.story.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {storiesOf} from '@storybook/react'
44

55
import Board from '../src'
66

7-
const data = require('./data-sort.json')
7+
const data = require('./data/data-sort.json')
88

99
storiesOf('Basic Functions', module)
1010
.add(

0 commit comments

Comments
 (0)