-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Project not found or no access rights messaging (#298)
# What's Changed? - Added 404 and access denied modals that show when project loading fails - Slightly amended the readProject request to include the project type but needs more discussion around URL structure at a later date ## Screenshots <img width="807" alt="Screenshot 2022-12-15 at 14 47 43" src="https://user-images.githubusercontent.com/88904316/207890961-d1611c4e-4a22-4a86-86c9-ba625e809dea.png"> <img width="987" alt="Screenshot 2022-12-15 at 14 45 42" src="https://user-images.githubusercontent.com/88904316/207891160-568fba87-6b50-48c3-bc65-854824b1e145.png"> <img width="811" alt="Screenshot 2022-12-15 at 14 47 03" src="https://user-images.githubusercontent.com/88904316/207891167-019c0f76-c999-4baf-8769-e4547a142dd9.png"> closes #297 Co-authored-by: loiswells97 <loiswells97@users.noreply.github.com> Co-authored-by: Lois Wells <lois.wells@raspberrypi.org> Co-authored-by: Lois Wells <88904316+loiswells97@users.noreply.github.com>
- Loading branch information
1 parent
736f288
commit f14b31f
Showing
23 changed files
with
519 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import React from "react"; | ||
import Modal from 'react-modal'; | ||
import { useDispatch, useSelector } from "react-redux"; | ||
import { useTranslation } from "react-i18next"; | ||
|
||
import Button from "../Button/Button"; | ||
import '../../Modal.scss'; | ||
import { closeAccessDeniedNoAuthModal } from "../Editor/EditorSlice"; | ||
import { CloseIcon } from "../../Icons"; | ||
import LoginButton from "../Login/LoginButton"; | ||
|
||
const AccessDeniedNoAuthModal = () => { | ||
const dispatch = useDispatch() | ||
const { t } = useTranslation(); | ||
|
||
const isModalOpen = useSelector((state) => state.editor.accessDeniedNoAuthModalShowing) | ||
const closeModal = () => dispatch(closeAccessDeniedNoAuthModal()); | ||
|
||
return ( | ||
<> | ||
<Modal | ||
isOpen={isModalOpen} | ||
onRequestClose={closeModal} | ||
className='modal-content' | ||
overlayClassName='modal-overlay' | ||
contentLabel={t('project.accessDeniedNoAuthModal.heading')} | ||
parentSelector={() => document.querySelector('#app')} | ||
appElement={document.getElementById('app') || undefined} | ||
> | ||
<div className='modal-content__header'> | ||
<h2 className='modal-content__heading'>{t('project.accessDeniedNoAuthModal.heading')}</h2> | ||
<button onClick={closeModal}> | ||
<CloseIcon/> | ||
</button> | ||
</div> | ||
<p className='modal-content__text'>{t('project.accessDeniedNoAuthModal.text')}</p> | ||
|
||
<div className='modal-content__buttons' > | ||
<a className='btn btn--secondary' href='https://projects.raspberrypi.org'>{t('project.accessDeniedNoAuthModal.projectsSiteLinkText')}</a> | ||
<LoginButton className='btn--primary' buttonText={t('project.accessDeniedNoAuthModal.loginButtonText')} /> | ||
</div> | ||
<div className='modal-content__links'> | ||
<Button buttonText = {t('project.accessDeniedNoAuthModal.newProject')} className='btn--tertiary' onClickHandler={closeModal}/> | ||
</div> | ||
</Modal> | ||
</> | ||
); | ||
} | ||
|
||
export default AccessDeniedNoAuthModal; |
Oops, something went wrong.