Skip to content

Commit c2b6a41

Browse files
author
Marek Rozmus
committed
Merge branch 'fix_for_issue_159'
2 parents 27445bf + d63cb60 commit c2b6a41

36 files changed

+445
-404
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
[![Actions Status](https://github.com/sandstreamdev/react-swipeable-list/workflows/Node%20CI/badge.svg)](https://github.com/sandstreamdev/react-swipeable-list/actions)
1717
[![codecov](https://codecov.io/gh/sandstreamdev/react-swipeable-list/branch/master/graph/badge.svg)](https://codecov.io/gh/sandstreamdev/react-swipeable-list)
1818
![GitHub Release Date](https://img.shields.io/github/release-date/sandstreamdev/react-swipeable-list)
19-
[![All Contributors](https://img.shields.io/badge/all_contributors-13-orange.svg?style=flat-square)](#contributors-)
19+
[![All Contributors](https://img.shields.io/badge/all_contributors-14-orange.svg?style=flat-square)](#contributors-)
2020

2121
## React Swipeable List component
2222

examples/src/app.module.css renamed to examples/src/App.css

Lines changed: 24 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,24 @@
1-
body,
2-
h3,
3-
h5 {
4-
margin: 0;
5-
}
6-
71
body {
82
/* prettier-ignore */
93
font-family: system, -apple-system, '.SFNSText-Regular', 'San Francisco', 'Roboto', 'Segoe UI', 'Helvetica Neue', 'Lucida Grande', sans-serif;
104
line-height: 1.7;
5+
margin: 0;
116
}
127

13-
h1,
14-
h2,
15-
h3,
16-
h4,
17-
h5 {
18-
margin-left: 16px;
19-
margin-right: 16px;
8+
.page-content__title {
9+
font-size: 20px;
10+
font-weight: bold;
11+
margin-top: 16px;
12+
margin-bottom: 0;
2013
}
2114

22-
h1 {
23-
display: block;
24-
font-size: 1.17em;
25-
margin-block-start: 1em;
26-
margin-block-end: 1em;
27-
margin-inline-start: 0;
28-
margin-inline-end: 0;
15+
.page-content__subtitle {
16+
font-size: 14px;
2917
font-weight: bold;
30-
margin-bottom: 0;
31-
text-align: center;
18+
margin: 0;
3219
}
3320

34-
footer {
21+
.footer {
3522
display: flex;
3623
flex-direction: column;
3724
align-items: center;
@@ -40,27 +27,24 @@ footer {
4027
margin-top: auto;
4128
}
4229

43-
a {
44-
text-decoration: none;
45-
}
46-
47-
footer a,
48-
footer a:visited {
30+
.footer__link,
31+
.footer__link:visited {
4932
color: #0275d8;
33+
text-decoration: none;
5034
}
5135

52-
footer a:hover {
36+
.footer__link:hover {
5337
color: #0275d8;
5438
text-decoration: underline;
5539
}
5640

57-
.testApp {
41+
.application {
5842
display: flex;
5943
flex-direction: column;
6044
height: 100vh;
6145
}
6246

63-
.example {
47+
.page-content {
6448
display: flex;
6549
flex-direction: column;
6650
align-items: center;
@@ -70,88 +54,37 @@ footer a:hover {
7054
-webkit-overflow-scrolling: touch;
7155
}
7256

73-
.listContainer {
74-
width: 100%;
75-
margin: 24px 0;
76-
border-top: 1px solid gray;
77-
border-bottom: 1px solid gray;
78-
}
79-
80-
.listItem {
81-
border-bottom: 1px solid #c4c4c4;
82-
height: 32px;
83-
width: 100%;
84-
display: flex;
85-
align-items: center;
86-
padding: 4px 8px;
87-
user-select: none;
88-
cursor: pointer;
89-
}
90-
91-
.contentLeft {
92-
background-color: red;
93-
color: white;
94-
height: 100%;
95-
width: 100%;
96-
display: flex;
97-
align-items: center;
98-
padding: 4px;
99-
}
100-
101-
.contentRight {
102-
composes: contentLeft; /* stylelint-disable-line value-keyword-case */
103-
background-color: green;
104-
justify-content: flex-end;
105-
}
106-
107-
.actionInfo {
57+
.page__action--title {
10858
padding: 0 8px;
10959
font-weight: 600;
11060
font-size: 14px;
11161
}
11262

113-
.actionInfoValue {
63+
.page__action--value {
11464
font-size: 12px;
11565
padding-bottom: 4px;
11666
}
11767

118-
.complexListContainer {
119-
width: 100%;
120-
height: 180px;
121-
min-height: 180px;
122-
border-top: 1px solid gray;
123-
border-bottom: 1px solid gray;
124-
margin: 24px 0;
125-
}
126-
127-
select {
68+
.page__select {
12869
height: 32px;
12970
padding: 4px;
13071
margin: 8px 16px;
13172
font-size: 16px;
13273
align-self: stretch;
13374
}
13475

135-
select:focus {
76+
.page__select:focus {
13677
outline: none;
13778
}
13879

139-
button {
80+
.page__button {
14081
height: 32px;
14182
padding: 4px 8px;
14283
margin: 8px 16px;
14384
font-size: 16px;
14485
}
14586

146-
.switcher {
147-
align-self: auto;
148-
}
149-
150-
.switcherRow {
151-
padding-top: 8px;
152-
}
153-
154-
.summary {
87+
.page__summary {
15588
padding: 16px 0;
15689
display: flex;
15790
flex-direction: column;
@@ -200,13 +133,13 @@ button {
200133
}
201134

202135
/* The screen (or content) of the device */
203-
.smartphone .content {
136+
.smartphone__content {
204137
width: 360px;
205138
height: 640px;
206139
background: white;
207140
}
208141

209-
footer {
142+
.smartphone__footer {
210143
padding: 56px 0;
211144
margin-top: unset;
212145
}

examples/src/App.js

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import React, { PureComponent } from 'react';
22
import { enumerable } from '@sandstreamdev/std/object';
33

4-
import BasicList from './basic/List';
5-
import ComplexList from './complex/List';
6-
import SizeToContentList from './size-to-content/List';
7-
import AnimationsList from './animations/List';
8-
import StyledList from './styled/List';
9-
10-
import styles from './app.module.css';
4+
import BasicExample from './basic/BasicExample';
5+
import ComplexExample from './complex/ComplexExample';
6+
import SizeToContentExample from './size-to-content/SizeToContentExample';
7+
import AnimationsExample from './animations/AnimationsExample';
8+
import StyledExample from './styled/StyledExample';
119

1210
const ExampleType = enumerable(
1311
'BASIC',
@@ -42,15 +40,15 @@ class App extends PureComponent {
4240

4341
switch (selectedExample) {
4442
case ExampleType.BASIC:
45-
return <BasicList />;
43+
return <BasicExample />;
4644
case ExampleType.COMPLEX:
47-
return <ComplexList />;
45+
return <ComplexExample />;
4846
case ExampleType.SIZE_TO_CONTENT:
49-
return <SizeToContentList />;
47+
return <SizeToContentExample />;
5048
case ExampleType.ANIMATIONS:
51-
return <AnimationsList />;
49+
return <AnimationsExample />;
5250
case ExampleType.STYLED:
53-
return <StyledList />;
51+
return <StyledExample />;
5452
}
5553

5654
return null;
@@ -64,10 +62,16 @@ class App extends PureComponent {
6462
const { selectedExample } = this.state;
6563

6664
return (
67-
<div className={styles.example}>
68-
<h1>react-swipeable-list example</h1>
69-
<h5>(try also mobile view in dev tools for touch events)</h5>
70-
<select value={selectedExample} onChange={this.handleSelectExample}>
65+
<div className="page-content">
66+
<h1 className="page-content__title">react-swipeable-list example</h1>
67+
<h2 className="page-content__subtitle">
68+
(try also mobile view in dev tools for touch events)
69+
</h2>
70+
<select
71+
className="page__select"
72+
value={selectedExample}
73+
onChange={this.handleSelectExample}
74+
>
7175
{Examples.map(item => (
7276
<option key={item.id} value={item.id}>
7377
{item.text}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
.animations-swipeable-list__container {
2+
width: 100%;
3+
margin: 24px 0;
4+
outline-color: gray;
5+
outline-style: solid;
6+
outline-width: 1px 0;
7+
}
8+
9+
.animations__switcher {
10+
align-self: auto;
11+
}
12+
13+
.animations__switcher-row {
14+
padding-top: 8px;
15+
}
16+
17+
.my-node-exit {
18+
opacity: 1;
19+
}
20+
21+
.my-node-exit-active {
22+
opacity: 0;
23+
max-height: 0;
24+
transition: max-height 1000ms, opacity 1500ms;
25+
}
26+
27+
.my-node-enter {
28+
opacity: 0;
29+
max-height: 0;
30+
}
31+
32+
.my-node-enter-active {
33+
opacity: 1;
34+
max-height: 1000px;
35+
transition: max-height 4000ms, opacity 1500ms;
36+
}

0 commit comments

Comments
 (0)