Design Updates for the History Component
This commit is contained in:
Родитель
e273b1dd4e
Коммит
8a06c4cda2
|
@ -170,6 +170,7 @@ export default class EditBookmark extends React.Component<EditBookmarkProps> {
|
||||||
highlight={selectedDepth}
|
highlight={selectedDepth}
|
||||||
leadIn={numLeadInStates}
|
leadIn={numLeadInStates}
|
||||||
active={active}
|
active={active}
|
||||||
|
style={{ height: 8 }}
|
||||||
onIndexClicked={(idx: number) =>
|
onIndexClicked={(idx: number) =>
|
||||||
onDiscoveryTrailIndexClicked(idx)
|
onDiscoveryTrailIndexClicked(idx)
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,9 +15,13 @@ export default function calculateSpans(
|
||||||
if (isNumber(leadIn) && leadIn !== 0) {
|
if (isNumber(leadIn) && leadIn !== 0) {
|
||||||
spans = insertSpan(spans, new Span(depth - leadIn, depth + 1, 'leadin'))
|
spans = insertSpan(spans, new Span(depth - leadIn, depth + 1, 'leadin'))
|
||||||
}
|
}
|
||||||
if (isNumber(highlight)) {
|
if (active && depth > 1) {
|
||||||
const type = active ? 'highlighted' : 'highlightedInactive'
|
const type = active ? 'highlighted' : 'highlightedInactive'
|
||||||
spans = insertSpan(spans, new Span(highlight, highlight + 1, type))
|
const highlightDepth = highlight || depth
|
||||||
|
spans = insertSpan(
|
||||||
|
spans,
|
||||||
|
new Span(highlightDepth, highlightDepth + 1, type),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
return spans
|
return spans
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,6 +47,8 @@ export interface DiscoveryTrailProps {
|
||||||
* If not full width, renders curved ends
|
* If not full width, renders curved ends
|
||||||
*/
|
*/
|
||||||
fullWidth?: boolean
|
fullWidth?: boolean
|
||||||
|
|
||||||
|
style?: React.CSSProperties
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class DiscoveryTrail extends React.Component<
|
export default class DiscoveryTrail extends React.Component<
|
||||||
|
@ -99,6 +101,7 @@ export default class DiscoveryTrail extends React.Component<
|
||||||
highlight,
|
highlight,
|
||||||
leadIn,
|
leadIn,
|
||||||
active,
|
active,
|
||||||
|
style,
|
||||||
bookmark: isBookmark,
|
bookmark: isBookmark,
|
||||||
fullWidth: isFullWidth,
|
fullWidth: isFullWidth,
|
||||||
} = this.props
|
} = this.props
|
||||||
|
@ -118,6 +121,7 @@ export default class DiscoveryTrail extends React.Component<
|
||||||
return (
|
return (
|
||||||
<Pager
|
<Pager
|
||||||
className={this.pagerClass}
|
className={this.pagerClass}
|
||||||
|
style={style}
|
||||||
onClick={e => this.handleClick(e)}
|
onClick={e => this.handleClick(e)}
|
||||||
innerRef={(e: HTMLDivElement) => (this.containerDiv = e)}
|
innerRef={(e: HTMLDivElement) => (this.containerDiv = e)}
|
||||||
>
|
>
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
import * as react from 'react'
|
import * as react from 'react'
|
||||||
import styled, { StyledComponentClass } from 'styled-components'
|
import styled, { StyledComponentClass } from 'styled-components'
|
||||||
|
|
||||||
const minPagerWidth = '6px'
|
const minPagerWidth = '3px'
|
||||||
const emptyStateColor = 'white'
|
const emptyStateColor = 'white'
|
||||||
const highlightedStateInactiveBookmarkColor = '#ABEBC6'
|
const highlightedStateInactiveBookmarkColor = 'white'
|
||||||
const highlightedStateColor = '#2ECC71'
|
const highlightedStateColor = '#bbf0d1'
|
||||||
const leadInStateColor = '#ABEBC6'
|
const leadInStateColor = '#dbf7e7'
|
||||||
const emptyBookmarkColor = 'white'
|
const emptyBookmarkColor = 'white'
|
||||||
const highlightedBookmarkInactiveBookmarkColor = '#ebc6ab'
|
const highlightedBookmarkInactiveBookmarkColor = '#ebc6ab'
|
||||||
const highlightedBookmarkColor = '#f93'
|
const highlightedBookmarkColor = '#555'
|
||||||
const leadInBookmarkColor = '#f5e2d4'
|
const leadInBookmarkColor = '#f5e2d4'
|
||||||
const statePagerBorderColor = '1px solid #cbcbcb'
|
const statePagerBorderColor = 'none'
|
||||||
|
|
||||||
export const PagerState = styled.div``
|
export const PagerState = styled.div``
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче