From e8177e1f3206ee35d334478a116e23dfd89e2e28 Mon Sep 17 00:00:00 2001 From: Denis Thiessen Date: Sun, 26 May 2024 17:07:22 +0200 Subject: [PATCH] feat: Added random ID component --- src/components/RandomIDComponent.jsx | 15 +++++++++++++++ src/pages/TestInfoPage.jsx | 2 ++ 2 files changed, 17 insertions(+) create mode 100644 src/components/RandomIDComponent.jsx diff --git a/src/components/RandomIDComponent.jsx b/src/components/RandomIDComponent.jsx new file mode 100644 index 0000000..95d3dc8 --- /dev/null +++ b/src/components/RandomIDComponent.jsx @@ -0,0 +1,15 @@ +import React from "react"; +import { getTranslation } from "../core/i18n/I18NHandler"; + +var randomId = 0; + +function RandomIDComponent() { + randomId = Math.floor(Math.random() * 89999) + 10000; + return (

Your ID:

{randomId}

); +} + +export function getUserID() { + return randomId; +} + +export default RandomIDComponent; \ No newline at end of file diff --git a/src/pages/TestInfoPage.jsx b/src/pages/TestInfoPage.jsx index ccf7d95..d88050b 100644 --- a/src/pages/TestInfoPage.jsx +++ b/src/pages/TestInfoPage.jsx @@ -1,9 +1,11 @@ import React from "react"; import InfoPageComponent from "../components/InfoPageComponent"; +import RandomIDComponent from "../components/RandomIDComponent"; function TestInfoPage({redirectLoc}) { return (

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

+
); }