Compare commits

..

No commits in common. "738ffd1ceecf900a93d5f2e281249705a596b719" and "330a9fffd79995d26f5e5641c6dbcd1c331e5cd0" have entirely different histories.

12 changed files with 800 additions and 898 deletions

50
index.js Normal file
View File

@ -0,0 +1,50 @@
const PORT = 8000;
const express = require("express");
const cors = require("cors");
const axios = require("axios");
require("dotenv").config();
const app = express();
app.use(cors());
app.use(express.json());
app.get("/", cors(), async (req, res) => {
res.json("nothing here");
});
app.post("/post-statistics", cors(), async (req, res) => {
const WORDPRESS_STATS_USERNAME = process.env.REACT_APP_WORDPRESS_STATS_USERNAME;
const WORDPRESS_STATS_PASSWORD = process.env.REACT_APP_WORDPRESS_STATS_PASSWORD;
const WORDPRESS_GET_TOKEN_URL = process.env.REACT_APP_WORDPRESS_GET_TOKEN_URL;
const WORDPRESS_POST_STATS_URL = process.env.REACT_APP_WORDPRESS_POST_STATS_URL;
try {
// ##### GET TOKEN
const tokenResponse = await axios.post(WORDPRESS_GET_TOKEN_URL, {
username: WORDPRESS_STATS_USERNAME,
password: WORDPRESS_STATS_PASSWORD,
});
const token = tokenResponse.data.token;
const requestDataExample = req.body;
const secondResponse = await axios({
method: "POST",
url: WORDPRESS_POST_STATS_URL,
headers: { Authorization: `Bearer ${token}` },
data: requestDataExample,
});
// ##### RETURN SUCCESS
res.json(secondResponse.data);
} catch (error) {
console.error(error);
res.status(500).send("An error occurred");
}
});
app.listen(PORT, () => {
console.log(`Backend is running on port ${PORT}`);
});

View File

@ -1,65 +0,0 @@
{
"name": "stay-safe",
"version": "0.1.0",
"private": true,
"dependencies": {
"@parcellab/react-use-umami": "^2.0.1",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@umami/api-client": "^0.56.0",
"axios": "^1.6.7",
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"express": "^4.18.2",
"framer-motion": "^11.0.3",
"lottie-react": "^2.4.0",
"nodemon": "^3.0.3",
"postcss": "^8.4.33",
"postcss-cli": "^11.0.0",
"postcss-nested": "^6.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-error-boundary": "^4.0.13",
"react-router-dom": "^6.21.3",
"react-scripts": "5.0.1",
"react-umami": "^1.0.1",
"react-zoom-pan-pinch": "^3.4.2",
"sass": "^1.70.0",
"swiper": "^11.0.7",
"use-sound": "^4.0.1",
"uuid": "^9.0.1",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"start:backend": "nodemon index.js",
"start:front-end": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"concurrently": "^8.2.2",
"tailwindcss": "^3.4.1"
}
}

1556
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -14,6 +14,7 @@
"express": "^4.18.2",
"framer-motion": "^11.0.3",
"lottie-react": "^2.4.0",
"nodemon": "^3.0.3",
"postcss": "^8.4.33",
"postcss-cli": "^11.0.0",
"postcss-nested": "^6.0.1",

View File

@ -16,7 +16,7 @@ nav.main-menu {
@apply overflow-y-auto;
}
.menu {
@apply bg-lhoist pl-6 w-full h-screen fixed top-0 bottom-0 left-0 flex flex-col justify-between;
@apply bg-lhoist pl-6 w-full h-screen fixed bottom-0 left-0 flex flex-col justify-between;
height: 100dvh;
box-sizing: border-box;
// &[open] {

View File

@ -31,11 +31,10 @@
:active {
@apply cursor--grab;
}
@apply w-full overflow-x-scroll left-0 top-0 absolute h-full;
@apply w-screen overflow-x-scroll left-0 top-0 absolute h-full;
&__background_picture {
@apply top-0 h-full block;
@apply w-auto;
@apply top-0 h-full w-auto block;
height: 100%;
max-width: revert;

View File

@ -35,7 +35,7 @@ $margin: 20px;
}
}
&__content {
@apply mt-28;
@apply mt-36;
@media screen and (min-height: 926px) {
@apply mt-0;
@ -68,7 +68,7 @@ $margin: 20px;
margin-bottom: -40px;
}
.cta--play {
@apply mx-auto z-50;
@apply mx-auto;
transform: translateY(50%);
}
}

View File

@ -12,9 +12,7 @@ import { useUser } from "../../hooks/useUser.jsx";
export default function ResultsModals({ resultsDatas }) {
useEffect(() => {
const dialog = document.querySelector("dialog");
if (!dialog) return;
dialog.scrollTo(0, 0);
document.querySelector("dialog").scrollTo(0, 0);
}, []);
const navigate = useNavigate();

View File

@ -29,7 +29,7 @@ export default function Modal({ open, onClose, children, className, id, closeMod
className={className}
ref={modalRef}
onClose={onClose}
unclosable={unclosable ? "true" : "false"}>
unclosable={unclosable ?? "false"}>
{children}
</dialog>
);

View File

@ -19,6 +19,10 @@ export default function CountrySelect({ options }) {
changeProfile("subcontractor_employee");
}
console.log(screenTranslations);
// console.log(options);
return (
<div className='profile-select'>
<ul className='' aria-hidden={!isSubmenuOpen}>

View File

@ -21,6 +21,7 @@ export function UserContextProvider({ children }) {
const [profile, setProfile] = useState(localProfile);
const [screensTranslations, setScreensTranslations] = useState({});
console.log("country", country);
useEffect(() => {
if (!language) return;
const loadTranslations = async (language) => {

View File

@ -49,7 +49,9 @@ const postGameStatisticsData = async (requestDatas) => {
};
axios.request(options)
.then((response) => {})
.then((response) => {
console.log(response.data);
})
.catch((error) => {
console.error(error);
});