Skip to content

Commit 6c5d1e7

Browse files
committed
GeoSankey: persist fullscreen in fs URL param for iframe embeds
1 parent 19605ff commit 6c5d1e7

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

www/src/components/GeoSankey.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,10 @@ function GeoSankeyInner({ data }: Props) {
755755
'24hr': '24hr',
756756
}
757757

758-
const [fullscreen, setFullscreen] = useState(false)
758+
const [fullscreen, setFullscreen] = useUrlState('fs', {
759+
encode: (v: boolean) => v ? '1' : undefined,
760+
decode: (s: string | undefined) => s === '1',
761+
})
759762
const mapFocusedRef = useRef(false)
760763
const [mapFocused, setMapFocused] = useState(false)
761764
const mapContainerRef = useRef<HTMLDivElement>(null)

0 commit comments

Comments
 (0)