Convert New File/Folder to use Button

This commit is contained in:
Andrew Nicolaou 2020-04-26 11:52:12 +02:00
parent 0d8aeedd4a
commit 6465a307b3
2 changed files with 12 additions and 2 deletions

View File

@ -2,6 +2,8 @@ import PropTypes from 'prop-types';
import React from 'react';
import { domOnlyProps } from '../../../utils/reduxFormUtils';
import Button from '../../../common/Button';
class NewFileForm extends React.Component {
constructor(props) {
super(props);
@ -33,7 +35,10 @@ class NewFileForm extends React.Component {
{...domOnlyProps(name)}
ref={(element) => { this.fileName = element; }}
/>
<input type="submit" value="Add File" aria-label="add file" />
<Button
type="submit"
>Add File
</Button>
</div>
{name.touched && name.error && <span className="form-error">{name.error}</span>}
</form>

View File

@ -2,6 +2,8 @@ import PropTypes from 'prop-types';
import React from 'react';
import { domOnlyProps } from '../../../utils/reduxFormUtils';
import Button from '../../../common/Button';
class NewFolderForm extends React.Component {
constructor(props) {
super(props);
@ -34,7 +36,10 @@ class NewFolderForm extends React.Component {
ref={(element) => { this.fileName = element; }}
{...domOnlyProps(name)}
/>
<input type="submit" value="Add Folder" aria-label="add folder" />
<Button
type="submit"
>Add Folder
</Button>
</div>
{name.touched && name.error && <span className="form-error">{name.error}</span>}
</form>