drop documents page (now it is a regular page)
This commit is contained in:
1 parent
55f44fab8c
commit
263f18a1df
5 files changed
+1
-182
No files matched your search
@@ -1,22 +0,0 @@
|
||||
import * as React from 'react'
|
||||
import { IDocument } from '../../types'
|
||||
import { DocumentListItem } from '../DocumentListItem'
|
||||
|
||||
export interface IDocumentListProps {
|
||||
documents: IDocument[]
|
||||
name: string
|
||||
}
|
||||
|
||||
export const DocumentList: React.FC<IDocumentListProps> = props => (
|
||||
<div className="documents-container">
|
||||
<div className="documents-container__head">
|
||||
<h2>{props.name}</h2>
|
||||
</div>
|
||||
|
||||
<div className="documents-container__body">
|
||||
{props.documents.map((d, i) => (
|
||||
<DocumentListItem key={i} {...d} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
+1
-1
@@ -20,7 +20,7 @@ export interface IPage {
|
||||
}
|
||||
|
||||
export interface IDocument {
|
||||
category: string
|
||||
// category: string
|
||||
fileName: string
|
||||
fileSize: number
|
||||
fileUrl: string
|
||||
|
||||
@@ -36,26 +36,6 @@ export function choise(scope, selector) {
|
||||
return scope.reduce(selector, null);
|
||||
}
|
||||
|
||||
export function unique<T, U>(fn: (value: T) => U): (list: T[]) => U[] {
|
||||
return list => Array.from(
|
||||
new Set(list.map(fn))
|
||||
)
|
||||
}
|
||||
|
||||
export function branch(fn) {
|
||||
let keys = unique(fn);
|
||||
|
||||
return list => keys(list)
|
||||
.reduce((dict: any, key: any) => {
|
||||
dict[key] = list.filter(
|
||||
i => fn(i) === key
|
||||
);
|
||||
|
||||
return dict;
|
||||
}, {})
|
||||
|
||||
}
|
||||
|
||||
export function assign(dict, key, value) {
|
||||
dict[key] = value;
|
||||
return dict;
|
||||
|
||||
Reference in new issue
Block a user