Fix commented issues

This commit is contained in:
Krzysztof Bialoglowicz 2019-09-16 13:43:02 +02:00
parent 1f6386c368
commit c59ed7664b
6 changed files with 34 additions and 37 deletions

View file

@ -148,7 +148,6 @@ const CollectionDetailsPage: React.StatelessComponent<
} }
)} )}
> >
<>
<FormSpacer /> <FormSpacer />
<Hr /> <Hr />
<ControlledCheckbox <ControlledCheckbox
@ -161,7 +160,6 @@ const CollectionDetailsPage: React.StatelessComponent<
onChange={change} onChange={change}
disabled={disabled} disabled={disabled}
/> />
</>
</VisibilityCard> </VisibilityCard>
</div> </div>
</div> </div>

View file

@ -23,18 +23,16 @@ const styles = createStyles({
"& > span": { "& > span": {
padding: "6px" padding: "6px"
} }
},
secondLabel: {
display: "block",
fontSize: "12px"
} }
}); });
interface RadioGroupFieldProps { interface RadioGroupFieldChoice {
choices: Array<{
value: string; value: string;
label: React.ReactNode; label: React.ReactNode;
}>; }
interface RadioGroupFieldProps {
choices: RadioGroupFieldChoice[];
className?: string; className?: string;
disabled?: boolean; disabled?: boolean;
error?: boolean; error?: boolean;

View file

@ -51,13 +51,13 @@ export const RadioSwitchField = withStyles(styles, {
secondOptionLabel, secondOptionLabel,
value value
}: RadioSwitchFieldProps & WithStyles<typeof styles>) => { }: RadioSwitchFieldProps & WithStyles<typeof styles>) => {
const initialValue = value ? "visible" : "hidden"; const initialValue = value ? "true" : "false";
const change = event => { const change = event => {
onChange({ onChange({
target: { target: {
name: event.target.name, name: event.target.name,
value: event.target.value === "visible" ? true : false value: event.target.value === "true" ? true : false
} }
} as any); } as any);
}; };
@ -75,14 +75,14 @@ export const RadioSwitchField = withStyles(styles, {
onChange={event => change(event)} onChange={event => change(event)}
> >
<FormControlLabel <FormControlLabel
value="visible" value="true"
className={classes.radioLabel} className={classes.radioLabel}
control={<Radio color="primary" />} control={<Radio color="primary" />}
label={firstOptionLabel} label={firstOptionLabel}
name={name} name={name}
/> />
<FormControlLabel <FormControlLabel
value="hidden" value="false"
className={classes.radioLabel} className={classes.radioLabel}
control={<Radio color="primary" />} control={<Radio color="primary" />}
label={secondOptionLabel} label={secondOptionLabel}

View file

@ -19,14 +19,16 @@ import PageHeader from "../components/PageHeader";
import { PermissionEnum } from "../types/globalTypes"; import { PermissionEnum } from "../types/globalTypes";
export interface MenuItem { export interface MenuItem {
label: string;
menuItems: Array<{
description: string; description: string;
icon: React.ReactElement<IconProps>; icon: React.ReactElement<IconProps>;
permission: PermissionEnum; permission: PermissionEnum;
title: string; title: string;
url?: string; url?: string;
}>; }
export interface MenuSection {
label: string;
menuItems: MenuItem[];
} }
const styles = (theme: Theme) => const styles = (theme: Theme) =>
@ -87,7 +89,7 @@ const styles = (theme: Theme) =>
}); });
export interface ConfigurationPageProps { export interface ConfigurationPageProps {
menu: MenuItem[]; menu: MenuSection[];
user: User; user: User;
onSectionClick: (sectionName: string) => void; onSectionClick: (sectionName: string) => void;
} }

View file

@ -25,9 +25,9 @@ import { siteSettingsUrl } from "@saleor/siteSettings/urls";
import { staffListUrl } from "@saleor/staff/urls"; import { staffListUrl } from "@saleor/staff/urls";
import { taxSection } from "@saleor/taxes/urls"; import { taxSection } from "@saleor/taxes/urls";
import { PermissionEnum } from "@saleor/types/globalTypes"; import { PermissionEnum } from "@saleor/types/globalTypes";
import ConfigurationPage, { MenuItem } from "./ConfigurationPage"; import ConfigurationPage, { MenuSection } from "./ConfigurationPage";
export function createConfigurationMenu(intl: IntlShape): MenuItem[] { export function createConfigurationMenu(intl: IntlShape): MenuSection[] {
return [ return [
{ {
label: intl.formatMessage({ label: intl.formatMessage({

View file

@ -1,5 +1,4 @@
import Button from "@material-ui/core/Button"; import Button from "@material-ui/core/Button";
import React from "react"; import React from "react";
import { FormattedMessage, useIntl } from "react-intl"; import { FormattedMessage, useIntl } from "react-intl";