mirror of
https://github.com/maputnik/editor.git
synced 2026-08-02 19:27:25 +00:00
[WIP] Failed attempt at linking out to docs in help text
This commit is contained in:
@@ -18,14 +18,15 @@ type DocProps = {
|
|||||||
'sdk-support'?: {
|
'sdk-support'?: {
|
||||||
[key: string]: typeof headers
|
[key: string]: typeof headers
|
||||||
}
|
}
|
||||||
|
docUrl?: string
|
||||||
}
|
}
|
||||||
};
|
}; // & WithTranslation?
|
||||||
|
|
||||||
export default class Doc extends React.Component<DocProps> {
|
export default class Doc extends React.Component<DocProps> {
|
||||||
render () {
|
render () {
|
||||||
const {fieldSpec} = this.props;
|
const {fieldSpec} = this.props;
|
||||||
|
|
||||||
const {doc, values} = fieldSpec;
|
const {doc, values, docUrl} = fieldSpec;
|
||||||
const sdkSupport = fieldSpec['sdk-support'];
|
const sdkSupport = fieldSpec['sdk-support'];
|
||||||
|
|
||||||
const renderValues = (
|
const renderValues = (
|
||||||
@@ -85,7 +86,12 @@ export default class Doc extends React.Component<DocProps> {
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
{docUrl &&
|
||||||
|
<div className="SpecDoc__learn-more">
|
||||||
|
<a href={docUrl} target="_blank" rel="noreferrer" onClick={() => console.log('Link clicked')}>Learn More (TODO i18n)</a>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,13 +116,6 @@ class ModalExportInternal extends React.Component<ModalExportInternalProps> {
|
|||||||
<p>
|
<p>
|
||||||
{t("Download a JSON style to your computer.")}
|
{t("Download a JSON style to your computer.")}
|
||||||
</p>
|
</p>
|
||||||
<p>
|
|
||||||
<a href="https://docs.maptiler.com/cloud/api/authentication-key/" target="_blank" rel="noreferrer">MapTiler</a>,
|
|
||||||
<a href="https://www.thunderforest.com/docs/apikeys/" target="_blank" rel="noreferrer">ThunderForest</a>,
|
|
||||||
and <a href="https://docs.stadiamaps.com/authentication/" target="_blank" rel="noreferrer">Stadia Maps</a>
|
|
||||||
may require access keys or other authentication to access map tiles.
|
|
||||||
Refer to their documentation for details.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<FieldString
|
<FieldString
|
||||||
|
|||||||
@@ -4,19 +4,22 @@ const spec = (t: TFunction) => ({
|
|||||||
maputnik: {
|
maputnik: {
|
||||||
maptiler_access_token: {
|
maptiler_access_token: {
|
||||||
label: t("MapTiler Access Token"),
|
label: t("MapTiler Access Token"),
|
||||||
doc: t("Public access token for MapTiler Cloud.")
|
doc: t("Public access token for MapTiler Cloud."),
|
||||||
|
docUrl: "https://docs.maptiler.com/cloud/api/authentication-key/"
|
||||||
},
|
},
|
||||||
thunderforest_access_token: {
|
thunderforest_access_token: {
|
||||||
label: t("Thunderforest Access Token"),
|
label: t("Thunderforest Access Token"),
|
||||||
doc: t("Public access token for Thunderforest services.")
|
doc: t("Public access token for Thunderforest services."),
|
||||||
|
docUrl: "https://www.thunderforest.com/docs/apikeys/",
|
||||||
},
|
},
|
||||||
stadia_access_token: {
|
stadia_access_token: {
|
||||||
label: t("Stadia Maps API Key"),
|
label: t("Stadia Maps API Key"),
|
||||||
doc: t("API key for Stadia Maps.")
|
doc: t("API key for Stadia Maps."),
|
||||||
|
docUrl: "https://docs.stadiamaps.com/authentication/",
|
||||||
},
|
},
|
||||||
style_renderer: {
|
style_renderer: {
|
||||||
label: t("Style Renderer"),
|
label: t("Style Renderer"),
|
||||||
doc: t("Choose the default Maputnik renderer for this style."),
|
doc: t("Choose the default Maputnik renderer for this style.")
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user