Skip to content

Commit e1b44fe

Browse files
author
Clauderic Demers
committed
Prettified demo page when you use npm start locally
1 parent cced5f5 commit e1b44fe

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

index.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,24 @@
33
<head>
44
<title>React Sortable</title>
55
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi" />
6+
<style>
7+
@import url(https://fonts.googleapis.com/css?family=Montserrat:400);
8+
9+
html, body, #root {
10+
width: 100%;
11+
height: 100%;
12+
}
13+
body {
14+
background-color: #f9f9f9;
15+
display: table;
16+
color: #333;
17+
font-family: 'Montserrat', 'Helvetica Neue', Helvetica, arial, sans-serif;
18+
}
19+
#root {
20+
display: table-cell;
21+
vertical-align: middle;
22+
}
23+
</style>
624
</head>
725
<body>
826
<div id="root"></div>

index.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ const SortableItem = SortableElement(({height, value}) => (
1111
width: '100%',
1212
display: 'block',
1313
padding: 20,
14-
borderBottom: '1px solid #DEDEDE',
14+
backgroundColor: '#FFF',
15+
borderBottom: '1px solid #EFEFEF',
1516
boxSizing: 'border-box',
1617
WebkitUserSelect: 'none',
1718
height: height
@@ -21,7 +22,16 @@ const SortableItem = SortableElement(({height, value}) => (
2122
));
2223

2324
const SortableList = SortableContainer(({items}) => (
24-
<div>
25+
<div style={{
26+
width: '80%',
27+
height: '80vh',
28+
maxWidth: '500px',
29+
margin: '0 auto',
30+
overflow: 'auto',
31+
backgroundColor: '#f3f3f3',
32+
border: '1px solid #EFEFEF',
33+
borderRadius: 3
34+
}}>
2535
{items.map(({height, value}, index) => <SortableItem key={`item-${index}`} index={index} value={value} height={height}/>)}
2636
</div>
2737
));

0 commit comments

Comments
 (0)