From c85c4d1f2a472422992431f7b361a2de2d2c38d3 Mon Sep 17 00:00:00 2001 From: Mads Nylund <73914541+MadsNyl@users.noreply.github.com> Date: Thu, 11 Apr 2024 11:04:23 +0200 Subject: [PATCH] Shortcuts update (#1008) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): bump @babel/traverse from 7.22.15 to 7.23.2 (#912) Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.22.15 to 7.23.2. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse) --- updated-dependencies: - dependency-name: "@babel/traverse" dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: cleanup calendar pup-up (#913) * chore: cleanup calendar pup-up * chore: update conditions * fix: formatting * chore: added emoji ➡️ * chore: remove emoji 😥 * chore: fix pre-commit file permissions * chore(deps-dev): bump postcss from 8.4.29 to 8.4.31 (#904) Bumps [postcss](https://github.com/postcss/postcss) from 8.4.29 to 8.4.31. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](https://github.com/postcss/postcss/compare/8.4.29...8.4.31) --- updated-dependencies: - dependency-name: postcss dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Feat(event)/waitlist (#911) * Feat/event add users maunually (#917) * Added api endpoints locally and hooks * Added component and ui part * Small fix, only allow one person to be added * Updated Changelog * Update CHANGELOG.md * Trigger build * made page for creating and deleting QR codes (#907) * made page for creating and deleting QR codes * added error for invalid url, and download option * commit * fixed the error with deleting qr code * Update CHANGELOG.md * added error for invalid url * changed to qr generations at frontend * format * refactored to use QR code generator at frontend, and styled the component * fixes * format * Activity (#922) * first version * changed layout for activities on landing page * changed limit for activities on landing page * Update CHANGELOG.md * vite 5.0.0 update (#928) chore: vite 5.0.0 update * added buttuns for filtering (#924) * added buttuns for filtering * added filter for expired events * fix * fixed filtering of events and activities (#939) * Reaksjoner (#900) * moved share button below news post instead of above * moved share button below news post instead of above * startet adding checkbox for emojis * started adding emojis * fixed bug with newseditor * saving progress * added test mui components for displaying emojis * Your commit message * fikset logikken for emojies * added emoji picker for react * added emoji picker for react * started adding mutation * fixed fetching and started on designing * redesigned * started om emojis for event * added emojies for events * fixed design for mobile * redesigned to displaying users * format * removed yarn file * added ContentType type --------- Co-authored-by: 1Cezzo Co-authored-by: Jonatan Co-authored-by: Jarand Romestrand * moved checkbox for emojies outside paid event collapse * added id for each user in copy of participants of an event (#940) * disabled switch to change from free to paid event if an event has reg… (#910) * disabled switch to change from free to paid event if an event has registrations * first version finished * Update CHANGELOG.md * format * fixed wrong disable logic for switching off paid event * Update CHANGELOG.md * fixed countdowntimer bug, so if the time is out and there is an error in the backend, the timer will disapear * fixed countdowntimer bug * added message for when time is out, explaining why the user is not kicked out before extra payment time is out * changed message for signing off event * format * changed text (#944) * changed email for strike message (#945) * added package for allowing iframe (#949) * reduced number of showcase to two for mobile fit (#950) * Update CHANGELOG.md (#951) * added helpertext (#957) * removed timepicker. Paytime is set to constant 2 hours (#958) * Update CHANGELOG.md (#959) * Clickable user component in reactions list (#961) * changed cheatsheet button (#962) * Feat/paragraph description (#963) * Added description to fine * Updated changelog * Fixed rendering error when no laws * Fix(waiting list)/fix waiting list order (#965) * will now sort and render the waiting list participants according to their respective waiting list number * added waiting list number field to participant info * added tailwindcss and shadcn (#964) * added tailwindcss and shadcn * added clsx package for utils.ts * changed to outlined on contained buttons to fix css bug * added old bg colors to tailwindcss config * redesigned reaction handler * removed full import from React in button.tsx * removed full import from react in card.tsx * added old primary colors to index.css * changed icon for showing all reacitons * Update CHANGELOG.md (#966) * waiting-list will now only be sorted if there is a priority pool (#968) * waiting list info will now only be rendered if not null (#969) * Shadcn button refdesign (#970) * changed button for add fine * changed button for adding prioritygroups * changed button for image upload * Shadcn redesign footer (#971) * fixed long text on image upload and removed hover on small devices * refactord footer to shadcn * fixed pnpm-lock * Refactor(shadcn)/markdown (#974) * fixed markdown bugs * format * fixed link for event calender (#976) * redesigned to shadcn avatars (#977) * changed themesettings component to shadcn (#978) * fixed seperator for markdown (#981) * fixed seperator for markdown (#982) * Refactor event renderer (#983) * init * refactored event renderer * added change to changelog * started on redesign of profile page (#980) * started on redesign of profile page * redesinged event subscription collapse * redesigned admin cards * refactored badge listing * refactored membershippage * started on strike listing * refactored strike listing * finished * added change to changelog * chore(deps): bump eslint from 8.48.0 to 8.56.0 (#941) Bumps [eslint](https://github.com/eslint/eslint) from 8.48.0 to 8.56.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.48.0...v8.56.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Mads Nylund <73914541+MadsNyl@users.noreply.github.com> * docs(changelog): iterate changelog version (#919) Co-authored-by: MadsNyl Co-authored-by: Mads Nylund <73914541+MadsNyl@users.noreply.github.com> * refactored news renderer (#989) * chore(deps): bump @emotion/react from 11.9.0 to 11.11.4 (#988) Bumps [@emotion/react](https://github.com/emotion-js/emotion) from 11.9.0 to 11.11.4. - [Release notes](https://github.com/emotion-js/emotion/releases) - [Changelog](https://github.com/emotion-js/emotion/blob/main/CHANGELOG.md) - [Commits](https://github.com/emotion-js/emotion/compare/@emotion/react@11.9.0...@emotion/react@11.11.4) --- updated-dependencies: - dependency-name: "@emotion/react" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump @vercel/analytics from 1.0.2 to 1.1.4 (#984) Bumps [@vercel/analytics](https://github.com/vercel/analytics/tree/HEAD/packages/web) from 1.0.2 to 1.1.4. - [Release notes](https://github.com/vercel/analytics/releases) - [Commits](https://github.com/vercel/analytics/commits/1.1.4/packages/web) --- updated-dependencies: - dependency-name: "@vercel/analytics" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump react-router-dom from 6.15.0 to 6.22.3 (#985) * chore(deps): bump react-router-dom from 6.15.0 to 6.22.3 Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 6.15.0 to 6.22.3. - [Release notes](https://github.com/remix-run/react-router/releases) - [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md) - [Commits](https://github.com/remix-run/react-router/commits/react-router-dom@6.22.3/packages/react-router-dom) --- updated-dependencies: - dependency-name: react-router-dom dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * fixed pnpm-lock --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Mads Nylund <73914541+MadsNyl@users.noreply.github.com> Co-authored-by: Mads Nylund * chore(deps-dev): bump vite from 5.0.0 to 5.0.12 (#956) * chore(deps-dev): bump vite from 5.0.0 to 5.0.12 Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.0.0 to 5.0.12. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/v5.0.12/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v5.0.12/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-type: direct:development ... Signed-off-by: dependabot[bot] * fixed pnpm-lock --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Mads Nylund <73914541+MadsNyl@users.noreply.github.com> Co-authored-by: Mads Nylund * Update CHANGELOG.md (#990) * fixed ts error * added description of how to use spaces (#992) * changed position of share and edit button for event (#993) changed position of share and edit button * diasbled theme selector (#998) * NITO logo footer (#1002) added nito logo and made news title bigger on mobile * added version name to changelog * trigger build * Menu for shortcuts (#1006) * init * added shortcut navigations for external sites * Changed icon and added logout button * changed info for contact for strikes (#1007) changed info for contact * changed changelog --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Martin Clementz Co-authored-by: martcl Co-authored-by: Anders <69890033+lille-morille@users.noreply.github.com> Co-authored-by: Ester2109 <126612066+Ester2109@users.noreply.github.com> Co-authored-by: 1Cezzo Co-authored-by: Jonatan Co-authored-by: Jarand Romestrand Co-authored-by: Emil Johnsen <111747340+1Cezzo@users.noreply.github.com> Co-authored-by: Frikk Balder <33499052+MindChirp@users.noreply.github.com> Co-authored-by: Erik Skjellevik <98759397+eriskjel@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: MadsNyl --- CHANGELOG.md | 3 + package.json | 3 +- pnpm-lock.yaml | 148 ++++++++++++++++++ src/URLS.tsx | 7 +- .../miscellaneous/shortCutMenu/Admin.tsx | 61 ++++++++ .../miscellaneous/shortCutMenu/HotKey.tsx | 42 +++++ .../miscellaneous/shortCutMenu/Item.tsx | 29 ++++ .../miscellaneous/shortCutMenu/Logout.tsx | 22 +++ .../miscellaneous/shortCutMenu/Membership.tsx | 27 ++++ .../miscellaneous/shortCutMenu/Navigation.tsx | 88 +++++++++++ .../shortCutMenu/SectionWrapper.tsx | 17 ++ .../miscellaneous/shortCutMenu/Tools.tsx | 26 +++ .../miscellaneous/shortCutMenu/index.tsx | 86 ++++++++++ .../miscellaneous/shortCutMenu/shortcuts.ts | 37 +++++ src/components/navigation/Navigation.tsx | 3 +- src/components/ui/dialog.tsx | 4 +- src/components/ui/scroll-area.tsx | 46 ++++++ src/index.tsx | 2 + .../Profile/components/ProfileStrikes.tsx | 10 +- src/utils.tsx | 7 + 20 files changed, 654 insertions(+), 14 deletions(-) create mode 100644 src/components/miscellaneous/shortCutMenu/Admin.tsx create mode 100644 src/components/miscellaneous/shortCutMenu/HotKey.tsx create mode 100644 src/components/miscellaneous/shortCutMenu/Item.tsx create mode 100644 src/components/miscellaneous/shortCutMenu/Logout.tsx create mode 100644 src/components/miscellaneous/shortCutMenu/Membership.tsx create mode 100644 src/components/miscellaneous/shortCutMenu/Navigation.tsx create mode 100644 src/components/miscellaneous/shortCutMenu/SectionWrapper.tsx create mode 100644 src/components/miscellaneous/shortCutMenu/Tools.tsx create mode 100644 src/components/miscellaneous/shortCutMenu/index.tsx create mode 100644 src/components/miscellaneous/shortCutMenu/shortcuts.ts create mode 100644 src/components/ui/scroll-area.tsx diff --git a/CHANGELOG.md b/CHANGELOG.md index f4e9f1298..705f244ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ ## Neste versjon +## Versjon 2023.11.04 +- ✨ **Shortcuts**. La til meny med shortcuts. + ## Versjon 2023.10.04 - 🎨 **Footer**. La til NITO logo i footer under "samarbeid" diff --git a/package.json b/package.json index 95e5844cd..5f10889ed 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "@radix-ui/react-dialog": "^1.0.5", "@radix-ui/react-dropdown-menu": "^2.0.6", "@radix-ui/react-label": "^2.0.2", + "@radix-ui/react-scroll-area": "^1.0.5", "@radix-ui/react-select": "^2.0.0", "@radix-ui/react-separator": "^1.0.3", "@radix-ui/react-slot": "^1.0.2", @@ -85,8 +86,8 @@ "@typescript-eslint/eslint-plugin": "^5.22.0", "@typescript-eslint/parser": "^5.38.1", "@vitejs/plugin-react": "^4.2.0", - "eslint": "^8.56.0", "autoprefixer": "^10.4.18", + "eslint": "^8.56.0", "eslint-config-prettier": "^9.0.0", "eslint-plugin-import-helpers": "^1.3.1", "eslint-plugin-prettier": "^4.2.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f9495274e..b1b113b8d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -50,6 +50,9 @@ dependencies: '@radix-ui/react-label': specifier: ^2.0.2 version: 2.0.2(@types/react-dom@17.0.11)(@types/react@17.0.37)(react-dom@17.0.2)(react@17.0.2) + '@radix-ui/react-scroll-area': + specifier: ^1.0.5 + version: 1.0.5(react-dom@17.0.2)(react@17.0.2) '@radix-ui/react-select': specifier: ^2.0.0 version: 2.0.0(@types/react-dom@17.0.11)(@types/react@17.0.37)(react-dom@17.0.2)(react@17.0.2) @@ -1929,6 +1932,19 @@ packages: react: 17.0.2 dev: false + /@radix-ui/react-compose-refs@1.0.1(react@17.0.2): + resolution: {integrity: sha512-fDSBgd44FKHa1FRMU59qBMPFcl2PZE+2nmqunj+BWFyYYjnhIDWL2ItDs3rrbJDQOtzt5nIebLCQc4QRfz6LJw==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + '@types/react': + optional: true + dependencies: + '@babel/runtime': 7.24.0 + react: 17.0.2 + dev: false + /@radix-ui/react-context-menu@2.1.5(@types/react-dom@17.0.11)(@types/react@17.0.37)(react-dom@17.0.2)(react@17.0.2): resolution: {integrity: sha512-R5XaDj06Xul1KGb+WP8qiOh7tKJNz2durpLBXAGZjSVtctcRFCuEvy2gtMwRJGePwQQE5nV77gs4FwRi8T+r2g==} peerDependencies: @@ -1969,6 +1985,19 @@ packages: react: 17.0.2 dev: false + /@radix-ui/react-context@1.0.1(react@17.0.2): + resolution: {integrity: sha512-ebbrdFoYTcuZ0v4wG5tedGnp9tzcV8awzsxYph7gXUyvnNLuTIcCk1q17JEbnVhXAKG9oX3KtchwiMIAYp9NLg==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + '@types/react': + optional: true + dependencies: + '@babel/runtime': 7.24.0 + react: 17.0.2 + dev: false + /@radix-ui/react-dialog@1.0.5(@types/react-dom@17.0.11)(@types/react@17.0.37)(react-dom@17.0.2)(react@17.0.2): resolution: {integrity: sha512-GjWJX/AUpB703eEBanuBnIWdIXg6NvJFCXcNlSZk4xdszCdhrJgBoUd1cGk67vFO+WdA2pfI/plOpqz/5GUP6Q==} peerDependencies: @@ -2017,6 +2046,19 @@ packages: react: 17.0.2 dev: false + /@radix-ui/react-direction@1.0.1(react@17.0.2): + resolution: {integrity: sha512-RXcvnXgyvYvBEOhCBuddKecVkoMiI10Jcm5cTI7abJRAHYfFxeu+FBQs/DvdxSYucxR5mna0dNsL6QFlds5TMA==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + '@types/react': + optional: true + dependencies: + '@babel/runtime': 7.24.0 + react: 17.0.2 + dev: false + /@radix-ui/react-dismissable-layer@1.0.5(@types/react-dom@17.0.11)(@types/react@17.0.37)(react-dom@17.0.2)(react@17.0.2): resolution: {integrity: sha512-aJeDjQhywg9LBu2t/At58hCvr7pEm0o2Ke1x33B+MhjNmmZ17sy4KImo0KPLgsnc/zN7GPdce8Cnn0SWvwZO7g==} peerDependencies: @@ -2351,6 +2393,26 @@ packages: react-dom: 17.0.2(react@17.0.2) dev: false + /@radix-ui/react-presence@1.0.1(react-dom@17.0.2)(react@17.0.2): + resolution: {integrity: sha512-UXLW4UAbIY5ZjcvzjfRFo5gxva8QirC9hF7wRE4U5gz+TP0DbRk+//qyuAQ1McDxBt1xNMBTaciFGvEmJvAZCg==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + dependencies: + '@babel/runtime': 7.24.0 + '@radix-ui/react-compose-refs': 1.0.1(react@17.0.2) + '@radix-ui/react-use-layout-effect': 1.0.1(react@17.0.2) + react: 17.0.2 + react-dom: 17.0.2(react@17.0.2) + dev: false + /@radix-ui/react-primitive@1.0.3(@types/react-dom@17.0.11)(@types/react@17.0.37)(react-dom@17.0.2)(react@17.0.2): resolution: {integrity: sha512-yi58uVyoAcK/Nq1inRY56ZSjKypBNKTa/1mcL8qdl6oJeEaDbOldlzrGn7P6Q3Id5d+SYNGc5AJgc4vGhjs5+g==} peerDependencies: @@ -2372,6 +2434,25 @@ packages: react-dom: 17.0.2(react@17.0.2) dev: false + /@radix-ui/react-primitive@1.0.3(react-dom@17.0.2)(react@17.0.2): + resolution: {integrity: sha512-yi58uVyoAcK/Nq1inRY56ZSjKypBNKTa/1mcL8qdl6oJeEaDbOldlzrGn7P6Q3Id5d+SYNGc5AJgc4vGhjs5+g==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + dependencies: + '@babel/runtime': 7.24.0 + '@radix-ui/react-slot': 1.0.2(react@17.0.2) + react: 17.0.2 + react-dom: 17.0.2(react@17.0.2) + dev: false + /@radix-ui/react-progress@1.0.3(@types/react-dom@17.0.11)(@types/react@17.0.37)(react-dom@17.0.2)(react@17.0.2): resolution: {integrity: sha512-5G6Om/tYSxjSeEdrb1VfKkfZfn/1IlPWd731h2RfPuSbIfNUgfqAwbKfJCg/PP6nuUCTrYzalwHSpSinoWoCag==} peerDependencies: @@ -2482,6 +2563,33 @@ packages: react-dom: 17.0.2(react@17.0.2) dev: false + /@radix-ui/react-scroll-area@1.0.5(react-dom@17.0.2)(react@17.0.2): + resolution: {integrity: sha512-b6PAgH4GQf9QEn8zbT2XUHpW5z8BzqEc7Kl11TwDrvuTrxlkcjTD5qa/bxgKr+nmuXKu4L/W5UZ4mlP/VG/5Gw==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + dependencies: + '@babel/runtime': 7.24.0 + '@radix-ui/number': 1.0.1 + '@radix-ui/primitive': 1.0.1 + '@radix-ui/react-compose-refs': 1.0.1(react@17.0.2) + '@radix-ui/react-context': 1.0.1(react@17.0.2) + '@radix-ui/react-direction': 1.0.1(react@17.0.2) + '@radix-ui/react-presence': 1.0.1(react-dom@17.0.2)(react@17.0.2) + '@radix-ui/react-primitive': 1.0.3(react-dom@17.0.2)(react@17.0.2) + '@radix-ui/react-use-callback-ref': 1.0.1(react@17.0.2) + '@radix-ui/react-use-layout-effect': 1.0.1(react@17.0.2) + react: 17.0.2 + react-dom: 17.0.2(react@17.0.2) + dev: false + /@radix-ui/react-select@2.0.0(@types/react-dom@17.0.11)(@types/react@17.0.37)(react-dom@17.0.2)(react@17.0.2): resolution: {integrity: sha512-RH5b7af4oHtkcHS7pG6Sgv5rk5Wxa7XI8W5gvB1N/yiuDGZxko1ynvOiVhFM7Cis2A8zxF9bTOUVbRDzPepe6w==} peerDependencies: @@ -2590,6 +2698,20 @@ packages: react: 17.0.2 dev: false + /@radix-ui/react-slot@1.0.2(react@17.0.2): + resolution: {integrity: sha512-YeTpuq4deV+6DusvVUW4ivBgnkHwECUu0BiN43L5UCDFgdhsRUWAghhTF5MbvNTPzmiFOx90asDSUjWuCNapwg==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + '@types/react': + optional: true + dependencies: + '@babel/runtime': 7.24.0 + '@radix-ui/react-compose-refs': 1.0.1(react@17.0.2) + react: 17.0.2 + dev: false + /@radix-ui/react-switch@1.0.3(@types/react-dom@17.0.11)(@types/react@17.0.37)(react-dom@17.0.2)(react@17.0.2): resolution: {integrity: sha512-mxm87F88HyHztsI7N+ZUmEoARGkC22YVW5CaC+Byc+HRpuvCrOBPTAnXgf+tZ/7i0Sg/eOePGdMhUKhPaQEqow==} peerDependencies: @@ -2800,6 +2922,19 @@ packages: react: 17.0.2 dev: false + /@radix-ui/react-use-callback-ref@1.0.1(react@17.0.2): + resolution: {integrity: sha512-D94LjX4Sp0xJFVaoQOd3OO9k7tpBYNOXdVhkltUbGv2Qb9OXdrg/CpsjlZv7ia14Sylv398LswWBVVu5nqKzAQ==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + '@types/react': + optional: true + dependencies: + '@babel/runtime': 7.24.0 + react: 17.0.2 + dev: false + /@radix-ui/react-use-controllable-state@1.0.1(@types/react@17.0.37)(react@17.0.2): resolution: {integrity: sha512-Svl5GY5FQeN758fWKrjM6Qb7asvXeiZltlT4U2gVfl8Gx5UAv2sMR0LWo8yhsIZh2oQ0eFdZ59aoOOMV7b47VA==} peerDependencies: @@ -2844,6 +2979,19 @@ packages: react: 17.0.2 dev: false + /@radix-ui/react-use-layout-effect@1.0.1(react@17.0.2): + resolution: {integrity: sha512-v/5RegiJWYdoCvMnITBkNNx6bCj20fiaJnWtRkU18yITptraXjffz5Qbn05uOiQnOvi+dbkznkoaMltz1GnszQ==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + '@types/react': + optional: true + dependencies: + '@babel/runtime': 7.24.0 + react: 17.0.2 + dev: false + /@radix-ui/react-use-previous@1.0.1(@types/react@17.0.37)(react@17.0.2): resolution: {integrity: sha512-cV5La9DPwiQ7S0gf/0qiD6YgNqM5Fk97Kdrlc5yBcrF3jyEZQwm7vYFqMo4IfeHgJXsRaMvLABFtd0OVEmZhDw==} peerDependencies: diff --git a/src/URLS.tsx b/src/URLS.tsx index c679fde0e..6559e08ab 100644 --- a/src/URLS.tsx +++ b/src/URLS.tsx @@ -60,7 +60,12 @@ const URLS = { jobpostsAdmin: '/admin/karriere/', newsAdmin: '/admin/nyheter/', bannerAdmin: '/admin/bannere/', - jubilee: 'jubileum.tihlde.org/', + jubilee: 'https://jubileum.tihlde.org/', + fondet: 'https://fondet.tihlde.org/', + kontRes: 'https://kontres.tihlde.org/', + github: 'https://github.com/TIHLDE', + pythons: 'https://pythons.tihlde.org/', + pythonsLadies: 'https://pythons-damer.tihlde.org/', }; export default URLS; diff --git a/src/components/miscellaneous/shortCutMenu/Admin.tsx b/src/components/miscellaneous/shortCutMenu/Admin.tsx new file mode 100644 index 000000000..112a4d327 --- /dev/null +++ b/src/components/miscellaneous/shortCutMenu/Admin.tsx @@ -0,0 +1,61 @@ +import URLS from 'URLS'; + +import { PermissionApp } from 'types/Enums'; + +import { HavePermission } from 'hooks/User'; + +import { ShortCutMenuProps } from '.'; +import ShortCutLink from './Item'; +import ShortCutSectionWrapper from './SectionWrapper'; + +const ShortCutAdmin = ({ setOpen }: Pick) => { + const links = [ + { + apps: [PermissionApp.EVENT], + title: 'Arrangementer', + path: URLS.eventAdmin, + }, + { + apps: [PermissionApp.GROUP], + title: 'Grupper', + path: URLS.groups.index, + }, + { + apps: [PermissionApp.JOBPOST], + title: 'Jobbannonser', + path: URLS.jobpostsAdmin, + }, + { + apps: [PermissionApp.USER], + title: 'Medlemmer', + path: URLS.userAdmin, + }, + { + apps: [PermissionApp.NEWS], + title: 'Nyheter', + path: URLS.newsAdmin, + }, + { + apps: [PermissionApp.STRIKE], + title: 'Prikker', + path: URLS.strikeAdmin, + }, + { + apps: [PermissionApp.BANNERS], + title: 'Bannere', + path: URLS.bannerAdmin, + }, + ]; + + return ( + + {links.map((link, index) => ( + + + + ))} + + ); +}; + +export default ShortCutAdmin; diff --git a/src/components/miscellaneous/shortCutMenu/HotKey.tsx b/src/components/miscellaneous/shortCutMenu/HotKey.tsx new file mode 100644 index 000000000..01022f54f --- /dev/null +++ b/src/components/miscellaneous/shortCutMenu/HotKey.tsx @@ -0,0 +1,42 @@ +import { ArrowBigUp, Command, Option } from 'lucide-react'; +import { ReactNode } from 'react'; + +type HotKeyProps = { + modifiers: Array<'shift' | 'alt' | 'ctrl' | undefined>; + letter: string; +}; + +const HotKey = ({ modifiers, letter }: HotKeyProps) => { + const getModifierKey = (modifier: 'shift' | 'alt' | 'ctrl' | undefined): ReactNode | undefined => { + switch (modifier) { + case 'shift': + return ; + case 'alt': + return