Browse Source

feat: Added random ID component

master
Denis Thiessen 6 months ago
parent
commit
e8177e1f32
  1. 15
      src/components/RandomIDComponent.jsx
  2. 2
      src/pages/TestInfoPage.jsx

15
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 (<div><h3>Your ID:</h3><p>{randomId}</p></div>);
}
export function getUserID() {
return randomId;
}
export default RandomIDComponent;

2
src/pages/TestInfoPage.jsx

@ -1,9 +1,11 @@
import React from "react"; import React from "react";
import InfoPageComponent from "../components/InfoPageComponent"; import InfoPageComponent from "../components/InfoPageComponent";
import RandomIDComponent from "../components/RandomIDComponent";
function TestInfoPage({redirectLoc}) { function TestInfoPage({redirectLoc}) {
return (<InfoPageComponent redirectLoc={redirectLoc}> return (<InfoPageComponent redirectLoc={redirectLoc}>
<p>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.</p> <p>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.</p>
<RandomIDComponent />
</InfoPageComponent>); </InfoPageComponent>);
} }
Loading…
Cancel
Save