Skip to content

Commit

Permalink
add 'work in progress' warning in production
Browse files Browse the repository at this point in the history
  • Loading branch information
customcommander committed Sep 8, 2024
1 parent bdb600f commit 3339983
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
14 changes: 12 additions & 2 deletions src/component-footer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import {LitElement, html} from 'lit';
import {LitElement, html, css} from 'lit';
import {when} from 'lit/directives/when.js';

class AgricolaFooter extends LitElement {
static styles = css`
#warning {
color: red;
}
`;

constructor() {
super();
Expand All @@ -9,7 +15,11 @@ class AgricolaFooter extends LitElement {

render() {
return html`
<div>Version: ${VERSION}</div>
<div>
Version: ${VERSION}
${when(PRODUCTION,
() => html`<strong id="warning">This game is not ready yet! Work in progress...</strong>`)}
</div>
`;
}
}
Expand Down
3 changes: 2 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export default function webpack_config(env, argv) {
}),
new webpack.DefinePlugin({
// version is injected during production build. see deploy.yml
VERSION: JSON.stringify(env.version ?? 'dev')
VERSION: JSON.stringify(env.version ?? 'dev'),
PRODUCTION: env.production === true,
}),
]
};
Expand Down

0 comments on commit 3339983

Please sign in to comment.