File tree Expand file tree Collapse file tree 7 files changed +18
-3
lines changed Expand file tree Collapse file tree 7 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ const Appeal: React.FC<IAppeal> = ({ toggleMiniGuide }) => {
8282 numPages = { leftPageContents . length }
8383 isOnboarding = { false }
8484 canClose = { true }
85+ isVisible = { true }
8586 />
8687 ) ;
8788} ;
Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ const BinaryVoting: React.FC<IBinaryVoting> = ({ toggleMiniGuide }) => {
6363 numPages = { leftPageContents . length }
6464 isOnboarding = { false }
6565 canClose = { true }
66+ isVisible = { true }
6667 />
6768 ) ;
6869} ;
Original file line number Diff line number Diff line change @@ -134,6 +134,7 @@ const JurorLevels: React.FC<IJurorLevels> = ({ toggleMiniGuide }) => {
134134 numPages = { leftPageContents . length }
135135 isOnboarding = { false }
136136 canClose = { true }
137+ isVisible = { true }
137138 />
138139 ) ;
139140} ;
Original file line number Diff line number Diff line change @@ -95,6 +95,13 @@ const Onboarding: React.FC<IOnboarding> = ({ toggleIsOnboardingMiniGuidesOpen })
9595 const [ isAppealMiniGuideOpen , toggleAppealMiniGuide ] = useToggle ( false ) ;
9696 const [ isJurorLevelsMiniGuideOpen , toggleJurorLevelsMiniGuide ] = useToggle ( false ) ;
9797
98+ const isAnyMiniGuideOpen =
99+ isStakingMiniGuideOpen ||
100+ isBinaryVotingMiniGuideOpen ||
101+ isRankedVotingMiniGuideOpen ||
102+ isAppealMiniGuideOpen ||
103+ isJurorLevelsMiniGuideOpen ;
104+
98105 const canCloseOnboarding =
99106 ! isStakingMiniGuideOpen &&
100107 ! isBinaryVotingMiniGuideOpen &&
@@ -127,6 +134,7 @@ const Onboarding: React.FC<IOnboarding> = ({ toggleIsOnboardingMiniGuidesOpen })
127134 numPages = { leftPageContents . length }
128135 isOnboarding = { true }
129136 canClose = { canCloseOnboarding }
137+ isVisible = { ! isAnyMiniGuideOpen }
130138 />
131139
132140 { isStakingMiniGuideOpen && < Staking toggleMiniGuide = { toggleStakingMiniGuide } /> }
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ const RankedVoting: React.FC<IRankedVoting> = ({ toggleMiniGuide }) => {
6565 numPages = { leftPageContents . length }
6666 isOnboarding = { false }
6767 canClose = { true }
68+ isVisible = { true }
6869 />
6970 ) ;
7071} ;
Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ const Staking: React.FC<IStaking> = ({ toggleMiniGuide }) => {
8888 numPages = { leftPageContents . length }
8989 isOnboarding = { false }
9090 canClose = { true }
91+ isVisible = { true }
9192 />
9293 ) ;
9394} ;
Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ import { Overlay } from "components/Overlay";
66import BookOpenIcon from "tsx:assets/svgs/icons/book-open.svg" ;
77import { useFocusOutside } from "hooks/useFocusOutside" ;
88
9- const Container = styled . div `
10- display: flex;
9+ const Container = styled . div < { isVisible : boolean } > `
10+ display: ${ ( { isVisible } ) => ( isVisible ? " flex" : "none" ) } ;
1111 margin: 0 auto;
1212 width: auto;
1313 z-index: 10;
@@ -161,6 +161,7 @@ interface ITemplate {
161161 numPages : number ;
162162 isOnboarding : boolean ;
163163 canClose : boolean ;
164+ isVisible : boolean ;
164165}
165166
166167const Template : React . FC < ITemplate > = ( {
@@ -172,6 +173,7 @@ const Template: React.FC<ITemplate> = ({
172173 numPages,
173174 isOnboarding,
174175 canClose,
176+ isVisible,
175177} ) => {
176178 const containerRef = useRef ( null ) ;
177179 useFocusOutside ( containerRef , ( ) => {
@@ -182,7 +184,7 @@ const Template: React.FC<ITemplate> = ({
182184 return (
183185 < >
184186 < Overlay />
185- < Container ref = { containerRef } >
187+ < Container ref = { containerRef } isVisible = { isVisible } >
186188 < LeftContainer >
187189 < LeftContainerHeader >
188190 < HowItWorks >
You can’t perform that action at this time.
0 commit comments