Skip to content

Commit

Permalink
feat: Replaced GA with Plausible
Browse files Browse the repository at this point in the history
  • Loading branch information
dm94 committed Jan 17, 2024
1 parent adb868d commit 3106bca
Show file tree
Hide file tree
Showing 8 changed files with 698 additions and 682 deletions.
10 changes: 5 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
REACT_APP_PUBLIC_URL=https://www.stiletto.live
REACT_APP_RESOURCES_URL= URL API ADDRESS FOR ICONS AND MAPS
REACT_APP_API_URL= URL API
REACT_APP_DISCORD_CLIENT_ID= DISCORD CLIENT ID
REACT_APP_GA_ID= Google Analytics ID
REACT_APP_PUBLIC_URL=https://www.stiletto.live
REACT_APP_RESOURCES_URL= URL API ADDRESS FOR ICONS AND MAPS
REACT_APP_API_URL= URL API
REACT_APP_DISCORD_CLIENT_ID= DISCORD CLIENT ID
REACT_APP_PLAUSIBLE_URL=PLAUSIBLE URL
REACT_APP_VERSION=$npm_package_version
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The website uses several json files to read the game data so that it is always u
- REACT_APP_RESOURCES_URL= URL API ADDRESS FOR ICONS AND MAPS
- REACT_APP_API_URL= URL API
- REACT_APP_DISCORD_CLIENT_ID= DISCORD CLIENT ID
- REACT_APP_GA_ID= Google Analytics ID
- REACT_APP_PLAUSIBLE_URL=PLAUSIBLE URL

#### Generate maps

Expand Down
159 changes: 79 additions & 80 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,80 +1,79 @@
{
"name": "stiletto-web",
"version": "4.6.2",
"license": "UNLICENSED",
"author": "Dm94Dani",
"description": "Web with different utilities for the game Last Oasis",
"private": true,
"bugs": {
"url": "https://github.com/dm94/stiletto-web/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/dm94/stiletto-web"
},
"dependencies": {
"@giscus/react": "^2.2.6",
"axios": ">=1.3.1",
"beautiful-skill-tree": "^1.7.1",
"bootstrap": "^4.5.3",
"i18next": "^22.4.9",
"i18next-browser-languagedetector": "^7.0.1",
"i18next-http-backend": "^2.1.1",
"jquery": "^3.6.3",
"leaflet": "^1.7.1",
"leaflet-rastercoords": "^1.0.5",
"query-string": "^8.1.0",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"react-ga4": "^2.0.0",
"react-helmet": "^6.1.0",
"react-i18next": "^12.1.4",
"react-leaflet": "^2.8.0",
"react-router-dom": "^5.2.0",
"react-scripts": "^5.0.1",
"react-tiny-virtual-list": "^2.2.0",
"workbox": "0.0.0",
"workbox-core": "^6.5.4",
"workbox-expiration": "^6.5.4",
"workbox-precaching": "^6.5.4",
"workbox-routing": "^6.5.4",
"workbox-strategies": "^6.5.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"cypress": "cypress open",
"cypress:test": "cypress run",
"lint": "eslint --fix --ext .js,.jsx ."
},
"eslintConfig": {
"extends": "react-app"
},
"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/preset-react": "^7.18.6",
"babel-eslint": "^10.1.0",
"cypress": "^12.5.1",
"eslint": "^8.33.0",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.8.3"
},
"engines": {
"node": "18.x"
},
"lint": "eslint --ext .js,.jsx ."
}
{
"name": "stiletto-web",
"version": "4.6.3",
"license": "UNLICENSED",
"author": "Dm94Dani",
"description": "Web with different utilities for the game Last Oasis",
"private": true,
"bugs": {
"url": "https://github.com/dm94/stiletto-web/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/dm94/stiletto-web"
},
"dependencies": {
"@giscus/react": "^2.2.6",
"axios": ">=1.3.1",
"beautiful-skill-tree": "^1.7.1",
"bootstrap": "^4.5.3",
"i18next": "^22.4.9",
"i18next-browser-languagedetector": "^7.0.1",
"i18next-http-backend": "^2.1.1",
"jquery": "^3.6.3",
"leaflet": "^1.7.1",
"leaflet-rastercoords": "^1.0.5",
"query-string": "^8.1.0",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"react-helmet": "^6.1.0",
"react-i18next": "^12.1.4",
"react-leaflet": "^2.8.0",
"react-router-dom": "^5.2.0",
"react-scripts": "^5.0.1",
"react-tiny-virtual-list": "^2.2.0",
"workbox": "0.0.0",
"workbox-core": "^6.5.4",
"workbox-expiration": "^6.5.4",
"workbox-precaching": "^6.5.4",
"workbox-routing": "^6.5.4",
"workbox-strategies": "^6.5.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"cypress": "cypress open",
"cypress:test": "cypress run",
"lint": "eslint --fix --ext .js,.jsx ."
},
"eslintConfig": {
"extends": "react-app"
},
"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/preset-react": "^7.18.6",
"babel-eslint": "^10.1.0",
"cypress": "^12.5.1",
"eslint": "^8.33.0",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.8.3"
},
"engines": {
"node": "18.x"
},
"lint": "eslint --ext .js,.jsx ."
}
137 changes: 68 additions & 69 deletions src/components/ChangeLanguageModal.jsx
Original file line number Diff line number Diff line change
@@ -1,69 +1,68 @@
import React, { Component } from "react";
import { withTranslation } from "react-i18next";
import { getStoredItem } from "../services";

class ChangeLanguageModal extends Component {
getLanguajes = () => {
const supportedLanguages = [
{ key: "en", name: "English" },
{ key: "es", name: "Spanish" },
{ key: "ru", name: "Russian" },
{ key: "fr", name: "French" },
{ key: "de", name: "German" },
{ key: "it", name: "Italian" },
{ key: "ja", name: "Japanese" },
{ key: "pl", name: "Polish" },
{ key: "zh", name: "Chinese Simplified" },
{ key: "pt", name: "Portuguese, Brazilian" },
{ key: "uk", name: "Ukrainian" },
];

return supportedLanguages.map((languaje) => {
const { t } = this.props;
return (
<div className="col-3" key={languaje.key}>
<img
className="img-thumbnail"
src={`/img/${languaje.key}.jpg`}
alt={`${languaje.name} language`}
onClick={() => this.props.switchLanguage(languaje.key)}
/>
<p>{t(languaje.name)}</p>
</div>
);
});
};

render() {
const { t } = this.props;
return (
<div className="modal d-block">
<div className="modal-dialog">
<div className="modal-content">
<div className="modal-header">{t("Change language")}</div>
<div className="modal-body">
<div className="row text-center">{this.getLanguajes()}</div>
</div>
<div className="modal-footer">
<p className="mr-auto">v4.6.2</p>
<button
className={
getStoredItem("darkmode") !== "true"
? "btn btn-outline-secondary"
: "btn btn-outline-light"
}
onClick={() => {
this.props.hideModal();
}}
>
{t("Accept")}
</button>
</div>
</div>
</div>
</div>
);
}
}

export default withTranslation()(ChangeLanguageModal);
import React, { Component } from "react";
import { withTranslation } from "react-i18next";
import { getStoredItem } from "../services";

class ChangeLanguageModal extends Component {
getLanguajes = () => {
const supportedLanguages = [
{ key: "en", name: "English" },
{ key: "es", name: "Spanish" },
{ key: "ru", name: "Russian" },
{ key: "fr", name: "French" },
{ key: "de", name: "German" },
{ key: "it", name: "Italian" },
{ key: "ja", name: "Japanese" },
{ key: "pl", name: "Polish" },
{ key: "zh", name: "Chinese Simplified" },
{ key: "pt", name: "Portuguese, Brazilian" },
{ key: "uk", name: "Ukrainian" },
];

return supportedLanguages.map((languaje) => {
const { t } = this.props;
return (
<div className="col-3" key={languaje.key}>
<img
className="img-thumbnail"
src={`/img/${languaje.key}.jpg`}
alt={`${languaje.name} language`}
onClick={() => this.props.switchLanguage(languaje.key)}
/>
<p>{t(languaje.name)}</p>
</div>
);
});
};

render() {
const { t } = this.props;
return (
<div className="modal d-block">
<div className="modal-dialog">
<div className="modal-content">
<div className="modal-header">{t("Change language")}</div>
<div className="modal-body">
<div className="row text-center">{this.getLanguajes()}</div>
</div>
<div className="modal-footer">
<button
className={
getStoredItem("darkmode") !== "true"
? "btn btn-outline-secondary"
: "btn btn-outline-light"
}
onClick={() => {
this.props.hideModal();
}}
>
{t("Accept")}
</button>
</div>
</div>
</div>
</div>
);
}
}

export default withTranslation()(ChangeLanguageModal);
Loading

1 comment on commit 3106bca

@vercel
Copy link

@vercel vercel bot commented on 3106bca Jan 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.