Home
}
diff --git a/client/src/components/Homepage.js b/client/src/components/Homepage.js
index f83605f..b93f920 100644
--- a/client/src/components/Homepage.js
+++ b/client/src/components/Homepage.js
@@ -1,5 +1,6 @@
import React, { useState } from 'react'
import { Link } from 'react-router-dom'
+import randomCodeGenerator from '../utils/randomCodeGenerator'
const Homepage = () => {
const [roomCode, setRoomCode] = useState('')
@@ -7,8 +8,10 @@ const Homepage = () => {
return (
UNO
-
setRoomCode(event.target.value)} />
-
+
setRoomCode(event.target.value)} />
+
+
OR
+
)
}
diff --git a/client/src/utils/randomCodeGenerator.js b/client/src/utils/randomCodeGenerator.js
new file mode 100644
index 0000000..3304fc3
--- /dev/null
+++ b/client/src/utils/randomCodeGenerator.js
@@ -0,0 +1,9 @@
+export default function makeid(length) {
+ var result = '';
+ var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
+ var charactersLength = characters.length;
+ for ( var i = 0; i < length; i++ ) {
+ result += characters.charAt(Math.floor(Math.random() * charactersLength));
+ }
+ return result;
+}
\ No newline at end of file