components uses css modules; other refactoring
This commit is contained in:
1 parent
0cd61e0ed9
commit
d65aba19a0
28 files changed
+137
-94
No files matched your search
@@ -1,27 +1,27 @@
|
||||
import './styles.css'
|
||||
import s from './styles.module.css'
|
||||
|
||||
import { FileDefinition } from 'src/types'
|
||||
import { ext, size } from 'src/lib/file'
|
||||
import { titleCase } from 'src/lib/string'
|
||||
|
||||
export const File: React.SFC<FileDefinition> = props => (
|
||||
<div className={'file'}>
|
||||
<h1>{titleCase(props.name)}</h1>
|
||||
export type FileProps = FileDefinition & {
|
||||
style?: React.CSSProperties
|
||||
}
|
||||
|
||||
export const File: React.SFC<FileProps> = props => (
|
||||
<div className={s.file} style={props.style}>
|
||||
{!props.cover?.src ? null : (
|
||||
<div className={'file__image'}>
|
||||
<div className={s.image}>
|
||||
<a href={props.file.src} target="_blank" className="invisible">
|
||||
<img src={props.cover.src} alt={props.name} />
|
||||
</a>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className={'file__file'}>
|
||||
<span>{titleCase(props.name)}</span>
|
||||
</div>
|
||||
|
||||
<div className={'file__file-info'}>
|
||||
<a href={props.file.src} target="_blank">{ext(props.file.name)} ({size(props.file.size)})</a>
|
||||
<div className={s.info}>
|
||||
<span>{props.name}</span>
|
||||
<a href={props.file.src} target="_blank">
|
||||
{ext(props.file.type)} ({size(props.file.size)})
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
Reference in new issue
Block a user