Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: themes, sortie boss name, cookies #172

Merged
merged 4 commits into from
Sep 4, 2018
Merged

feat: themes, sortie boss name, cookies #172

merged 4 commits into from
Sep 4, 2018

Conversation

TobiTenno
Copy link
Member

Warframe Hub Pull Request


Summary (short):
Closes #155 #167
Initial change for #166, delete checking code in a month


Description:
Makes sortie timer earlier in DOM compared to rest of sortie info
Shift dependence on cookies to localStorage
Use themes over html class, eventually refactor boostrap primary configs to .less so we can "theme" them, nest them inside of theme classes, easier


Fixes issue (include link):
#155 #166 #167


Mockups, screenshots, evidence:
See deployment


(Check one)

  • Issue fix
  • Suggestion fulfillment

@TobiTenno TobiTenno self-assigned this Aug 31, 2018
@TobiTenno TobiTenno temporarily deployed to warframehub-prod-pr-172 August 31, 2018 19:56 Inactive
@TobiTenno TobiTenno temporarily deployed to warframehub-prod-pr-172 August 31, 2018 19:57 Inactive
@TobiTenno TobiTenno temporarily deployed to warframehub-prod-pr-172 August 31, 2018 20:06 Inactive
@@ -22,7 +22,7 @@ const cleanupNotifiedIds = () => {
.concat([worldState.cetusCycle.id])
.concat([worldState.voidTrader.id])
.concat(worldState.persistentEnemies.map(enemy => enemy.pid));
const notifiedIds = JSON.parse(localStorage.getItem('notifiedIds') || '[]');
const notifiedIds = JSON.parse(localStorage.notifiedIds || '[]');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a particular reason we're switching off of the built-in function calls?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are a bit more straight-forward when we know the names for certain

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case of changes to the Storage object, I'd prefer to stick with the function calls, especially with localStorage.mode.

Cookies.set(component, value, {expires: 365});
const value = localStorage.getItem(component);
if (typeof value === 'undefined' || value === null) {
localStorage.setItem(component, defValue || 'true');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not relevant to the review, but is there a reason for using the string literals instead of booleans?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

localStorage stores strings


/* Fish info table */
.fish-info {
border: 2px solid #1a242f !important;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could any of these !importants be removed now that there is a more specific selector?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't really matter, but i can try and check

@TobiTenno TobiTenno temporarily deployed to warframehub-prod-pr-172 August 31, 2018 20:18 Inactive
@@ -24,72 +24,75 @@
<script src="https://unpkg.com/draggabilly@2/dist/draggabilly.pkgd.min.js"></script>
<!-- Cookies CDN -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-cookie/2.1.4/js.cookie.min.js"></script>
<!-- Cookie Consent -->
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.js"></script>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Incoming Lighthouse improvement

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, that's my hope

themecustom.attr('href', "/css/main.retro.css?v={{lookup sums 'css/main.retro.css'}}");
theme.toggleClass('retro');
$('html').removeClass();
$('html').addClass('retro');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would simply $('html').attr('class', 'retro') do?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

Cookies.set('mode', 'day', {expires: 365});
html.removeClass(localStorage.mode);
localStorage.mode = 'day';
html.attr('data-theme', 'day');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we use this attribute for anything?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, meant to drop it back off

theme.removeClass();
Cookies.set('mode', 'day', {expires: 365});
html.removeClass(localStorage.mode);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block is really similar to the one above. Would it be possible to combine the two? Something along the lines of just setting themeName = 'day' whenever reset || theme.hasClass(themeName)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uh, if class has themename, it falls into this this block already

Copy link
Contributor

@dsinn dsinn Aug 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, oops, I forgot the ! before hasClass.

@TobiTenno
Copy link
Member Author

oh, i haven't merged yet 🤦‍♂️

@TobiTenno TobiTenno merged commit 95863d0 into dev Sep 4, 2018
@TobiTenno TobiTenno deleted the themes-cookies branch September 5, 2018 13:14
@wfcd-bot-boi
Copy link
Collaborator

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Long sortie boss name cuts off time badge on mobile
3 participants