ff35779cf7050b775681ebf28ac0bb13305991d7
[arvados-workbench2.git] / src / views-components / form-fields / repository-form-fields.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import React from "react";
6 import { Field } from "redux-form";
7 import { TextField } from "components/text-field/text-field";
8 import { REPOSITORY_NAME_VALIDATION } from "validators/validators";
9 import { Grid } from "@material-ui/core";
10
11 export const RepositoryNameField = (props: any) =>
12     <Grid container style={{ marginTop: '0', paddingTop: '24px' }}>
13         <Grid item xs={3}>
14             {props.data.user.username}/
15         </Grid>
16         <Grid item xs={7} style={{ bottom: '24px', position: 'relative' }}>
17             <Field
18                 name='name'
19                 component={TextField}
20                 validate={REPOSITORY_NAME_VALIDATION}
21                 label="Name"
22                 autoFocus={true} />
23         </Grid>
24         <Grid item xs={2}>
25             .git
26         </Grid>
27         <Grid item xs={12}>
28             It may take a minute or two before you can clone your new repository.
29         </Grid>
30     </Grid>;