-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
39 lines (35 loc) · 1.02 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import React from 'react'
import {
AragonApp,
Button,
Text,
observe
} from '@aragon/ui'
import Aragon, { providers } from '@aragon/client'
import styled from 'styled-components'
const AppContainer = styled(AragonApp)`
display: flex;
align-items: center;
justify-content: center;
`
export default class App extends React.Component {
render () {
return (
<AppContainer>
<div>
<ObservedCount observable={this.props.observable} />
<Button onClick={() => this.props.app.JoinRide(1)}>Join</Button>
<Button onClick={() => this.props.app.rideStart(1)}>Start</Button>
<Button onClick={() => this.props.app.rideFinish(1)}>Finish</Button>
</div>
</AppContainer>
)
}
}
//I think that this calls from script where there is a listener from the .sol file
const ObservedCount = observe(
(state$) => state$,
{ count: 0 }
)(
({ count }) => <Text.Block style={{ textAlign: 'center' }} size='xxlarge'>{count}</Text.Block>
)