Skip to content

Commit

Permalink
Merge pull request #12659 from PennyDreadfulMTG/refactor-menu
Browse files Browse the repository at this point in the history
Menu improvements
  • Loading branch information
mergify[bot] authored May 24, 2024
2 parents 4bcfd1c + 93d420e commit 64e97af
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 35 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Check the dev.py source code for the full set of options including `unit`, `type
## Working on React components

- Run logsite
- pipenv run python dev.py watch # Builds bundle.js after every file change.
- pipenv run python dev.py watch # Builds bundle.js after every file change. Uses development build so that you get source maps - useful line numbers and error messages, unlike build/buildjs.

## Decksite performance testing/monitoring

Expand Down
2 changes: 1 addition & 1 deletion decksite/templates/menu.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<li class="{{#admin_only}}admin{{/admin_only}} {{#demimod_only}}demimod{{/demimod_only}}">
{{#badge}}
<div class="badge-holder">
<span class="admin demimod badge {{badge_class}}"><a href="{{url}}">{{text}}</a></span>
<span class="admin demimod badge {{class_name}}"><a href="{{url}}">{{text}}</a></span>
</div>
{{/badge}}
<a class="item {{#current}}current{{/current}}" href="{{url}}">
Expand Down
67 changes: 35 additions & 32 deletions decksite/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,40 @@
/* eslint-disable */
const webpack = require("webpack");
const config = {
entry: [
__dirname + "/../shared_web/static/js/cardtable.jsx",
__dirname + "/../shared_web/static/js/decktable.jsx",
__dirname + "/../shared_web/static/js/headtoheadtable.jsx",
__dirname + "/../shared_web/static/js/leaderboardtable.jsx",
__dirname + "/../shared_web/static/js/matchtable.jsx",
__dirname + "/../shared_web/static/js/metagamegrid.jsx",
__dirname + "/../shared_web/static/js/persontable.jsx",
__dirname + "/../shared_web/static/js/rotationtable.jsx",
],
output: {
path: __dirname + "/../shared_web/static/dist",
filename: "bundle.js"
},
resolve: {
extensions: [".js", ".jsx", ".css"]
},
module: {
rules: [{
test: /\.jsx?/,
exclude: /node_modules/,
use: "babel-loader"
}, {
test: /\.css$/,
exclude: /node_modules/,
use: [{
loader: 'style-loader'
module.exports = (env, argv) => {
const isProduction = argv.mode === 'production';

return {
entry: [
__dirname + "/../shared_web/static/js/cardtable.jsx",
__dirname + "/../shared_web/static/js/decktable.jsx",
__dirname + "/../shared_web/static/js/headtoheadtable.jsx",
__dirname + "/../shared_web/static/js/leaderboardtable.jsx",
__dirname + "/../shared_web/static/js/matchtable.jsx",
__dirname + "/../shared_web/static/js/metagamegrid.jsx",
__dirname + "/../shared_web/static/js/persontable.jsx",
__dirname + "/../shared_web/static/js/rotationtable.jsx",
],
output: {
path: __dirname + "/../shared_web/static/dist",
filename: "bundle.js"
},
resolve: {
extensions: [".js", ".jsx", ".css"]
},
module: {
rules: [{
test: /\.jsx?/,
exclude: /node_modules/,
use: "babel-loader"
}, {
loader: 'css-loader'
test: /\.css$/,
exclude: /node_modules/,
use: [{
loader: 'style-loader'
}, {
loader: 'css-loader'
}]
}]
}]
},
devtool: isProduction ? false : 'source-map'
}
};
module.exports = config;
2 changes: 1 addition & 1 deletion shared_web/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __len__(self) -> int:
class Badge:
url: str
text: str
className: str
class_name: str

@dataclass
class MenuItem:
Expand Down

0 comments on commit 64e97af

Please sign in to comment.