Immutable timeline
Summary: Removes the "Set current" button if the timeline isn't editable Note that the styling does weird stuff to colors when a field is set as not editable Differential Revision: D24419006 fbshipit-source-id: 84dcee2e04d5ed7ebb3dc0255e99d1756f195284
This commit is contained in:
committed by
Facebook GitHub Bot
parent
38ef16aeeb
commit
d733f8131f
@@ -572,6 +572,7 @@ class DataDescriptionContainer extends PureComponent<{
|
||||
return (
|
||||
<>
|
||||
<TimelineDataDescription
|
||||
canSetCurrent={editable}
|
||||
timeline={JSON.parse(val)}
|
||||
onClick={(id) => {
|
||||
this.props.commit({
|
||||
|
||||
@@ -28,6 +28,7 @@ type Timeline = {
|
||||
};
|
||||
|
||||
type Props = {
|
||||
canSetCurrent?: boolean;
|
||||
timeline: Timeline;
|
||||
onClick: (selected: string) => void;
|
||||
};
|
||||
@@ -55,6 +56,7 @@ export default class TimelineDataDescription extends Component<Props, State> {
|
||||
}));
|
||||
return (
|
||||
<>
|
||||
{this.props.canSetCurrent && (
|
||||
<div>
|
||||
<Button
|
||||
onClick={() => this.props.onClick(this.state.selected)}
|
||||
@@ -62,6 +64,7 @@ export default class TimelineDataDescription extends Component<Props, State> {
|
||||
Set as current
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
<div>
|
||||
<MarkerTimeline
|
||||
points={points}
|
||||
|
||||
Reference in New Issue
Block a user