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" ;
2
2
import styled , { css } from "styled-components" ;
3
3
import { landscapeStyle } from "styles/landscapeStyle" ;
4
4
import { CompactPagination } from "@kleros/ui-components-library" ;
5
5
import { Overlay } from "components/Overlay" ;
6
6
import BookOpenIcon from "tsx:assets/svgs/icons/book-open.svg" ;
7
+ import { useFocusOutside } from "hooks/useFocusOutside" ;
7
8
8
9
const Container = styled . div `
9
10
display: flex;
@@ -123,10 +124,14 @@ const Template: React.FC<ITemplate> = ({
123
124
setCurrentPage,
124
125
numPages,
125
126
} ) => {
127
+ const containerRef = useRef ( null ) ;
128
+ useFocusOutside ( containerRef , ( ) => {
129
+ onClose ( ) ;
130
+ } ) ;
126
131
return (
127
132
< >
128
133
< Overlay />
129
- < Container >
134
+ < Container ref = { containerRef } >
130
135
< LeftContainer >
131
136
< HowItWorks >
132
137
< BookOpenIcon />
You can’t perform that action at this time.
0 commit comments