Skip to content

Commit

Permalink
refactor(w3c/templates/cgbg-sotd): reuse renderPreview (#3106)
Browse files Browse the repository at this point in the history
  • Loading branch information
sidvishnoi committed Sep 11, 2020
1 parent a9d4481 commit c718bd3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 26 deletions.
27 changes: 2 additions & 25 deletions src/w3c/templates/cgbg-sotd.js
@@ -1,34 +1,11 @@
// @ts-check
import { l10n, renderPublicList } from "./sotd.js";
import { l10n, renderPreview, renderPublicList } from "./sotd.js";
import { html } from "../../core/import-maps.js";

export default (conf, opts) => {
return html`
<h2>${l10n.sotd}</h2>
${conf.isPreview
? html`<details class="annoying-warning" open="">
<summary>
This is a
preview${conf.prUrl && conf.prNumber
? html`
of pull request
<a href="${conf.prUrl}">#${conf.prNumber}</a>
`
: ""}
</summary>
<p>
Do not attempt to implement this version of the specification. Do
not reference this version as authoritative in any way.
${conf.edDraftURI
? html`
Instead, see
<a href="${conf.edDraftURI}">${conf.edDraftURI}</a> for the
Editor's draft.
`
: ""}
</p>
</details>`
: ""}
${conf.isPreview ? renderPreview(conf) : ""}
<p>
This specification was published by the
<a href="${conf.wgURI}">${conf.wg}</a>. It is not a W3C Standard nor is it
Expand Down
2 changes: 1 addition & 1 deletion src/w3c/templates/sotd.js
Expand Up @@ -127,7 +127,7 @@ export default (conf, opts) => {
`;
};

function renderPreview(conf) {
export function renderPreview(conf) {
const { prUrl, prNumber, edDraftURI } = conf;
return html`<details class="annoying-warning" open="">
<summary>
Expand Down

0 comments on commit c718bd3

Please sign in to comment.