aboutsummaryrefslogtreecommitdiff
path: root/src/web/helpers/Location.jsx
diff options
context:
space:
mode:
authorNicolas James <Eele1Ephe7uZahRie@tutanota.com>2025-02-13 18:04:18 +1100
committerNicolas James <Eele1Ephe7uZahRie@tutanota.com>2025-02-13 18:04:18 +1100
commit93dfe2be64e8658839bcfe5356adf35f8cde7075 (patch)
treec60b1e20d569b74dbde85123e1b2bf3590c66244 /src/web/helpers/Location.jsx
initial commit
Diffstat (limited to 'src/web/helpers/Location.jsx')
-rw-r--r--src/web/helpers/Location.jsx29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/web/helpers/Location.jsx b/src/web/helpers/Location.jsx
new file mode 100644
index 0000000..cae0b9e
--- /dev/null
+++ b/src/web/helpers/Location.jsx
@@ -0,0 +1,29 @@
+import {faHouse,
+ faBolt,
+ faCode,
+ faCamera,
+ faCar,
+ faWrench,
+ faGamepad,
+ faQuestion} from "@fortawesome/free-solid-svg-icons";
+
+
+export function getSubreactFromLocation(location) {
+ const paths = location.pathname.split("/");
+ return paths.length >= 1 ? paths[1] : "";
+}
+
+export function getInfoFromSubreact(subreact) {
+ switch (subreact) {
+ case "": return {icon: faHouse, name: "home"}
+ case "t": return {icon: faBolt, name: "technology"}
+ case "g": return {icon: faGamepad, name: "gaming"}
+ case "k": return {icon: faCode, name: "programming"}
+ case "p": return {icon: faCamera, name: "photography"}
+ case "a": return {icon: faCar, name: "automobiles"}
+ case "pr": return {icon: faWrench, name: "projects"}
+ case "m": return {icon: faQuestion, name: "miscellaneous"}
+ default: break;
+ }
+ return {};
+} \ No newline at end of file