AjobK / Seaqull

Seaqull programming blog
http://www.seaqull.com
4 stars 0 forks source link

228 reusable popup #265

Closed jerohero closed 3 years ago

jerohero commented 3 years ago

closes #228


What is it supposed to do
Adds a reusable component that allows developers to easily implement popups to show errors or other content that requires awareness. Popups are dynamic; the contents can be changed and several actions can be added. image


How can we test your branch
At the moment there is only one scenario where the popup appears. Turn off your local API and try logging in. A popup saying a network error occurred. Try interacting with this popup and see if it is working as you would expect.

Also try playing around with the popup component. The popup component is called from the loginPrompt component (line 70). image To make sure the contents are the same for popups with the same purpose (such as showing a network error), the contents are fetched from popUpData.js. image For example, if you want the close button in the popup to not contain text, you can remove the title attribute of the close action object in actions > close. The actions themselves (such as closing the popup) are defined in the parent component, so in order to change the actions of a button in a popup, you would have to change them in the parent component (loginPrompt). You could try adding the popup to another component. Just inject the PopUp component with JSX: image Then add a popup attribute to the state of the component (initialise it with null). To make the popup appear, change the popup attribute of the state. image Try to evaluate the process and consider other methods that could be more dynamic, easier to use or cleaner.


General checklist


If relevant, front-end checklist


If relevant, back-end checklist


If relevant, test these browsers


PR Rules
1. Add relevant labels.
2. Select atleast two reviewers.
3. Assign all reviewers allowed to merge the branch, including yourself.
4. If relevant to the sprint, put related issue in 'Awaiting Approval' column on project board.
5. Add to the corresponding milestone.

AjobK commented 3 years ago

Looks great! Make exit button as following when hover though

image