forked from SakshamHaryana-SE/enketo
-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathApp.js
More file actions
49 lines (44 loc) · 1.3 KB
/
App.js
File metadata and controls
49 lines (44 loc) · 1.3 KB
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
40
41
42
43
44
45
46
47
48
49
import './App.css';
import React, { useState } from 'react';
import GenericForm from './components/GenericForm';
function App() {
const [flows, setFlows] = useState([
{
name: 'Jumping Forms',
config: 'workflow_first.json',
submitToHasura: false
},
{
name: 'Hasura Submissions',
config: 'workflow_second.json',
submitToHasura: true
},
{
name: 'Offline Capabilities',
config: 'workflow_first.json',
offline: true
},
{
name: 'File Upload',
config: 'workflow_first.json'
}
])
const [selectedFlow, setSelectedFlow] = useState({});
return (
<div className="App">
<div className='container'>
{!Object.keys(selectedFlow).length ?
<>
<div className='heading animate__animated animate__fadeInDown'>Workflow Demo App</div>
<div className='subtitle animate__animated animate__fadeInDown'>Please select one of the flows</div>
<div className='btnContainer'>
{flows?.map(el => <div className='workflowBtns animate__animated animate__fadeIn' onClick={() => setSelectedFlow(el)}>{el.name}</div>)}
</div>
</>
: <GenericForm {...{ selectedFlow, setSelectedFlow }} />
}
</div>
</div>
);
}
export default App;