Skip to content

Commit

Permalink
Use an unordered list for the FileList since it's more semantic then …
Browse files Browse the repository at this point in the history
…nested <section> tags
  • Loading branch information
roblevintennis committed Aug 20, 2019
1 parent e4404e6 commit 07b8b2f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
5 changes: 5 additions & 0 deletions src/components/file-picker/file-picker.css
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@
flex-direction: column;
}

.file-ul {
margin: 0;
padding: 0;
}

.file-list-button {
display: flex;
flex-direction: row;
Expand Down
19 changes: 10 additions & 9 deletions src/components/file-picker/file-picker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,16 @@ const FilePicker = (props) => {

const getFilesList = () => {
if (files.length) {
return files.map((file) => {
return (
<section className={styles['file-list-button']} key={file.name}>
<Icon className={styles.icon} name={iconFileDefault.id} size="medium" stroke="grey-base" fill="none" title="Upload file icon" />
<span className={styles.filename}>{file.name}</span>
<button onClick={e => onRemoveFile(e, file)} className={styles.remove}>&times;</button>
</section>
);
});
const listItems = files.map((file) =>
<li className={styles['file-list-button']} key={file.name}>
<Icon className={styles.icon} name={iconFileDefault.id} size="medium" stroke="grey-base" fill="none" title="Upload file icon" />
<span className={styles.filename}>{file.name}</span>
<button onClick={e => onRemoveFile(e, file)} className={styles.remove}>&times;</button>
</li>
);
return (
<ul className={styles['file-ul']}>{listItems}</ul>
);
}
return '';
};
Expand Down

0 comments on commit 07b8b2f

Please sign in to comment.