File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,7 +12,8 @@ const storySources = [
1212 require ( '../../../../components/timeline/spec/Timeline.stories.mdx' ) ,
1313 require ( '../../../../components/date-time/spec/DateTime.stories.mdx' ) ,
1414 require ( '../../../../components/date-display/spec/DateDisplay.stories.mdx' ) ,
15- require ( '../../../../components/time/spec/Time.stories.mdx' )
15+ require ( '../../../../components/time/spec/Time.stories.mdx' ) ,
16+ require ( '../../../../components/timeout-modal/spec/TimeoutModal.stories.mdx' )
1617] ;
1718export const stories = storySources . reduce ( reduceToLookup , { } )
1819
Original file line number Diff line number Diff line change @@ -10,32 +10,30 @@ import readMe from '../README.md';
1010 chromatic: { viewports: [640 , 480 ] },
1111 description: ' HODS timeout modal' ,
1212 jest: [' TimeoutModal' ],
13- notes: readMe
13+ notes: readMe ,
14+ docs: {
15+ inlineStories: false ,
16+ iframeHeight: 500 ,
17+ }
1418 } }
1519/>
1620
1721# timeout-modal
1822
19- HODS timeout modal
23+ HODS Timeout Modal
2024
2125<Preview withToolbar >
22- <Story name = " TimeoutModal " >
26+ <Story name = " 5 Minutes Timeout Modal " >
2327 <Page >
24- <TimeoutModal isOpen = { true } timerDurationInSeconds = { 300 } />
28+ <TimeoutModal
29+ isOpen = { true }
30+ timerDurationInSeconds = { 60 }
31+ onTimeout = { () => console .log (" timed out" )}
32+ onContinue = { () => console .log (" continue" )}
33+ onSignout = { () => console .log (" sign out" )}
34+ />
2535 </Page >
2636 </Story >
2737</Preview >
2838
2939<Props of = { TimeoutModal } />
30-
31-
32- ## Stories
33- ### Standard
34-
35- A standard timeout-modal.
36-
37- <Preview >
38- <Story name = " Standard" >
39- <TimeoutModal />
40- </Story >
41- </Preview >
Original file line number Diff line number Diff line change @@ -53,8 +53,8 @@ export const TimeoutModal: FC<TimeoutModalProps> = ({
5353 To protect your information, you will be signed out in < Timer className = { classes ( 'timer' ) } timerFrom = { isOpen ? timerDurationInSeconds : 0 } onTimeout = { onTimeout } /> .
5454 </ p >
5555 < div className = { classes ( 'buttons' ) } >
56- < button role = 'button' onClick = { onTimeout } > Continue on this page</ button >
57- < a role = 'link' onClick = { onSignout } > Sign out</ a >
56+ < button role = 'button' onClick = { onContinue } tabIndex = { 0 } > Continue on this page</ button >
57+ < a role = 'link' onClick = { onSignout } tabIndex = { 1 } > Sign out</ a >
5858 </ div >
5959 </ dialog >
6060 </ div >
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export const Timer: FC<TimerProps> = ({
1515} ) => {
1616 const [ runTimer , setRunTimer ] = useState ( true )
1717 const [ timer , setTimer ] = useState ( timerFrom ) ;
18- let formattedTimer = timer < 60 ? Math . ceil ( timer / 20 ) * 20 : Math . ceil ( timer / 60 ) ;
18+ let formattedTimer = timer < 61 ? Math . ceil ( timer / 20 ) * 20 : Math . ceil ( timer / 60 ) ;
1919 const interval = useRef ( null ) ;
2020
2121 useEffect ( ( ) => {
@@ -26,7 +26,7 @@ export const Timer: FC<TimerProps> = ({
2626
2727 if ( runTimer && timer == 0 ) {
2828 clearInterval ( interval . current ) ;
29- onTimeout ;
29+ onTimeout ( ) ;
3030 }
3131
3232 return (
You can’t perform that action at this time.
0 commit comments