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: Screentime warning #1686

Merged
merged 3 commits into from
Jun 29, 2022
Merged

feat: Screentime warning #1686

merged 3 commits into from
Jun 29, 2022

Conversation

razvan-pro
Copy link
Collaborator

@razvan-pro razvan-pro commented Jun 28, 2022

This change is Reviewable

@razvan-pro razvan-pro self-assigned this Jun 28, 2022
Copy link
Collaborator

@KamilPawel KamilPawel left a comment

Choose a reason for hiding this comment

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

Reviewed 7 of 7 files at r1, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @razvan-pro)


game_frontend/public/handlebars_template.html line 162 at r1 (raw file):

    var appData = {
      urlForAimmoDashboard: '{% url_for_aimmo_dashboard %}',
      {% if request.session.screentime_warning_timeout %}screentimeWarningTimeout: \{{ request.session.screentime_warning_timeout }},{% endif %}

Is that \ needed?


game_frontend/src/components/ScreentimeWarning/index.js line 1 at r1 (raw file):

import React, { useEffect } from 'react'

Wouldn't it be better to also import useState as well to be consistent - { useEffect, useState }?


game_frontend/src/components/ScreentimeWarning/index.js line 46 at r1 (raw file):

const ScreentimeWarning = () => {
  const [open, setOpen] = React.useState(false)

So then in both of these instances we can just use useState


game_frontend/src/components/ScreentimeWarning/index.js line 100 at r1 (raw file):

            screen breaks to recharge those brain cells!
          </Typography>
          <Box css={{ mt: 2 }}>

Is the css attr the old MUI way of applying styles?

Copy link
Collaborator Author

@razvan-pro razvan-pro left a comment

Choose a reason for hiding this comment

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

Reviewable status: 5 of 7 files reviewed, 4 unresolved discussions (waiting on @KamilPawel)


game_frontend/public/handlebars_template.html line 162 at r1 (raw file):

Previously, KamilPawel wrote…

Is that \ needed?

Yes, that is to escape those brackets to be interpreted by handlebars template - we want to pass this to Django (the generated template won't include the )


game_frontend/src/components/ScreentimeWarning/index.js line 1 at r1 (raw file):

Previously, KamilPawel wrote…

Wouldn't it be better to also import useState as well to be consistent - { useEffect, useState }?

👍


game_frontend/src/components/ScreentimeWarning/index.js line 46 at r1 (raw file):

Previously, KamilPawel wrote…

So then in both of these instances we can just use useState

👍


game_frontend/src/components/ScreentimeWarning/index.js line 100 at r1 (raw file):

Previously, KamilPawel wrote…

Is the css attr the old MUI way of applying styles?

Yeah, it took me a while to find why sx didn't work 😆

Copy link
Collaborator

@KamilPawel KamilPawel left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @razvan-pro)

@codecov
Copy link

codecov bot commented Jun 29, 2022

Codecov Report

Merging #1686 (adb59e2) into master (d960837) will increase coverage by 0.17%.
The diff coverage is 95.83%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1686      +/-   ##
==========================================
+ Coverage   67.22%   67.39%   +0.17%     
==========================================
  Files         171      173       +2     
  Lines        3521     3549      +28     
  Branches      298      305       +7     
==========================================
+ Hits         2367     2392      +25     
- Misses       1122     1125       +3     
  Partials       32       32              
Impacted Files Coverage Δ
game_frontend/src/img/brain.svg 50.00% <ø> (ø)
...frontend/src/components/ScreentimeWarning/index.js 95.83% <95.83%> (ø)

@razvan-pro razvan-pro merged commit ffd15b6 into master Jun 29, 2022
@razvan-pro razvan-pro deleted the screentime-warning branch June 29, 2022 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants