From 1a34d2e78fe994e75662a0e83118435c5360791d Mon Sep 17 00:00:00 2001
From: michaelthorpe
Date: Fri, 10 Nov 2023 11:31:18 +0000
Subject: [PATCH] add accessibility features and list component in
documentation app
---
apps/docs/src/common/component-stories.ts | 3 +-
.../spec/TimeoutModal.stories.mdx | 30 +++++++++----------
components/timeout-modal/src/TimeoutModal.tsx | 4 +--
components/timeout-modal/src/Timer.tsx | 4 +--
4 files changed, 20 insertions(+), 21 deletions(-)
diff --git a/apps/docs/src/common/component-stories.ts b/apps/docs/src/common/component-stories.ts
index 01f0eae3..5e9f9d75 100644
--- a/apps/docs/src/common/component-stories.ts
+++ b/apps/docs/src/common/component-stories.ts
@@ -12,7 +12,8 @@ const storySources = [
require('../../../../components/timeline/spec/Timeline.stories.mdx'),
require('../../../../components/date-time/spec/DateTime.stories.mdx'),
require('../../../../components/date-display/spec/DateDisplay.stories.mdx'),
- require('../../../../components/time/spec/Time.stories.mdx')
+ require('../../../../components/time/spec/Time.stories.mdx'),
+ require('../../../../components/timeout-modal/spec/TimeoutModal.stories.mdx')
];
export const stories = storySources.reduce(reduceToLookup, {})
diff --git a/components/timeout-modal/spec/TimeoutModal.stories.mdx b/components/timeout-modal/spec/TimeoutModal.stories.mdx
index b256de41..e300e5e5 100644
--- a/components/timeout-modal/spec/TimeoutModal.stories.mdx
+++ b/components/timeout-modal/spec/TimeoutModal.stories.mdx
@@ -10,32 +10,30 @@ import readMe from '../README.md';
chromatic: { viewports: [640, 480] },
description: 'HODS timeout modal',
jest: ['TimeoutModal'],
- notes: readMe
+ notes: readMe,
+ docs: {
+ inlineStories: false,
+ iframeHeight: 500,
+ }
} }
/>
# timeout-modal
-HODS timeout modal
+HODS Timeout Modal
-
+
-
+ console.log("timed out")}
+ onContinue={() => console.log("continue")}
+ onSignout={() => console.log("sign out")}
+ />
-
-
-## Stories
-### Standard
-
-A standard timeout-modal.
-
-
-
-
-
-
diff --git a/components/timeout-modal/src/TimeoutModal.tsx b/components/timeout-modal/src/TimeoutModal.tsx
index 5693629b..76578127 100644
--- a/components/timeout-modal/src/TimeoutModal.tsx
+++ b/components/timeout-modal/src/TimeoutModal.tsx
@@ -53,8 +53,8 @@ export const TimeoutModal: FC = ({
To protect your information, you will be signed out in .
diff --git a/components/timeout-modal/src/Timer.tsx b/components/timeout-modal/src/Timer.tsx
index 755fa758..9efbefb5 100644
--- a/components/timeout-modal/src/Timer.tsx
+++ b/components/timeout-modal/src/Timer.tsx
@@ -15,7 +15,7 @@ export const Timer: FC = ({
}) => {
const [runTimer, setRunTimer] = useState(true)
const [timer, setTimer] = useState(timerFrom);
- let formattedTimer = timer < 60 ? Math.ceil(timer / 20) * 20 : Math.ceil(timer / 60);
+ let formattedTimer = timer < 61 ? Math.ceil(timer / 20) * 20 : Math.ceil(timer / 60);
const interval = useRef(null);
useEffect(() => {
@@ -26,7 +26,7 @@ export const Timer: FC = ({
if(runTimer && timer == 0) {
clearInterval(interval.current);
- onTimeout;
+ onTimeout();
}
return (