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

View file

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