Skip to content

Commit

Permalink
Refactor after discussion
Browse files Browse the repository at this point in the history
  • Loading branch information
ianthetechie committed Sep 21, 2024
1 parent a8ebd77 commit 4063daf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/components/Doc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ type DocProps = {
[key: string]: typeof headers
}
docUrl?: string,
docUrlDescription?: string
docUrlLinkText?: string
}
};

export default class Doc extends React.Component<DocProps> {
render () {
const {fieldSpec} = this.props;

const {doc, values, docUrl, docUrlDescription} = fieldSpec;
const {doc, values, docUrl, docUrlLinkText} = fieldSpec;
const sdkSupport = fieldSpec['sdk-support'];

const renderValues = (
Expand Down Expand Up @@ -87,9 +87,9 @@ export default class Doc extends React.Component<DocProps> {
</table>
</div>
}
{docUrl && docUrlDescription &&
{docUrl && docUrlLinkText &&
<div className="SpecDoc__learn-more">
<a href={docUrl} target="_blank" rel="noreferrer">{docUrlDescription}</a>
<a href={docUrl} target="_blank" rel="noreferrer">{docUrlLinkText}</a>
</div>
}
</>
Expand Down
6 changes: 3 additions & 3 deletions src/libs/field-spec-additional.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ const spec = (t: TFunction) => ({
label: t("MapTiler Access Token"),
doc: t("Public access token for MapTiler Cloud."),
docUrl: "https://docs.maptiler.com/cloud/api/authentication-key/",
docUrlDescription: t("Learn More")
docUrlLinkText: t("Learn More")
},
thunderforest_access_token: {
label: t("Thunderforest Access Token"),
doc: t("Public access token for Thunderforest services."),
docUrl: "https://www.thunderforest.com/docs/apikeys/",
docUrlDescription: t("Learn More")
docUrlLinkText: t("Learn More")
},
stadia_access_token: {
label: t("Stadia Maps API Key"),
doc: t("API key for Stadia Maps."),
docUrl: "https://docs.stadiamaps.com/authentication/",
docUrlDescription: t("Learn More")
docUrlLinkText: t("Learn More")
},
style_renderer: {
label: t("Style Renderer"),
Expand Down

0 comments on commit 4063daf

Please sign in to comment.