) => {
let value = e.target.value
value = value.replace(/\s/g, "");
setUserName(value)
}
+ useEffect(() => {
+ const onPageLoad = () => {
+ setIsLoadingSuccess(true);
+ };
+ if (document.readyState === 'complete') {
+ onPageLoad();
+ } else {
+ window.addEventListener('load', onPageLoad, false);
+ return () => window.removeEventListener('load', onPageLoad);
+ }
+ }, []);
const onClickJoin = () => {
if (!userName) {
- message.error("please input user name")
+ message.error("please enter a user name")
return
}
const userId = getRandomUserId()
@@ -45,11 +58,20 @@ const LoginCard = () => {
router.push("/home")
}
-
return
-
-
+ {
+ if (e.key === 'Enter' || e.key === ' ') {
+ onClickGithub();
+ }
+ }}
+ role="button"
+ tabIndex={0}
+ >
+
GitHub
@@ -59,19 +81,28 @@ const LoginCard = () => {
The World's First Multimodal AI Agent with the OpenAI Realtime API (Beta)
-
+
-
-
Join
+
{
+ if (e.key === 'Enter' || e.key === ' ') {
+ onClickJoin();
+ }
+ }}
+ role="button"
+ tabIndex={0}
+ >
+
+ {isLoadingSuccess ? "Join" :
Loading
}
+
Version {version}
-
-
- return
}
export default LoginCard
diff --git a/demo/src/platform/pc/description/index.tsx b/demo/src/platform/pc/description/index.tsx
index 45633da7..b95f4658 100644
--- a/demo/src/platform/pc/description/index.tsx
+++ b/demo/src/platform/pc/description/index.tsx
@@ -88,10 +88,10 @@ const Description = () => {
return
Description
The World's First Multimodal AI Agent with the OpenAI Realtime API (Beta)
-
+
{!agentConnected ? "Connect" : "Disconnect"}
- {loading ? : null}
+ {loading ? : null}