diff --git a/webpack/css/_index.scss b/webpack/css/_index.scss index 1d94772a9..d6e67cdf0 100644 --- a/webpack/css/_index.scss +++ b/webpack/css/_index.scss @@ -2,6 +2,7 @@ @import "temp"; // Node Modules @import "../../node_modules/@blueprintjs/core/dist/blueprint.css"; +@import "../../node_modules/@blueprintjs/datetime/dist/blueprint-datetime.css"; // Partials @import "animations"; @import "colors"; diff --git a/webpack/css/farm_designer/farm_designer.scss b/webpack/css/farm_designer/farm_designer.scss index b449c2437..c6cd4051b 100644 --- a/webpack/css/farm_designer/farm_designer.scss +++ b/webpack/css/farm_designer/farm_designer.scss @@ -209,17 +209,18 @@ .garden-map-legend { position: fixed; - top: 11rem; - right: -12rem; + top: 110px; + right: -120px; transition: all 0.4s ease; box-shadow: 0px 1px 4px #555; + max-width: 336px; &.active { - transform: translateX(-14rem); + transform: translateX(-140px); } .content { background: $light_green; - padding: 1rem; - border-radius: 0.5rem; + padding: 10px; + border-radius: 5px; display: flex; flex-direction: column; flex-wrap: wrap; diff --git a/webpack/farm_designer/farm_events/edit_fe_form.tsx b/webpack/farm_designer/farm_events/edit_fe_form.tsx index e7325b6cb..428178918 100644 --- a/webpack/farm_designer/farm_events/edit_fe_form.tsx +++ b/webpack/farm_designer/farm_events/edit_fe_form.tsx @@ -236,7 +236,8 @@ export class EditFEForm extends React.Component { /> - + return (
- - {t("Menu")} - - -
-
-
- - + className={"garden-map-legend " + menuClass} + style={{ zoom: 1 }}> +
+ + {t("Menu")} + +
-
- - - - -
-
- -
-
+
+ + +
+
+ -
-
-
+
+ +
+
+
+
+
+
+
-
+ ); } diff --git a/webpack/farm_designer/map/layers/spread_layer.tsx b/webpack/farm_designer/map/layers/spread_layer.tsx index 29deee2db..aab067432 100644 --- a/webpack/farm_designer/map/layers/spread_layer.tsx +++ b/webpack/farm_designer/map/layers/spread_layer.tsx @@ -2,11 +2,7 @@ import * as React from "react"; import { Component } from "react"; import { TaggedPlantPointer } from "../../../resources/tagged_resources"; import { BotOriginQuadrant } from "../../interfaces"; -import { - round, - scale, - getXYFromQuadrant -} from "../util"; +import { round, scale, getXYFromQuadrant } from "../util"; import { cachedCrop } from "../../../open_farm/index"; interface SpreadLayerProps { @@ -18,20 +14,23 @@ interface SpreadLayerProps { export function SpreadLayer(props: SpreadLayerProps) { let { plants, visible, currentPlant, botOriginQuadrant } = props; - - return - { - plants.map((p, index) => { - let isSelected = p === currentPlant; - return (visible || isSelected) ? - : ; - }) - } - ; + return ( + + { + plants.map((p, index) => { + let isSelected = p === currentPlant; + return (visible || isSelected) ? + + : + ; + }) + } + + ); } interface SpreadCircleProps { @@ -48,7 +47,7 @@ export class SpreadCircle extends state: SpreadCircleState = { spread: undefined }; - componentWillReceiveProps() { + componentDidMount() { cachedCrop(this.props.plant.body.openfarm_slug) .then(({ spread }) => this.setState({ spread })); } diff --git a/webpack/front_page/front_page.tsx b/webpack/front_page/front_page.tsx index a76336e48..0feda8050 100644 --- a/webpack/front_page/front_page.tsx +++ b/webpack/front_page/front_page.tsx @@ -30,14 +30,13 @@ export class FrontPage extends React.Component<{}, Partial> { } componentDidMount() { + if (Session.get()) { window.location.href = "/app/controls"; } logInit(); API.setBaseUrl(API.fetchBrowserLocation()); this.setState({ serverURL: API.fetchHostName(), serverPort: API.inferPort() }); - // RICK CHECK ME ON THIS PLZ -CV - if (Session.get()) { window.location.href = "/app/controls"; } } set = (name: keyof FrontPageState) => @@ -120,7 +119,8 @@ export class FrontPage extends React.Component<{}, Partial> { }).catch(error => { let errorMessage = prettyPrintApiErrors(error); if (errorMessage.toLowerCase().includes("not found")) { - errorMessage = "That email address is not associated with an account."; + errorMessage = + `That email address is not associated with an account.`; } log(errorMessage); }); @@ -136,7 +136,8 @@ export class FrontPage extends React.Component<{}, Partial> { + value={this.state.agreeToTerms ? "false" : "true"} + />
  • @@ -173,192 +174,197 @@ export class FrontPage extends React.Component<{}, Partial> { let expandIcon = showServerOpts ? "minus" : "plus"; let { toggleServerOpts } = this; - return ( -
    - - -

    - {t("Welcome to the")} -
    -   - {t("FarmBot Web App")} -

    - -
    - -
    + // If the user is already logged in, don't show this page. + if (!Session.get()) { + return ( +
    -

    - - {t("Setup, customize, and control FarmBot from your")} + +

    + {t("Welcome to the")} +
      - - {t("computer")} - - - {t("tablet")} - - - {t("smartphone")} - - -

    + {t("FarmBot Web App")} + +
    - - - - {!forgotPassword && ( + +
    + +

    + + {t("Setup, customize, and control FarmBot from your")} +   + + {t("computer")} + + + {t("tablet")} + + + {t("smartphone")} + + +

    +
    + + + + {!forgotPassword && ( + + + + + + +
    + + + + + + {t("Forgot password?")} + + {this.state.showServerOpts && +
    + + + + +
    + } + + + +
    +
    +
    + + )} + {forgotPassword && ( + + + + + + +
    + + + + + +
    +
    +
    + + )} - - - + -
    + + + - - {t("Forgot password?")} - - {this.state.showServerOpts && -
    - - - - -
    - } - - - -
    -
    -
    - - )} - {forgotPassword && ( - - - - - - -
    - + + {this.maybeRenderTos()}
    - )} - - - - -
    - - - - - - - - - {this.maybeRenderTos()} - - - -
    -
    -
    - -
    + +
    -
    - ); + ); + } else { + return
    ; + } } } diff --git a/yarn.lock b/yarn.lock index a23f1fa46..295260f76 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1395,13 +1395,13 @@ debug@2.6.4: dependencies: ms "0.7.3" -debug@^2.1.1, debug@^2.2.0, debug@^2.4.5, debug@^2.6.3, debug@^2.6.6: +debug@^2.1.1, debug@^2.2.0, debug@^2.4.5, debug@^2.6.6: version "2.6.6" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.6.tgz#a9fa6fbe9ca43cf1e79f73b75c0189cbb7d6db5a" dependencies: ms "0.7.3" -debug@^2.6.8: +debug@^2.6.3, debug@^2.6.8: version "2.6.8" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" dependencies: