show errors if file name is invalid

This commit is contained in:
Cassie Tarakajian 2016-10-19 17:09:31 -04:00
parent 32d45ea332
commit ef7d121927
2 changed files with 6 additions and 0 deletions

View file

@ -24,6 +24,7 @@ class NewFileForm extends React.Component {
{...name} {...name}
/> />
<input type="submit" value="Add File" aria-label="add file" /> <input type="submit" value="Add File" aria-label="add file" />
{name.touched && name.error && <span className="form-error">{name.error}</span>}
</form> </form>
); );
} }

View file

@ -32,6 +32,11 @@
margin-bottom: #{20 / $base-font-size}rem; margin-bottom: #{20 / $base-font-size}rem;
} }
.new-file-form, .new-file-folder {
display: flex;
flex-wrap: wrap;
}
.new-file-form__name-label, .new-folder-form__name-label { .new-file-form__name-label, .new-folder-form__name-label {
@extend %hidden-element; @extend %hidden-element;
} }