Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Commit

Permalink
Timeline AllTime toggle & Bar Interaction (#185)
Browse files Browse the repository at this point in the history
* reset allTime when switching explore/presentation mode

* disable allTime toggle when in a presentation item

* disable bar click when in presentation item
  • Loading branch information
sharplessHQ authored Sep 20, 2023
1 parent db2d4ab commit 269e923
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions applications/client/src/views/Campaign/Explore/Explore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ export const Explore = observer<InfoProps>(({ ...props }) => {
}
});

useEffect(() => {
if (store.campaign.timeline.endTime) {
store.campaign.timeline.setScrubberTimeAny(store.campaign.timeline.endTime);
store.campaign.timeline.showAllTime();
}
}, [store.router.params.presentation]);

useEffect(
() =>
autorun(() => {
Expand Down
4 changes: 3 additions & 1 deletion applications/client/src/views/Campaign/Timeline/Bars.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ export const Bars = observer<BarsProps>(({ xScale, bars, start, end, dimensions,
ref={ref}
{...(targetProps as any)} // :(
onMouseDown={() => {
store.campaign?.timeline.setScrubberTimeAny(bar.end);
if (!store.router.params.presentation) {
store.campaign?.timeline.setScrubberTimeAny(bar.end);
}
}}
>
{bar.beaconCount && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export const Timeline = observer<TimelineProps>(({ ...props }) => {
label="All Time"
alignIndicator="right"
css={timeSwitchStyles}
disabled={store.router.params.view === CampaignViews.PRESENTATION}
disabled={!!store.router.params.presentation}
checked={store.campaign.timeline.isShowingAllTime}
onChange={() =>
store.campaign.timeline.isShowingAllTime
Expand Down

0 comments on commit 269e923

Please sign in to comment.