-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhancement: Clans page error handling and Snowflake timeframe constr…
…aint (#544) * refactor datatable implementation to be cleaner to read * refactor to clans entrypoint * add month check for snowflakes * move snowflakes to a webpack asset * spelling fix and eslint formatting * undo some "refactoring" and add append a generic error message if clans fail to load * add basic loading spinner * linting
- Loading branch information
Showing
9 changed files
with
68 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module.exports = { | ||
webpack: { | ||
args: ['node_modules/.bin/webpack'] | ||
} | ||
args: ['node_modules/.bin/webpack'], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
mixin loading-spinner | ||
.spinner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
extends ../../layouts/default | ||
include ../../mixins/loading-spinner | ||
|
||
block content | ||
h1 Clans | ||
+loading-spinner | ||
table#clan-table | ||
block js | ||
script(src=webpackAssetJS('clans')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const script = document.createElement('script') | ||
|
||
script.src = 'https://unpkg.com/magic-snowflakes/dist/snowflakes.min.js' | ||
script.setAttribute('crossorigin', 'anonymous') | ||
|
||
document.body.appendChild(script) | ||
|
||
script.onload = function () { | ||
const currentMonth = new Date().getMonth() + 1 | ||
if ( | ||
typeof Snowflakes !== 'undefined' && | ||
(currentMonth <= 2 || currentMonth >= 10) | ||
) { | ||
// eslint-disable-next-line no-new, no-undef | ||
new Snowflakes() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters