mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-12 21:38:35 +03:00
rethink narrative adjust placement; add close
This commit is contained in:
@@ -9,7 +9,7 @@ export default ({ isDisabled, direction, onClickHandler }) => {
|
||||
<i
|
||||
className={`material-icons ${isDisabled ? 'disabled' : ''}`}
|
||||
>
|
||||
chevron_{direction}
|
||||
{`chevron_${direction}`}
|
||||
</i>
|
||||
</div>
|
||||
)
|
||||
|
||||
17
src/components/presentational/NarrativeClose.js
Normal file
17
src/components/presentational/NarrativeClose.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import React from 'react'
|
||||
|
||||
export default ({ onClickHandler, closeMsg }) => {
|
||||
return (
|
||||
<div
|
||||
className='narrative-close'
|
||||
onClick={onClickHandler}
|
||||
>
|
||||
<button
|
||||
className='side-menu-burg is-active'
|
||||
>
|
||||
<span></span>
|
||||
</button>
|
||||
<div className='close-text'>{closeMsg}</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1,36 +1,9 @@
|
||||
import React from 'react'
|
||||
import NarrativeCard from './NarrativeCard'
|
||||
import NarrativeAdjust from './NarrativeAdjust'
|
||||
import NarrativeClose from './NarrativeClose'
|
||||
|
||||
export default ({ narrative, methods }) => {
|
||||
// function renderClose() {
|
||||
// return (
|
||||
// <button
|
||||
// className='side-menu-burg is-active'
|
||||
// onClick={() => { onSelectNarrative(null) }}
|
||||
// >
|
||||
// <span></span>
|
||||
// </button>
|
||||
// )
|
||||
// }
|
||||
|
||||
// function _renderActions(current, steps) {
|
||||
// const prevExists = current !== 0
|
||||
// const nextExists = current < steps.length - 1
|
||||
// return (
|
||||
// <div className='actions'>
|
||||
// <div
|
||||
// className={`${prevExists ? '' : 'disabled'} action`}
|
||||
// onClick={prevExists ? onPrev : null}>←
|
||||
// </div>
|
||||
// <div
|
||||
// className={`${nextExists ? '' : 'disabled'} action`}
|
||||
// onClick={nextExists ? onNext : null}>→
|
||||
// </div>
|
||||
// </div>
|
||||
// )
|
||||
// }
|
||||
|
||||
if (!narrative) return null
|
||||
|
||||
const { current, steps } = narrative
|
||||
@@ -50,6 +23,10 @@ export default ({ narrative, methods }) => {
|
||||
direction='right'
|
||||
onClickHandler={methods.onNext}
|
||||
/>
|
||||
<NarrativeClose
|
||||
onClickHandler={() => methods.onSelectNarrative(null)}
|
||||
closeMsg='-- exit from narrative --'
|
||||
/>
|
||||
</React.Fragment>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user