Skip to content

Commit

Permalink
Merge 43acc14 into 335acea
Browse files Browse the repository at this point in the history
  • Loading branch information
BenGamma authored Nov 24, 2019
2 parents 335acea + 43acc14 commit b20ed73
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/components/FileInfo/FileInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { availableGlyphs } from '../Icons'
import { bytesToSize } from '../ImageInput/ImageInput'
import { IUploadedFileMeta } from 'src/stores/storage'
import { FileDetails } from './FileDetails'
import styled from 'styled-components'

interface IProps {
file: File | IUploadedFileMeta | null
Expand All @@ -13,6 +14,10 @@ interface IState {
size: string
}

const FileContainer = styled.a`
width: 300px;
`

export class FileInfo extends React.Component<IProps, IState> {
constructor(props: IProps) {
super(props)
Expand Down Expand Up @@ -46,9 +51,13 @@ export class FileInfo extends React.Component<IProps, IState> {
return (
<>
{allowDownload && meta.downloadUrl ? (
<a href={meta.downloadUrl} target="_blank" download={file.name}>
<FileContainer
href={meta.downloadUrl}
target="_blank"
download={file.name}
>
<FileDetails file={file} glyph={glyph} size={size} />
</a>
</FileContainer>
) : (
<FileDetails file={file} glyph={glyph} size={size} />
)}
Expand Down

0 comments on commit b20ed73

Please sign in to comment.