Skip to content
Snippets Groups Projects
Commit a9ea10e8 authored by Alexandru Munteanu's avatar Alexandru Munteanu
Browse files

Move files into faraday-components

parent 038d94b6
No related branches found
No related tags found
No related merge requests found
Showing
with 18 additions and 16 deletions
export { default as Files } from './Files'
export { default as Wizard } from './Wizard'
export { default as Progress } from './Progress'
export { default as WizardPage } from './WizardPage'
......
......@@ -4,7 +4,6 @@ module.exports = {
reducers: {
wizardConversion: () => require('./redux/conversion').default,
autosave: () => require('./redux/autosave').default,
files: () => require('./redux/files').default,
},
},
}
export { default as files } from './files'
export { default as autosave } from './autosave'
export { default as conversion } from './conversion'
......@@ -21,7 +21,7 @@ import {
deleteFile,
getRequestStatus,
getSignedUrl,
} from '../redux/files'
} from '../../redux/files'
const Files = ({
files,
......
export { default as Files } from './Files'
......@@ -93,6 +93,7 @@ const DecoratedItem = compose(
const SortableList = ({
items,
itemKey = 'id',
moveItem,
listItem,
dragHandle,
......@@ -104,7 +105,7 @@ const SortableList = ({
<DecoratedItem
dragHandle={dragHandle}
index={i}
key={item.id}
key={item[itemKey]}
listItem={listItem}
moveItem={moveItem}
{...item}
......
......@@ -2,13 +2,15 @@ A sortable list implemented with `react-dnd`.
## Props
| Prop | Description | Required | Default |
| :--------: | :------------------------------------------------------------------------------------------------------------------------------------------: | :------: | :-------------------: |
| items | The items of the sortable list. | true | [] |
| listItem | A React component that will be rendered for each item of the list. Receives `isDragging`, `isOver` and all other props from the items array. | true | none |
| moveItem | Function to be called when moving an item through the list. SortableList will provide the dragIndex of hoverIndex of the items. | true | SortableList.moveItem |
| dragHandle | A React component for the drag handle. If not present, the whole item can be dragged. | false | none |
| dropItem | Function to be called when dropping an item. The index of the dragged item is passed. | false | none |
| Prop | Description | Required | Default | Type |
| :--------: | :------------------------------------------------------------------------------------------------------------------------------------------: | :------: | :-------------------: | :---: |
| items | The items of the sortable list. | true | [] | Array |
| itemKey | Value used for key when mapping over items. | true | 'id' | string |
| listItem | A React component that will be rendered for each item of the list. Receives `isDragging`, `isOver` and all other props from the items array. | true | none | React component |
| moveItem | Function to be called when moving an item through the list. SortableList will provide the dragIndex of hoverIndex of the items. | true | none | function |
| dragHandle | A React component for the drag handle. If not present, the whole item can be dragged. | false | none | React component |
| dropItem | Function to be called when dropping an item. The index of the dragged item is passed. | false | none | function |
| beginDragProps | Array of keys to pick from the dragged object when beginning drag. | false | [] | Array(string) |
## Usage
......
export { default as SortableList } from './SortableList/SortableList'
export { default as Files } from './Files/Files'
export { default as AuthorList } from './AuthorList/AuthorList'
export { default as SortableList } from './SortableList/SortableList'
export { Dropdown, Logo, Spinner } from './UIComponents'
export { DragHandle } from './AuthorList/FormItems'
export { Dropdown, Logo, Spinner } from './UIComponents'
......@@ -3,6 +3,7 @@ module.exports = {
components: [() => require('./components')],
reducers: {
authors: () => require('./redux/authors').default,
files: () => require('./redux/files').default,
filters: () => require('./components/Dashboard/redux/filters').default,
},
},
......
......@@ -3,8 +3,7 @@ import { AbstractEditor, TitleEditor } from 'xpub-edit'
import { Menu, CheckboxGroup, YesOrNo, TextField } from '@pubsweet/ui'
import uploadFileFn from 'xpub-upload'
import { required, minChars, minSize } from 'xpub-validators'
import { Files } from 'pubsweet-component-wizard/src/components/'
import { AuthorList } from 'pubsweet-components-faraday/src/components'
import { AuthorList, Files } from 'pubsweet-components-faraday/src/components'
import { declarations } from './'
import issueTypes from './issues-types'
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment