|
1 | 1 | import React, { useEffect, useState } from "react"; |
2 | | -import { Form, Row, Col, Container, FormGroup, Label, Input, Alert } from "reactstrap"; |
| 2 | +import { Form, Row, Col, Container, FormGroup, Label, Input } from "reactstrap"; |
3 | 3 | import { isaacApi, useAppSelector } from "../../../../state"; |
4 | 4 | import { selectors } from "../../../../state/selectors"; |
5 | 5 | import { SchoolInput } from "../../../elements/inputs/SchoolInput"; |
@@ -71,17 +71,17 @@ export const CompetitionEntryForm = ({ handleTermsClick }: CompetitionEntryFormP |
71 | 71 | const selectedValues = selectedOptions ? selectedOptions.map((option: any) => option.value) : []; |
72 | 72 |
|
73 | 73 | if (selectedValues.length > 4) { |
74 | | - setMemberSelectionError("You can only select up to 4 students"); |
75 | | - |
76 | | - setTimeout(() => { |
77 | | - setMemberSelectionError(""); |
78 | | - }, 3000); |
| 74 | + setMemberSelectionError("Limit of 4 students reached. To select a new student, remove one first."); |
79 | 75 |
|
80 | 76 | return; |
81 | 77 | } |
82 | 78 |
|
83 | 79 | setMemberSelectionError(""); |
84 | 80 | setSelectedMembers(selectedValues); |
| 81 | + |
| 82 | + setTimeout(() => { |
| 83 | + setMemberSelectionError(""); |
| 84 | + }, 10000); |
85 | 85 | }; |
86 | 86 |
|
87 | 87 | const isSchoolValid = isSchoolValidForCompetition(); |
@@ -205,7 +205,7 @@ export const CompetitionEntryForm = ({ handleTermsClick }: CompetitionEntryFormP |
205 | 205 | <div className="entry-form-validation-tooltip"> |
206 | 206 | <div className="tooltip-content"> |
207 | 207 | <div className="tooltip-arrow"></div> |
208 | | - <div className="tooltip-icon">!</div> |
| 208 | + <img src="/assets/warning_icon.svg" alt="invalid school error" /> |
209 | 209 | <div className="tooltip-text"> |
210 | 210 | Please <a href="/account">update</a> your account details to specify your school or college. |
211 | 211 | Only teachers and students from state-funded schools in England are eligible to participate. |
@@ -300,7 +300,7 @@ export const CompetitionEntryForm = ({ handleTermsClick }: CompetitionEntryFormP |
300 | 300 | <div className="entry-form-validation-tooltip"> |
301 | 301 | <div className="tooltip-content"> |
302 | 302 | <div className="tooltip-arrow"></div> |
303 | | - <div className="tooltip-icon">!</div> |
| 303 | + <img src="/assets/warning_icon.svg" alt="no groups found error" /> |
304 | 304 | <div className="tooltip-text" style={{ color: "#000" }}> |
305 | 305 | You have not created any groups. Please{" "} |
306 | 306 | <a href="/groups" style={{ color: "#1D70B8", textDecoration: "underline" }}> |
@@ -328,9 +328,17 @@ export const CompetitionEntryForm = ({ handleTermsClick }: CompetitionEntryFormP |
328 | 328 | message="Choose 1-4 students from the selected group who worked on the submitted project." |
329 | 329 | /> |
330 | 330 | {memberSelectionError && ( |
331 | | - <Alert color="danger" className="mb-2" style={{ zIndex: 9999, position: "relative" }}> |
332 | | - {memberSelectionError} |
333 | | - </Alert> |
| 331 | + <div |
| 332 | + className="entry-form-validation-tooltip entry-form-validation-tooltip-centered mt-2" |
| 333 | + style={{ alignItems: "center" }} |
| 334 | + > |
| 335 | + <div className="tooltip-content"> |
| 336 | + <img src="/assets/warning_icon.svg" alt="member selection error" /> |
| 337 | + <div className="tooltip-text" style={{ color: "#000" }}> |
| 338 | + Limit of 4 students reached. To select a new student, remove one first. |
| 339 | + </div> |
| 340 | + </div> |
| 341 | + </div> |
334 | 342 | )} |
335 | 343 | </Label> |
336 | 344 | <Select |
@@ -389,7 +397,7 @@ export const CompetitionEntryForm = ({ handleTermsClick }: CompetitionEntryFormP |
389 | 397 | <div className="entry-form-validation-tooltip" style={{ marginTop: "12px" }}> |
390 | 398 | <div className="tooltip-content"> |
391 | 399 | <div className="tooltip-arrow"></div> |
392 | | - <div className="tooltip-icon">!</div> |
| 400 | + <img src="/assets/warning_icon.svg" alt="no members found error" /> |
393 | 401 | <div className="tooltip-text" style={{ color: "#000" }}> |
394 | 402 | No students found in the selected group. To add students go to the{" "} |
395 | 403 | <a href="/groups" style={{ color: "#1D70B8", textDecoration: "underline" }}> |
|
0 commit comments