diff --git a/.rubocop.yml b/.rubocop.yml index b6b2cc9..b818231 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -35,6 +35,7 @@ Metrics/BlockLength: Description: allow features to be more descriptive and longer Exclude: - "spec/features/**/*" + - "spec/services/**/*" RSpec/Capybara/FeatureMethods: Description: allow given/background/scenario in capybara features diff --git a/app/assets/stylesheets/components/_flash_message.scss b/app/assets/stylesheets/components/_flash_message.scss index 574adea..3f44ce0 100644 --- a/app/assets/stylesheets/components/_flash_message.scss +++ b/app/assets/stylesheets/components/_flash_message.scss @@ -2,4 +2,5 @@ position: fixed; bottom: 4rem; right: 4rem; + z-index: 1000; } \ No newline at end of file diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb new file mode 100644 index 0000000..0078e5c --- /dev/null +++ b/app/controllers/settings_controller.rb @@ -0,0 +1,9 @@ +class SettingsController < ApplicationController + def show + end + + def import + DailyStatsDataImporter.import(params[:file].path, current_user.id) + redirect_to "/app/stats", notice: "Upload complete" + end +end diff --git a/app/javascript/react/components/Nav/Nav.js b/app/javascript/react/components/Nav/Nav.js index 6f1ced1..d826538 100644 --- a/app/javascript/react/components/Nav/Nav.js +++ b/app/javascript/react/components/Nav/Nav.js @@ -24,6 +24,11 @@ const Nav = () => (
  • Ranking
  • +
  • + + Settings + +
  • ); diff --git a/app/javascript/react/pages/Home/Home.js b/app/javascript/react/pages/Home/Home.js index c83291f..d5019f4 100644 --- a/app/javascript/react/pages/Home/Home.js +++ b/app/javascript/react/pages/Home/Home.js @@ -44,32 +44,36 @@ const Home = () => { return (

    Are you sweating enough?

    - - {display && ( - <> -
    - setDate(newDate)} - focused={focus} - onFocusChange={({ focused }) => setFocus(focused)} - id="date" - /> -
    - - - )} +
    +
    + + {display && ( + <> +
    + setDate(newDate)} + focused={focus} + onFocusChange={({ focused }) => setFocus(focused)} + id="date" + /> +
    + + + )} +
    +
    ); }; diff --git a/app/javascript/react/pages/Stats/Stats.js b/app/javascript/react/pages/Stats/Stats.js index b08f97f..602c377 100644 --- a/app/javascript/react/pages/Stats/Stats.js +++ b/app/javascript/react/pages/Stats/Stats.js @@ -19,7 +19,7 @@ const Stats = () => { if (error) return

    {`Error! ${error.message}`}

    ; return ( -