1
0
Fork 0
mirror of https://github.com/betagouv/mon-entreprise synced 2025-02-09 01:45:03 +00:00
mon-entreprise/source/components/Rule.js

49 lines
1,000 B
JavaScript
Raw Normal View History

2016-12-07 19:08:10 +01:00
import React, { Component } from 'react'
2017-01-20 11:52:39 +01:00
import {findRuleByName} from '../engine/rules.js'
2016-12-07 19:08:10 +01:00
import './Rule.css'
import JSONTree from 'react-json-tree'
2016-12-07 19:08:10 +01:00
export default class Rule extends Component {
render() {
2016-12-16 17:28:42 +01:00
let {
name
} = this.props.params,
json = findRuleByName(name)
2016-12-07 19:08:10 +01:00
return (
<div id="variable">
2016-12-16 17:28:42 +01:00
<h1>{name}</h1>
2016-12-07 19:08:10 +01:00
<pre>
<code className="yaml">
2016-12-16 17:22:47 +01:00
<JSONTree getItemString={() => ''} theme={theme} hideRoot="true" shouldExpandNode={() => true} data={json} />
2016-12-07 19:08:10 +01:00
</code>
</pre>
</div>
)
}
}
2016-12-16 17:22:47 +01:00
var theme = {
scheme: 'atelier forest',
author: 'bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/forest)',
base00: '#1b1918',
base01: '#2c2421',
base02: '#68615e',
base03: '#766e6b',
base04: '#9c9491',
base05: '#a8a19f',
base06: '#e6e2e0',
base07: '#f1efee',
base08: '#f22c40',
base09: '#df5320',
base0A: '#d5911a',
base0B: '#5ab738',
base0C: '#00ad9c',
base0D: '#407ee7',
base0E: '#6666ea',
base0F: '#c33ff3'
}