Skip to content

Commit

Permalink
[form-builder] Improve FileInput uploaded state
Browse files Browse the repository at this point in the history
  • Loading branch information
mikolajdobrucki authored and rexxars committed Oct 6, 2020
1 parent 7b514e4 commit 554c0cb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import Snackbar from 'part:@sanity/components/snackbar/default'
import {Path} from '../../typedefs/path'
import {Observable} from 'rxjs'
import ButtonGrid from 'part:@sanity/components/buttons/button-grid'
import AnchorButton from 'part:@sanity/components/buttons/anchor'

type FieldT = {
name: string
Expand Down Expand Up @@ -168,10 +169,12 @@ export default class FileInput extends React.PureComponent<Props, FileInputState
<FileIcon />
</div>
<div>
{assetDocument.originalFilename}{' '}
<a href={`${assetDocument.url}?dl`} download>
<div className={styles.fileLabel}>
{assetDocument.originalFilename}{' '}
</div>
<AnchorButton href={`${assetDocument.url}?dl`} inverted size="small">
Download
</a>
</AnchorButton>
</div>
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,12 @@
.fileIcon {
font-size: 3em;
margin-right: var(--medium-padding);
display: flex;
align-items: center;
}

.fileLabel {
font-size: var(--font-size-small);
font-weight: 600;
margin-bottom: var(--small-padding);
}

0 comments on commit 554c0cb

Please sign in to comment.