Skip to content

Commit 1bb6839

Browse files
authored
Fix: Migrate tests to new page that showcases how it works (#141)
* drop classnames * Improved example
1 parent 572990d commit 1bb6839

File tree

4 files changed

+9
-276
lines changed

4 files changed

+9
-276
lines changed

example/pages/index.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Component } from 'react'
22
import Head from 'next/head'
33
import systemFontStack from 'system-font-stack'
4-
import cx from 'classnames'
54
import scrollIntoViewIfNeeded from 'scroll-into-view-if-needed'
65

76
export interface IndexPageProps {
@@ -56,21 +55,22 @@ export default class IndexPage extends Component<
5655
white-space: nowrap;
5756
}
5857
59-
ul li {
58+
li {
6059
background: #eee;
6160
border-radius: 5px;
6261
display: inline-block;
6362
list-style: none;
6463
padding: 5px 10px;
64+
margin: 3px;
6565
}
6666
67-
ul li:nth-child(2n + 1) {
67+
li:nth-child(2n + 1) {
6868
background: #ddd;
6969
text-align: right;
7070
}
7171
72-
ul li.selected {
73-
background: #bada55;
72+
li:nth-child(8n + 1) {
73+
display: block;
7474
}
7575
`}</style>
7676
<ul
@@ -82,15 +82,17 @@ export default class IndexPage extends Component<
8282
>
8383
{this.props.items.map(i => (
8484
<li
85-
className={cx({ selected: this.state.selected === i })}
85+
style={{
86+
background: this.state.selected === i ? '#bada55' : null,
87+
}}
8688
key={i.toString()}
8789
>
8890
item #{i}
8991
</li>
9092
))}
9193
</ul>
9294
<div>
93-
{[0, 11, 22, 24, 26, 33, 44, 55, 66, 77, 82, 82, 86, 99].map(v => (
95+
{[0, 11, 22, 24, 26, 33, 44, 55, 66, 77, 82, 84, 86, 99].map(v => (
9496
<button onClick={this.handleClick} value={v}>
9597
#{v}
9698
</button>

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,13 @@
3333
"amator": "1.0.1"
3434
},
3535
"devDependencies": {
36-
"@types/classnames": "^2.2.3",
3736
"@types/next": "^2.4.5",
3837
"@types/react": "^16.0.20",
3938
"@types/react-dom": "^16.0.2",
4039
"babel-cli": "^6.23.0",
4140
"babel-plugin-add-module-exports": "^0.2.1",
4241
"babel-preset-env": "^1.2.1",
4342
"babel-preset-es2015-rollup": "^3.0.0",
44-
"classnames": "^2.2.5",
4543
"concurrently": "^3.5.0",
4644
"cypress": "^1.0.3",
4745
"husky": "^0.14.3",

test/test-vertical.html

Lines changed: 0 additions & 259 deletions
This file was deleted.

yarn.lock

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@
6161
lodash "^4.17.4"
6262
pify "^3.0.0"
6363

64-
"@types/classnames@^2.2.3":
65-
version "2.2.3"
66-
resolved "https://registry.yarnpkg.com/@types/classnames/-/classnames-2.2.3.tgz#3f0ff6873da793870e20a260cada55982f38a9e5"
67-
6864
"@types/next@^2.4.5":
6965
version "2.4.5"
7066
resolved "https://registry.yarnpkg.com/@types/next/-/next-2.4.5.tgz#6c18502fec7d82c153f502da0562dfd5e6a15e27"
@@ -1327,10 +1323,6 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3:
13271323
inherits "^2.0.1"
13281324
safe-buffer "^5.0.1"
13291325

1330-
classnames@^2.2.5:
1331-
version "2.2.5"
1332-
resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.2.5.tgz#fb3801d453467649ef3603c7d61a02bd129bde6d"
1333-
13341326
cli-cursor@^1.0.2:
13351327
version "1.0.2"
13361328
resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987"

0 commit comments

Comments
 (0)