mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2025-02-06 16:55:41 +01:00
Added property values to docs
This commit is contained in:
parent
62f3cbe8fb
commit
b31537e063
2 changed files with 30 additions and 6 deletions
|
@ -9,7 +9,7 @@ export default class SpecDoc extends React.Component {
|
||||||
render () {
|
render () {
|
||||||
const {fieldSpec} = this.props;
|
const {fieldSpec} = this.props;
|
||||||
|
|
||||||
const {doc} = fieldSpec;
|
const {doc, values} = fieldSpec;
|
||||||
const sdkSupport = fieldSpec['sdk-support'];
|
const sdkSupport = fieldSpec['sdk-support'];
|
||||||
|
|
||||||
const headers = {
|
const headers = {
|
||||||
|
@ -22,11 +22,25 @@ export default class SpecDoc extends React.Component {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{doc &&
|
{doc &&
|
||||||
<div>{doc}</div>
|
<div className="SpecDoc">
|
||||||
|
<div className="SpecDoc__doc">{doc}</div>
|
||||||
|
{values &&
|
||||||
|
<ul className="SpecDoc__values">
|
||||||
|
{Object.entries(values).map(([key, value]) => {
|
||||||
|
return (
|
||||||
|
<li key={key}>
|
||||||
|
<code>{JSON.stringify(key)}</code>
|
||||||
|
<div>{value.doc}</div>
|
||||||
|
</li>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</ul>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
{sdkSupport &&
|
{sdkSupport &&
|
||||||
<div className="sdk-support">
|
<div className="SpecDoc__sdk-support">
|
||||||
<table className="sdk-support__table">
|
<table className="SpecDoc__sdk-support__table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th></th>
|
<th></th>
|
||||||
|
|
|
@ -194,13 +194,13 @@
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sdk-support {
|
.SpecDoc__sdk-support {
|
||||||
position: relative;
|
position: relative;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sdk-support__table {
|
.SpecDoc__sdk-support__table {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-top: $margin-3;
|
margin-top: $margin-3;
|
||||||
|
|
||||||
|
@ -210,3 +210,13 @@
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.SpecDoc__values li {
|
||||||
|
margin-top: $margin-3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.SpecDoc__values code {
|
||||||
|
background: $color-midgray;
|
||||||
|
padding: 0.1em 0.3em;
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue