2017-11-14 00:49:29 +00:00
|
|
|
import React from 'react'
|
|
|
|
|
2017-12-09 18:05:18 +00:00
|
|
|
export const ReaderEditButton = ({onClick}) =>
|
|
|
|
<div className='edit_note_button'>
|
2017-12-10 17:58:25 +00:00
|
|
|
<button onClick={onClick} className='btn btn-outline-primary btn-sm'>
|
2017-12-09 18:05:18 +00:00
|
|
|
Edit
|
2017-12-10 17:58:25 +00:00
|
|
|
<i className='fa fa_inline fa-edit'></i>
|
2017-11-14 00:49:29 +00:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
|
2017-12-09 18:05:18 +00:00
|
|
|
export const ReaderAnnotateButton = ({onClick}) =>
|
|
|
|
<div className='annotate_note_button'>
|
2017-12-10 17:58:25 +00:00
|
|
|
<button onClick={onClick} className='btn btn-outline-primary btn-sm'>
|
2017-12-09 18:05:18 +00:00
|
|
|
Annotate
|
2017-12-10 17:58:25 +00:00
|
|
|
<i className='fa fa_inline fa-link'></i>
|
2017-12-09 18:05:18 +00:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
|
2017-11-29 04:44:15 +00:00
|
|
|
export const ChapterButton = ({chapter, currentChapter, onClick}) =>
|
2017-11-14 00:49:29 +00:00
|
|
|
<div className ='chapter_button text-center'>
|
2017-11-29 04:44:15 +00:00
|
|
|
<button onClick={()=>onClick(chapter.id)} className={currentChapter.id === chapter.id ? 'btn btn-dark btn-lg' : 'btn btn-outline-dark btn-lg'}>
|
2017-11-22 03:52:32 +00:00
|
|
|
{chapter.title}
|
2017-11-14 00:49:29 +00:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
|
2017-12-08 02:08:07 +00:00
|
|
|
export const NoteButton = ({note, currentNote, onClick}) =>
|
|
|
|
<div className ='note_button'>
|
2017-12-11 03:19:59 +00:00
|
|
|
<button onClick={onClick} className={currentNote.id === note.id ? 'btn btn-warning' : 'btn btn-outline-warning'}>
|
2017-12-08 02:08:07 +00:00
|
|
|
{note.title}
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
|
2017-12-16 20:07:49 +00:00
|
|
|
export const HighlightButton = ({highlightToggle, onHighlightClick}) =>
|
2017-11-14 00:49:29 +00:00
|
|
|
<div>
|
2017-12-10 17:58:25 +00:00
|
|
|
<div id='highlight_button' className='text-center'>
|
2017-12-16 20:07:49 +00:00
|
|
|
<button onClick={onHighlightClick} className={highlightToggle ? 'btn btn-primary btn-lg' : 'btn btn-outline-primary btn-lg'}>
|
|
|
|
{highlightToggle ? 'Hide Notes' : 'Highlight Notes'}
|
2017-11-14 00:49:29 +00:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2017-12-16 20:00:20 +00:00
|
|
|
export const SearchButton = () =>
|
|
|
|
<div>
|
|
|
|
<div id='search_button' className='text-center'>
|
|
|
|
<button className='btn btn-primary btn-sm'>
|
|
|
|
Search <i className='fa fa_inline fa-search'></i>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2017-11-14 00:49:29 +00:00
|
|
|
export const NewChapterButton = ({onNewChapterClick}) =>
|
|
|
|
<div>
|
2017-12-10 17:58:25 +00:00
|
|
|
<div id='new_chapter_button' className='text-center'>
|
2017-11-14 00:49:29 +00:00
|
|
|
<button onClick={onNewChapterClick} className='btn btn-outline-success btn-lg'>
|
2017-12-10 17:58:25 +00:00
|
|
|
New Chapter <i className='fa fa_inline fa-plus-square-o'></i>
|
2017-11-14 00:49:29 +00:00
|
|
|
</button>
|
|
|
|
</div>
|
2017-11-26 14:47:19 +00:00
|
|
|
</div>
|
|
|
|
|
2017-12-11 03:19:59 +00:00
|
|
|
const documentName = docType => {
|
|
|
|
switch(docType) {
|
|
|
|
case 'chapters':
|
|
|
|
return 'Chapter'
|
|
|
|
break
|
|
|
|
case 'notes':
|
|
|
|
return 'Note'
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export const NewDocumentButton = ({onClick, docType}) =>
|
2017-12-09 23:00:19 +00:00
|
|
|
<div>
|
2017-12-11 03:19:59 +00:00
|
|
|
<div id='new_document_button' className='text-center'>
|
2017-12-10 17:58:25 +00:00
|
|
|
<button onClick={onClick} className='btn btn-outline-success btn-sm'>
|
2017-12-11 03:19:59 +00:00
|
|
|
New {documentName(docType)}
|
|
|
|
<i className='fa fa_inline fa-plus-square-o'></i>
|
2017-12-09 23:00:19 +00:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2017-12-10 18:17:14 +00:00
|
|
|
// Fairly abstracted
|
|
|
|
|
2017-12-10 23:22:38 +00:00
|
|
|
export const AnnotatorNewButton = ({onClick, disabled}) =>
|
|
|
|
<button type='button' onClick={onClick} disabled={disabled} className='btn btn-info btn-sm' data-toggle='modal' data-target='#annotate_modal'>
|
2017-12-10 18:17:14 +00:00
|
|
|
New Annotation
|
|
|
|
<i className='fa fa_inline fa-link'></i>
|
|
|
|
</button>
|
|
|
|
|
2017-12-12 03:47:52 +00:00
|
|
|
export const AnnotatorRemoveButton = ({onClick, disabled}) =>
|
|
|
|
<button type='button' onClick={onClick} disabled={disabled} className='btn btn-secondary btn-sm'>
|
2017-12-10 18:17:14 +00:00
|
|
|
Remove Annotation
|
|
|
|
<i className='fa fa_inline fa-unlink'></i>
|
|
|
|
</button>
|
|
|
|
|
|
|
|
export const EditorToolButton = ({glyph, onClick}) =>
|
2017-11-26 14:47:19 +00:00
|
|
|
<button type='button' onClick={onClick} className='btn btn-info btn-sm'>
|
|
|
|
<i className={'fa fa-' + glyph}></i>
|
|
|
|
</button>
|
|
|
|
|
2017-12-10 18:17:14 +00:00
|
|
|
|
2017-12-10 23:22:38 +00:00
|
|
|
export const EditorDeleteToolButton = ({disabled}) =>
|
|
|
|
<button className='btn btn-info btn-sm' disabled={disabled} data-toggle='modal' data-target='#delete_confirm_modal' type='button'>
|
2017-12-09 23:00:19 +00:00
|
|
|
Delete
|
|
|
|
<i className='fa fa_inline fa-trash-o'></i>
|
|
|
|
</button>
|
|
|
|
|
2017-12-09 18:05:18 +00:00
|
|
|
export const EditorCancelButton = ({onClick}) =>
|
2017-12-10 17:58:25 +00:00
|
|
|
<button type='button' onClick={onClick} className='btn btn-outline-secondary btn-sm' data-dismiss='modal'>
|
2017-12-09 18:05:18 +00:00
|
|
|
Cancel
|
2017-12-10 17:58:25 +00:00
|
|
|
<i className='fa fa_inline fa-times'></i>
|
2017-12-09 18:05:18 +00:00
|
|
|
</button>
|
|
|
|
|
2017-12-10 23:22:38 +00:00
|
|
|
export const EditorSubmitButton = ({onClick}) =>
|
|
|
|
<button id='editor_submit' onClick={onClick} type='button' data-dismiss='modal' className='btn btn-outline-success btn-sm'>
|
2017-11-26 14:47:19 +00:00
|
|
|
Submit
|
2017-12-09 23:00:19 +00:00
|
|
|
<i className='fa fa_inline fa-check-square-o'></i>
|
2017-11-26 14:47:19 +00:00
|
|
|
</button>
|
|
|
|
|
2017-12-09 23:00:19 +00:00
|
|
|
export const EditorDeleteButton = ({onClick}) =>
|
2017-12-10 17:58:25 +00:00
|
|
|
<button id='editor_delete' onClick={onClick} type='button' data-dismiss='modal' className='btn btn-outline-danger btn-sm'>
|
2017-11-26 14:47:19 +00:00
|
|
|
Delete
|
2017-12-09 23:00:19 +00:00
|
|
|
<i className='fa fa_inline fa-trash-o'></i>
|
2017-11-26 14:47:19 +00:00
|
|
|
</button>
|