From 3d09ba6d5f84fc92795f94baf9e97336ae2c5341 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CDarius=E2=80=9D?= Date: Sat, 23 Sep 2023 05:20:19 -0700 Subject: [PATCH 01/13] :mag:add unique page descriptions --- src/pages/acknowledgements.js | 1 + src/pages/blog/index.js | 1 + src/pages/dispatch.js | 1 + src/pages/donate/index.js | 1 + src/pages/leaderboard.js | 1 + src/pages/register.js | 1 + 6 files changed, 6 insertions(+) diff --git a/src/pages/acknowledgements.js b/src/pages/acknowledgements.js index 2c8ae0e0e..b77b280bf 100644 --- a/src/pages/acknowledgements.js +++ b/src/pages/acknowledgements.js @@ -79,6 +79,7 @@ function Acknowledgements () { Acknowledgements.getPageMeta = () => { return { title: 'Acknowledgements', + description: 'Explore our Acknowledgements Page to see the incredible companies fueling the Fuel Rats\' lifesaving missions within \'Elite Dangerous\'. We extend our sincerest thanks to our corporate sponsors, whose generous support empowers us to reach stranded pilots across the galaxy and ensure no spaceship runs out of fuel. Discover the organizations that share our passion for community and gaming, and join us in celebrating their valuable contribution to our interstellar rescue endeavors.', } } diff --git a/src/pages/blog/index.js b/src/pages/blog/index.js index be9169dad..7a0b79ac8 100644 --- a/src/pages/blog/index.js +++ b/src/pages/blog/index.js @@ -64,6 +64,7 @@ Blogs.getPageMeta = () => { return { title: 'Blog', key: 'blog-list', + description: 'Dive into the Fuel Rats Blog to explore thrilling tales of in-game rescues, updates, and insights from our adventurous team! Whether you’re a player seeking tips, a fan interested in our latest rescues, or just curious about our interstellar journeys, our blog offers a rich array of stories, advice, and news from the front lines of spaceship assistance. Discover the exciting world of Fuel Rats and join us in exploring the boundless gaming cosmos!', } } diff --git a/src/pages/dispatch.js b/src/pages/dispatch.js index c50badce7..fadffdb66 100644 --- a/src/pages/dispatch.js +++ b/src/pages/dispatch.js @@ -50,6 +50,7 @@ DispatchBoard.getPageMeta = () => { className: styles.dispatchBoard, title: 'Dispatch Board', key: 'dispatch', + description: 'Access the Fuel Rats Internal Dispatch Portal to coordinate rapid and efficient in-game rescues. Here, our dedicated team of Fuel Rats can respond to distress calls, manage rescue missions, and ensure that every player stranded in the cosmos receives timely assistance. Efficiently navigate through requests and deploy help where it\'s needed most in the gaming universe!', } } diff --git a/src/pages/donate/index.js b/src/pages/donate/index.js index 066d2f9a8..70490f302 100644 --- a/src/pages/donate/index.js +++ b/src/pages/donate/index.js @@ -24,6 +24,7 @@ function Donate ({ stripe }) { Donate.getPageMeta = () => { return { title: 'Donate', + description: 'Support the Fuel Rats\' mission to aid spaceship pilots in our vast universe! Your generous donation helps us continue our in-game rescue services, ensuring no player is left stranded in space. Contribute today and fuel our journey to make the gaming experience enjoyable for everyone!', } } diff --git a/src/pages/leaderboard.js b/src/pages/leaderboard.js index 7eb318867..d30873240 100644 --- a/src/pages/leaderboard.js +++ b/src/pages/leaderboard.js @@ -15,6 +15,7 @@ function Leaderboard () { Leaderboard.getPageMeta = () => { return { title: 'Leaderboard', + description: 'Explore the Fuel Rats Leaderboard and witness the daring rescues by elite players in the galaxy! Our leaderboard tracks in-game spaceship rescues, showcasing individual accomplishments and contributions of our top rescuers.', } } diff --git a/src/pages/register.js b/src/pages/register.js index be66b6245..873874d35 100644 --- a/src/pages/register.js +++ b/src/pages/register.js @@ -113,6 +113,7 @@ Register.getPageMeta = () => { return { displayTitle: 'Become a Fuel Rat', title: 'Register', + description: 'Join the elite team of rescuers in the gaming cosmos by registering with the Fuel Rats! Our registration page is your gateway to embark on thrilling rescue missions, interact with a community of passionate gamers, and make your mark in the interstellar gaming universe. Sign up to navigate through breathtaking adventures, enhance your gaming experience, and be a beacon of hope for stranded pilots across the galaxies!', } } From ad1759798b4c03f872e951f2b7d5eb82b9bc77eb Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Sun, 24 Sep 2023 17:42:42 +0000 Subject: [PATCH 02/13] docs: update README.md [skip ci] --- README.md | 57 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index ca04cf339..013620e0b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Fuelrats.com dependencies on David DM][daviddm-badge]][daviddm] -[![All Contributors](https://img.shields.io/badge/all_contributors-18-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-19-orange.svg?style=flat-square)](#contributors-) [![PRs Welcome][prs-badge]][prs] @@ -31,32 +31,35 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Cameron Welter

πŸ“ πŸ› πŸ’» πŸ–‹ 🎨 πŸ“– πŸ€” 🚧 πŸ”Œ πŸ“† πŸ’¬ πŸ‘€ πŸ”§ πŸ““

Trezy

πŸ“ πŸ› πŸ’» πŸ–‹ 🎨 πŸ“– πŸ€” πŸš‡ πŸ’¬ πŸ‘€ πŸ““

NumberPi

πŸ› πŸ’» πŸ–‹ 🎨 πŸ‘€ πŸ““

Alex S. Glomsaas

πŸ› πŸ’» πŸ” πŸ€” πŸš‡ πŸ›‘οΈ πŸ““

Chris GΓ₯rdenberg

πŸ’»

Adanaran

πŸ› πŸ’»

Andrew Bishop

πŸ› πŸš‡

Kenneth Aalberg

πŸ› πŸ” πŸ€” πŸš‡

Aki Loponen

πŸ› πŸ€”

Elad Karni

πŸ’» 🎨

spansh

πŸ’» 🎨

Uvelius

πŸ’»

Nathan

πŸ’»

allcontributors[bot]

πŸ“–

dependabot[bot]

πŸš‡

Alex

πŸ’»

Master-Guy

πŸ’»

Delota

πŸ’»
Cameron Welter
Cameron Welter

πŸ“ πŸ› πŸ’» πŸ–‹ 🎨 πŸ“– πŸ€” 🚧 πŸ”Œ πŸ“† πŸ’¬ πŸ‘€ πŸ”§ πŸ““
Trezy
Trezy

πŸ“ πŸ› πŸ’» πŸ–‹ 🎨 πŸ“– πŸ€” πŸš‡ πŸ’¬ πŸ‘€ πŸ““
NumberPi
NumberPi

πŸ› πŸ’» πŸ–‹ 🎨 πŸ‘€ πŸ““
Alex S. Glomsaas
Alex S. Glomsaas

πŸ› πŸ’» πŸ” πŸ€” πŸš‡ πŸ›‘οΈ πŸ““
Chris GΓ₯rdenberg
Chris GΓ₯rdenberg

πŸ’»
Adanaran
Adanaran

πŸ› πŸ’»
Andrew Bishop
Andrew Bishop

πŸ› πŸš‡
Kenneth Aalberg
Kenneth Aalberg

πŸ› πŸ” πŸ€” πŸš‡
Aki Loponen
Aki Loponen

πŸ› πŸ€”
Elad Karni
Elad Karni

πŸ’» 🎨
spansh
spansh

πŸ’» 🎨
Uvelius
Uvelius

πŸ’»
Nathan
Nathan

πŸ’»
allcontributors[bot]
allcontributors[bot]

πŸ“–
dependabot[bot]
dependabot[bot]

πŸš‡
Alex
Alex

πŸ’»
Master-Guy
Master-Guy

πŸ’»
Delota
Delota

πŸ’»
Darius West
Darius West

πŸ’» πŸ–‹
From 2f02058a9450e9d0f899d2e1e79b5867dec1a921 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Sun, 24 Sep 2023 17:42:42 +0000 Subject: [PATCH 03/13] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 6ada1b4ab..28943f25e 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -208,6 +208,16 @@ "contributions": [ "code" ] + }, + { + "login": "lFourl", + "name": "Darius West", + "avatar_url": "https://avatars.githubusercontent.com/u/39689166?v=4", + "profile": "http://dwest.dev", + "contributions": [ + "code", + "content" + ] } ], "repoType": "github", @@ -215,5 +225,7 @@ "skipCi": true, "files": [ "README.md" - ] + ], + "commitType": "docs", + "commitConvention": "angular" } From 154cce320507c69128a551cc296fc2e0a0c73411 Mon Sep 17 00:00:00 2001 From: Cameron Welter Date: Thu, 31 Oct 2024 21:19:11 -0400 Subject: [PATCH 04/13] allow manual builds --- .github/workflows/deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9221e4cac..cdccafca6 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,6 +1,7 @@ name: Deploy on: + workflow_dispatch: push: branches: [ develop, release ] From cbc420624e393861ef2b84f6d2f3e3dbe03895b1 Mon Sep 17 00:00:00 2001 From: Cameron Welter Date: Thu, 31 Oct 2024 21:38:25 -0400 Subject: [PATCH 05/13] update workflows --- .github/workflows/deploy.yml | 58 +++++------------------------ .github/workflows/pull_request.yml | 59 +++++------------------------- 2 files changed, 19 insertions(+), 98 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index cdccafca6..f95212176 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -13,37 +13,13 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 - - - name: Read `.nvmrc` - run: echo "::set-output name=nvmrc::$(cat .nvmrc)" - id: nvm + uses: actions/checkout@v4 - name: Use Node.js (.nvmrc) - uses: actions/setup-node@v1 - with: - node-version: "${{ steps.nvm.outputs.nvmrc }}" - - - name: Read `yarn cache dir` - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - - - name: Load yarn cache - uses: actions/cache@v2 - id: yarn-cache - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - - name: Load Next.js cache - uses: actions/cache@v2 + uses: actions/setup-node@v4 with: - path: ${{ github.workspace }}/dist/cache - key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-nextjs- + node-version-file: '.nvmrc' + cache: 'yarn' - name: Install dependencies run: yarn install --immutable @@ -72,7 +48,7 @@ jobs: yarn.lock - name: Publish artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: fuelrats-com path: fuelrats-com.tar.gz @@ -87,7 +63,7 @@ jobs: steps: - name: Download artifact - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: fuelrats-com @@ -96,27 +72,11 @@ jobs: tar -xzf fuelrats-com.tar.gz rm fuelrats-com.tar.gz - - name: Read `.nvmrc` - run: echo "::set-output name=nvmrc::$(cat .nvmrc)" - id: nvm - - name: Use Node.js (.nvmrc) - uses: actions/setup-node@v1 - with: - node-version: "${{ steps.nvm.outputs.nvmrc }}" - - - name: Read `yarn cache dir` - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - - - name: Load yarn cache - uses: actions/cache@v2 - id: yarn-cache + uses: actions/setup-node@v4 with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- + node-version-file: '.nvmrc' + cache: 'yarn' - name: Install dependencies run: yarn install --immutable diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 65e9c1679..5d7615b63 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -11,78 +11,39 @@ jobs: name: Lint steps: - name: Checkout - uses: actions/checkout@v2 - - - name: Read `.nvmrc` - run: echo "::set-output name=nvmrc::$(cat .nvmrc)" - id: nvm + uses: actions/checkout@v4 - name: Use Node.js (.nvmrc) - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: - node-version: "${{ steps.nvm.outputs.nvmrc }}" - - - name: Read `yarn cache dir` - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - - - name: Load yarn cache - uses: actions/cache@v2 - id: yarn-cache - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- + node-version-file: '.nvmrc' + cache: 'yarn' - name: Install dependencies run: yarn install --immutable - name: Lint - uses: wearerequired/lint-action@v1.9.0 + uses: wearerequired/lint-action@v2.3.0 with: github_token: ${{ secrets.github_token }} eslint: true eslint_args: "--max-warnings 0" stylelint: true stylelint_args: "--max-warnings 0" + stylelint_extensions: "css,sass,scss" build: runs-on: ubuntu-latest name: Build Test steps: - name: Checkout - uses: actions/checkout@v2 - - - name: Read `.nvmrc` - run: echo "::set-output name=nvmrc::$(cat .nvmrc)" - id: nvm + uses: actions/checkout@v4 - name: Use Node.js (.nvmrc) - uses: actions/setup-node@v1 - with: - node-version: "${{ steps.nvm.outputs.nvmrc }}" - - - name: Read `yarn cache dir` - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - - - name: Load yarn cache - uses: actions/cache@v2 - id: yarn-cache - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - - name: Load Next.js cache - uses: actions/cache@v2 + uses: actions/setup-node@v4 with: - path: ${{ github.workspace }}/dist/cache - key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-nextjs- + node-version-file: '.nvmrc' + cache: 'yarn' - name: Install dependencies run: yarn install --immutable From 8f50823ce0e2b61c7ecf23e68bbe7ac387f7d629 Mon Sep 17 00:00:00 2001 From: Cameron Welter Date: Thu, 31 Oct 2024 21:40:03 -0400 Subject: [PATCH 06/13] update caniuse --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index b885248f1..3f6e275d0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3511,9 +3511,9 @@ __metadata: linkType: hard "caniuse-lite@npm:^1.0.30001202, caniuse-lite@npm:^1.0.30001219, caniuse-lite@npm:^1.0.30001228, caniuse-lite@npm:^1.0.30001272, caniuse-lite@npm:^1.0.30001286, caniuse-lite@npm:^1.0.30001287": - version: 1.0.30001384 - resolution: "caniuse-lite@npm:1.0.30001384" - checksum: 396f3fc70555e71202754dd2821311a5713294d6fb1a82713bf476d9da4a3530bc893fb4eb3c124a0ad545e0af225cdb9d1fd7f25236714e695157e82e395001 + version: 1.0.30001676 + resolution: "caniuse-lite@npm:1.0.30001676" + checksum: c972232e4b3240865760ea8d29805cea7af69bd91e258a3e864e34a2b369ce6e6b69469cb39f008de593166965350e5370e6cde91fb58c02209259d8a2204fdf languageName: node linkType: hard From 3956f3e11990cab981a169d67d319a588533a6b7 Mon Sep 17 00:00:00 2001 From: Cameron Welter Date: Thu, 31 Oct 2024 21:50:05 -0400 Subject: [PATCH 07/13] re-add next cache --- .github/workflows/deploy.yml | 7 +++++++ .github/workflows/pull_request.yml | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f95212176..15a804b08 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -24,6 +24,13 @@ jobs: - name: Install dependencies run: yarn install --immutable + - name: Load Next Cache + uses: actions/cache@v4 + with: + path: ${{ github.workspace }}/dist/cache + key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} + restore-keys: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}- + - name: Build run: yarn build env: diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 5d7615b63..857b0a502 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -45,6 +45,13 @@ jobs: node-version-file: '.nvmrc' cache: 'yarn' + - name: Load Next Cache + uses: actions/cache@v4 + with: + path: ${{ github.workspace }}/dist/cache + key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} + restore-keys: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}- + - name: Install dependencies run: yarn install --immutable From dad54bad03cb92ae5d3a6656a4c827a78f5dd99a Mon Sep 17 00:00:00 2001 From: Dan Griffiths Date: Sun, 3 Nov 2024 01:18:39 -0600 Subject: [PATCH 08/13] Add profile option to change email address Signed-off-by: Dan Griffiths --- .../ChangeEmailModal/ChangeEmailMessageBox.js | 42 ++++++ .../ChangeEmailModal/ChangeEmailModal.js | 127 ++++++++++++++++++ src/components/ChangeEmailModal/index.js | 1 + src/components/ProfileHeader/ProfileHeader.js | 16 +++ src/store/actionTypes.js | 9 ++ src/store/actions/authentication.js | 11 ++ 6 files changed, 206 insertions(+) create mode 100644 src/components/ChangeEmailModal/ChangeEmailMessageBox.js create mode 100644 src/components/ChangeEmailModal/ChangeEmailModal.js create mode 100644 src/components/ChangeEmailModal/index.js diff --git a/src/components/ChangeEmailModal/ChangeEmailMessageBox.js b/src/components/ChangeEmailModal/ChangeEmailMessageBox.js new file mode 100644 index 000000000..6b0d8186f --- /dev/null +++ b/src/components/ChangeEmailModal/ChangeEmailMessageBox.js @@ -0,0 +1,42 @@ +import PropTypes from 'prop-types' + +import ApiErrorBox from '~/components/MessageBox/ApiErrorBox' + +import MessageBox from '../MessageBox' + + + + + +function getErrorText (error) { + switch (error.status) { + default: + return undefined + } +} + +function ChangeEmailMessageBox (props) { + const { result } = props + + return result.success + ? ( + + {'E-Mail changed! Please login to continue.'} + + ) + : ( + + ) +} + +ChangeEmailMessageBox.propTypes = { + result: PropTypes.object, +} + + + + + +export default ChangeEmailMessageBox diff --git a/src/components/ChangeEmailModal/ChangeEmailModal.js b/src/components/ChangeEmailModal/ChangeEmailModal.js new file mode 100644 index 000000000..82ee523c2 --- /dev/null +++ b/src/components/ChangeEmailModal/ChangeEmailModal.js @@ -0,0 +1,127 @@ +import Router from 'next/router' +import PropTypes from 'prop-types' +import { useCallback, useMemo, useState } from 'react' +import { useDispatch, useSelector } from 'react-redux' + +import asModal, { ModalContent, ModalFooter } from '~/components/asModal' +import EmailFieldset from '~/components/Fieldsets/EmailFieldset' +import useForm from '~/hooks/useForm' +import { changeEmail } from '~/store/actions/authentication' +import { logout } from '~/store/actions/session' +import { + selectCurrentUserId, + selectUserById, + withCurrentUserId, +} from '~/store/selectors' +import getResponseError from '~/util/getResponseError' + +import ChangeEmailMessageBox from './ChangeEmailMessageBox' + +// Component Constants +const SUBMIT_AUTO_CLOSE_DELAY_TIME = 3000 + + + + + +function ChangeEmailModal (props) { + const { + onClose, + isOpen, + } = props + + const [result, setResult] = useState({}) + const { email } = useSelector(withCurrentUserId(selectUserById))?.attributes ?? {} + + const dispatch = useDispatch() + const onSubmit = useCallback(async (formData) => { + if (result.submitted) { + setResult({ submitted: true }) + } + const response = await dispatch(changeEmail(formData)) + + const error = getResponseError(response) + + setResult({ + error, + success: !error, + submitted: true, + }) + + if (!error) { + setTimeout(() => { + if (isOpen) { + onClose() + } + }, SUBMIT_AUTO_CLOSE_DELAY_TIME) + + await dispatch(logout()) + Router.reload() + } + }, [dispatch, isOpen, onClose, result.submitted]) + + + const userId = useSelector(selectCurrentUserId) + const data = useMemo(() => { + return { + id: userId, + attributes: { + email: '', + }, + } + }, [userId]) + + const { Form, submitting, canSubmit } = useForm({ data, onSubmit }) + + return ( + + + + { + !result.submitted && ( +
+
+ {'Current E-Mail: '} + {email} +
+ {'Enter the new e-mail address you would like to associate with your account below.'} +
+ ) + } + + + + +
+
+ +
+ + + ) +} + +ChangeEmailModal.propTypes = { + isOpen: PropTypes.any, + onClose: PropTypes.func.isRequired, +} + + + + + +export default asModal({ + className: 'email-change-dialog', + title: 'Change E-Mail Address', +})(ChangeEmailModal) diff --git a/src/components/ChangeEmailModal/index.js b/src/components/ChangeEmailModal/index.js new file mode 100644 index 000000000..05047539e --- /dev/null +++ b/src/components/ChangeEmailModal/index.js @@ -0,0 +1 @@ +export { default } from './ChangeEmailModal' diff --git a/src/components/ProfileHeader/ProfileHeader.js b/src/components/ProfileHeader/ProfileHeader.js index d6871be2e..256e03ebc 100644 --- a/src/components/ProfileHeader/ProfileHeader.js +++ b/src/components/ProfileHeader/ProfileHeader.js @@ -11,6 +11,7 @@ import { } from '~/store/selectors' import formatAsEliteDateTime from '~/util/date/formatAsEliteDateTime' +import ChangeEmailModal from '../ChangeEmailModal' import ChangePasswordModal from '../ChangePasswordModal' import DisableProfileModal from '../DisableProfileModal' import ProfileUserAvatar from '../ProfileUserAvatar' @@ -21,9 +22,16 @@ import UnverifiedUserBanner from './UnverifiedUserBanner' function ProfileHeader () { + const [showChangeEmail, setShowChangeEmail] = useState(false) const [showChangePassword, setShowChangePassword] = useState(false) const [showDisableProfile, setShowDisableProfile] = useState(false) + const handleToggleChangeEmail = useCallback(() => { + setShowChangeEmail((state) => { + return !state + }) + }, []) + const handleToggleChangePassword = useCallback(() => { setShowChangePassword((state) => { return !state @@ -77,6 +85,11 @@ function ProfileHeader () {
+
+ diff --git a/src/store/actionTypes.js b/src/store/actionTypes.js index ead0ed145..f73927d2b 100644 --- a/src/store/actionTypes.js +++ b/src/store/actionTypes.js @@ -97,6 +97,14 @@ const oauth = { +const emails = { + update: 'emails/update', +} + + + + + const passwords = { reset: 'passwords/reset', requestReset: 'passwords/requestReset', @@ -171,6 +179,7 @@ const actionTypes = { leaderboard, nicknames, oauth, + emails, passwords, rats, rescues, diff --git a/src/store/actions/authentication.js b/src/store/actions/authentication.js index a8be50b23..54e2ba3f2 100644 --- a/src/store/actions/authentication.js +++ b/src/store/actions/authentication.js @@ -19,6 +19,17 @@ const SESSION_TOKEN_LENGTH = 365 // days +export const changeEmail = ({ id, ...data }) => { + return frApiPlainRequest( + actionTypes.emails.update, + { + url: `/users/${id}/email`, + method: 'patch', + data: createRequestBody('email-changes', data), + }, + ) +} + export const changePassword = ({ id, ...data }) => { From a7a928cd8bfe98206413b01c3a447fc7126a7576 Mon Sep 17 00:00:00 2001 From: Dan Griffiths Date: Sun, 3 Nov 2024 17:47:24 -0600 Subject: [PATCH 09/13] First pass at adding an About section Signed-off-by: Dan Griffiths --- src/components/Header/Header.js | 8 + src/components/Quote/Quote.js | 50 ++++ src/components/Quote/Quote.module.scss | 31 +++ src/components/Quote/index.js | 1 + src/pages/history/index.js | 97 ++++++++ src/pages/vision/index.js | 249 ++++++++++++++++++++ src/scss/_pages.scss | 2 + src/scss/pages/_history.scss | 14 ++ src/scss/pages/_vision.scss | 21 ++ src/util/fontawesome/library.js | 3 +- src/util/getInitialProps/resolvePageMeta.js | 2 +- 11 files changed, 476 insertions(+), 2 deletions(-) create mode 100644 src/components/Quote/Quote.js create mode 100644 src/components/Quote/Quote.module.scss create mode 100644 src/components/Quote/index.js create mode 100644 src/pages/history/index.js create mode 100644 src/pages/vision/index.js create mode 100644 src/scss/pages/_history.scss create mode 100644 src/scss/pages/_vision.scss diff --git a/src/components/Header/Header.js b/src/components/Header/Header.js index b061f2389..4ae168f77 100644 --- a/src/components/Header/Header.js +++ b/src/components/Header/Header.js @@ -55,6 +55,14 @@ function Header () {