mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-11 03:24:16 +00:00
removed unused page
This commit is contained in:
parent
4434e8c1d0
commit
9d42407687
@ -1,82 +0,0 @@
|
|||||||
import React from "react"
|
|
||||||
import * as antd from "antd"
|
|
||||||
import { TransitionMotion, spring, presets } from "react-motion"
|
|
||||||
|
|
||||||
import "./index.less"
|
|
||||||
|
|
||||||
export default (props) => {
|
|
||||||
const [data, setData] = React.useState([])
|
|
||||||
|
|
||||||
const enterRandom = () => {
|
|
||||||
setData(data.concat({
|
|
||||||
key: Math.random(),
|
|
||||||
data: {
|
|
||||||
text: `Entry ${data.length + 1}`,
|
|
||||||
}
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
|
|
||||||
const getDefaultStyles = () => {
|
|
||||||
return data.map((todo) => ({
|
|
||||||
...todo,
|
|
||||||
style: { height: 0, opacity: 1 }
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
|
|
||||||
const getStyles = () => {
|
|
||||||
return data.map((todo, i) => {
|
|
||||||
console.log(todo, i)
|
|
||||||
return {
|
|
||||||
...todo,
|
|
||||||
style: {
|
|
||||||
height: spring(60, presets.gentle),
|
|
||||||
opacity: spring(1, presets.gentle),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const willEnter = () => {
|
|
||||||
return {
|
|
||||||
height: 0,
|
|
||||||
opacity: 1,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const willLeave = () => {
|
|
||||||
return {
|
|
||||||
height: spring(0),
|
|
||||||
opacity: spring(0),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return <div class="list">
|
|
||||||
<antd.Button
|
|
||||||
type="primary"
|
|
||||||
onClick={enterRandom}
|
|
||||||
>
|
|
||||||
Add new
|
|
||||||
</antd.Button>
|
|
||||||
<TransitionMotion
|
|
||||||
defaultStyles={getDefaultStyles()}
|
|
||||||
styles={getStyles()}
|
|
||||||
willLeave={willLeave}
|
|
||||||
willEnter={willEnter}
|
|
||||||
>
|
|
||||||
{(styles) => {
|
|
||||||
return <ul className="ullist">
|
|
||||||
{
|
|
||||||
styles.map(({ key, style, data }) =>
|
|
||||||
<li
|
|
||||||
key={key}
|
|
||||||
style={style}
|
|
||||||
>
|
|
||||||
<h1>{data.text}</h1>
|
|
||||||
</li>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
</ul>
|
|
||||||
}}
|
|
||||||
</TransitionMotion>
|
|
||||||
</div>
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
.list {
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
flex-direction: column;
|
|
||||||
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user