File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1- import React , { Dispatch , SetStateAction } from "react" ;
1+ import React , { Dispatch , SetStateAction , useRef } from "react" ;
22import styled , { css } from "styled-components" ;
33import { landscapeStyle } from "styles/landscapeStyle" ;
44import { CompactPagination } from "@kleros/ui-components-library" ;
55import { Overlay } from "components/Overlay" ;
66import BookOpenIcon from "tsx:assets/svgs/icons/book-open.svg" ;
7+ import { useFocusOutside } from "hooks/useFocusOutside" ;
78
89const Container = styled . div `
910 display: flex;
@@ -123,10 +124,14 @@ const Template: React.FC<ITemplate> = ({
123124 setCurrentPage,
124125 numPages,
125126} ) => {
127+ const containerRef = useRef ( null ) ;
128+ useFocusOutside ( containerRef , ( ) => {
129+ onClose ( ) ;
130+ } ) ;
126131 return (
127132 < >
128133 < Overlay />
129- < Container >
134+ < Container ref = { containerRef } >
130135 < LeftContainer >
131136 < HowItWorks >
132137 < BookOpenIcon />
You can’t perform that action at this time.
0 commit comments