Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SceneTimePicker: Add missing props #977

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/scenes/src/components/SceneTimePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { SceneComponentProps, SceneObjectState } from '../core/types';
export interface SceneTimePickerState extends SceneObjectState {
hidePicker?: boolean;
isOnCanvas?: boolean;
timeSyncButton?: React.JSX.Element;
isSynced?: boolean;
}

export class SceneTimePicker extends SceneObjectBase<SceneTimePickerState> {
Expand Down Expand Up @@ -56,7 +58,7 @@ export class SceneTimePicker extends SceneObjectBase<SceneTimePickerState> {
}

function SceneTimePickerRenderer({ model }: SceneComponentProps<SceneTimePicker>) {
const { hidePicker, isOnCanvas } = model.useState();
const { hidePicker, isOnCanvas, timeSyncButton, isSynced } = model.useState();
const timeRange = sceneGraph.getTimeRange(model);
const timeZone = timeRange.getTimeZone();
const timeRangeState = timeRange.useState();
Expand Down Expand Up @@ -91,6 +93,8 @@ function SceneTimePickerRenderer({ model }: SceneComponentProps<SceneTimePicker>
// @ts-ignore TODO remove after grafana/ui update to 11.2.0
weekStart={timeRangeState.weekStart}
history={timeRangeHistory}
timeSyncButton={timeSyncButton}
isSynced={isSynced}
/>
);
}
Expand Down