Skip to content

Commit

Permalink
[797] Code refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
PAVANA809 committed Oct 9, 2024
1 parent baf67ca commit d6f3305
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 26 deletions.
28 changes: 5 additions & 23 deletions frontend/src/components/SpeciesSection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ export default function SpeciesSection({ species, setSpecies, isValidForm }) {
<div>
<h4>
<FormattedMessage id="SPECIES" />
<span style={{ color: "red" }}>
<FormattedMessage id="REQUIRED_ASTERISK" />
</span>
<span style={{ color: "red" }}> *</span>
</h4>
<p>
<FormattedMessage id="SPECIES_REQUIRED_IA_WARNING" />
Expand All @@ -29,17 +27,9 @@ export default function SpeciesSection({ species, setSpecies, isValidForm }) {
<Form.Group>
<Form.Label>
<FormattedMessage id="SPECIES" />
<span style={{ color: "red" }}>
<FormattedMessage id="REQUIRED_ASTERISK" />
</span>
<span style={{ color: "red" }}> *</span>
</Form.Label>
<div
style={{
position: "relative",
display: "inline-block",
width: "100%",
}}
>
<div className="position-relative d-inline-block w-100">
<Form.Control
as="select"
required="true"
Expand All @@ -59,16 +49,8 @@ export default function SpeciesSection({ species, setSpecies, isValidForm }) {
</Form.Control>

<i
className="bi bi bi-chevron-down"
style={{
position: "absolute",
right: "10px",
top: "50%",
transform: "translateY(-50%)",
pointerEvents: "none",
fontSize: "1em",
color: "#6c757d",
}}
className="bi bi-chevron-down position-absolute top-50 translate-middle-y text-secondary"
style={{ right: "10px", pointerEvents: "none" }}
></i>
</div>
{!isValidForm && !species && (
Expand Down
4 changes: 1 addition & 3 deletions frontend/src/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,5 @@
"EMPTY_REQUIRED_FIELD": "Empty Required Field",
"IMAGES_REQUIRED_ANON_WARNING": "Images are required for anonymous submission. Add images or sign in.",
"CONTACT_OTHERS": "For others",
"EMPTY_REQUIRED_WARNING": "This field cannot be empty",
"REQUIRED_ASTERISK": " *",
"UNKNOWN": "Unknown"
"EMPTY_REQUIRED_WARNING": "This field cannot be empty"
}

0 comments on commit d6f3305

Please sign in to comment.