//
// SPDX-License-Identifier: AGPL-3.0
-import * as React from 'react';
+import React from 'react';
import { Field, InjectedFormProps, WrappedFieldProps } from "redux-form";
import { TextField } from "components/text-field/text-field";
import { NativeSelectField } from "components/select-field/select-field";
type LocalClusterProp = { localCluster: string };
const renderField: React.ComponentType<WrappedFieldProps & LocalClusterProp> = ({ input, localCluster }) => (
- <span>{localCluster === input.value.substr(0, 5) ? "" : "federated"} user {input.value}</span>
+ <span>{localCluster === input.value.substring(0, 5) ? "" : "federated"} user {input.value}</span>
);
export const MyAccountPanelRoot = withStyles(styles)(
<Field
label="First name"
name="firstName"
- component={TextField}
+ component={TextField as any}
disabled
/>
</Grid>
<Field
label="Last name"
name="lastName"
- component={TextField}
+ component={TextField as any}
disabled
/>
</Grid>
<Field
label="E-mail"
name="email"
- component={TextField}
+ component={TextField as any}
disabled
/>
</Grid>
<Field
label="Username"
name="username"
- component={TextField}
+ component={TextField as any}
disabled
/>
</Grid>
<Field
label="Organization"
name="prefs.profile.organization"
- component={TextField}
+ component={TextField as any}
validate={MY_ACCOUNT_VALIDATION}
required
/>
<Field
label="E-mail at Organization"
name="prefs.profile.organization_email"
- component={TextField}
+ component={TextField as any}
validate={MY_ACCOUNT_VALIDATION}
required
/>
<Field
id="prefs.profile.role"
name="prefs.profile.role"
- component={NativeSelectField}
+ component={NativeSelectField as any}
items={RoleTypes}
/>
</Grid>
<Field
label="Website"
name="prefs.profile.website_url"
- component={TextField}
+ component={TextField as any}
/>
</Grid>
<Grid container direction="row" justify="flex-end" >