update react-restaurant-menu

This commit is contained in:
João Mendes 2020-09-06 21:38:24 +01:00
parent 2b6ecdfca5
commit 5756f31e13
1 changed files with 19 additions and 21 deletions

View File

@ -1,28 +1,26 @@
import * as React from "react"; import * as React from "react";
import styles from "./RestaurantMenu.module.scss";
import { IRestaurantMenuProps } from "./IRestaurantMenuProps";
import { escape } from "@microsoft/sp-lodash-subset";
import {
mergeStyleSets,
Customizer,
Stack,
IStackTokens,
FontIcon,
Label,
Text,
} from "office-ui-fabric-react";
import { toUpper } from "lodash";
import moment from "moment"; import moment from "moment";
import { EWeekdays } from "./EWeekDays"; import {
import { MenuDetail } from "./MenuDetail"; Customizer,
import { css } from "office-ui-fabric-react/lib/Utilities"; FontIcon,
IStackTokens,
Label,
mergeStyleSets,
Stack,
Text
} from "office-ui-fabric-react";
import strings from "RestaurantMenuWebPartStrings";
import { DisplayMode } from "@microsoft/sp-core-library";
import { WebPartTitle } from "@pnp/spfx-controls-react"; import { WebPartTitle } from "@pnp/spfx-controls-react";
import { Placeholder } from "@pnp/spfx-controls-react/lib/Placeholder"; import { Placeholder } from "@pnp/spfx-controls-react/lib/Placeholder";
import { toUpper } from "lodash";
import { DisplayMode } from "@microsoft/sp-core-library"; import { EWeekdays } from "./EWeekDays";
import { PropertyPaneSlider } from "@microsoft/sp-webpart-base"; import { IRestaurantMenuProps } from "./IRestaurantMenuProps";
import strings from "RestaurantMenuWebPartStrings"; import { MenuDetail } from "./MenuDetail";
const stackTokens: IStackTokens = { const stackTokens: IStackTokens = {
childrenGap: 10, childrenGap: 10,
}; };
@ -140,7 +138,7 @@ export const RestaurantMenu: React.FunctionComponent<IRestaurantMenuProps> = (
setShowMenuForDay(undefined); setShowMenuForDay(undefined);
try { try {
let _currentDay = moment().isoWeekday(); let _currentDay = moment().isoWeekday();
console.log(_currentDay);
switch (_currentDay) { switch (_currentDay) {
case EWeekdays.Monday: case EWeekdays.Monday:
setShowMenuForDay(EWeekdays.Monday); setShowMenuForDay(EWeekdays.Monday);