Conditions | 1 |
Total Lines | 66 |
Code Lines | 58 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | import React from "react"; |
||
35 | |||
36 | export function EducationSubform({ |
||
37 | educationRequirement, |
||
38 | equivalentRequirment, |
||
39 | }: EducationSubformProps): React.ReactElement { |
||
40 | const intl = useIntl(); |
||
41 | |||
42 | const checkboxKey = "useAsEducationRequirement"; |
||
43 | return ( |
||
44 | <> |
||
45 | <div data-c-container="medium"> |
||
46 | <p |
||
47 | data-c-margin="top(1) bottom(1)" |
||
48 | data-c-font-size="h4" |
||
49 | data-c-font-weight="bold" |
||
50 | data-c-color="c3" |
||
51 | > |
||
52 | <FormattedMessage |
||
53 | id="experienceModal.educationSubtitle" |
||
54 | defaultMessage="Use This Experience as an Education Requirement" |
||
55 | description="Subtitle for the use-as-Education-Requirement section." |
||
56 | /> |
||
57 | </p> |
||
58 | <p data-c-margin="bottom(1)"> |
||
59 | <FormattedMessage |
||
60 | id="experienceModal.educationDescription" |
||
61 | defaultMessage="You can select the option below if you feel that this experience helps you meet some or all of the specific education requirements for this job. We've included the requirements below to help refresh your memory." |
||
62 | description="Explanation for the use-as-Education-Requirement section." |
||
63 | /> |
||
64 | </p> |
||
65 | </div> |
||
66 | <div data-c-padding="bottom(1)"> |
||
67 | <div data-c-container="medium"> |
||
68 | <div data-c-grid="gutter(all, 1) middle"> |
||
69 | <div data-c-input="checkbox(group)" data-c-grid-item="base(1of1)"> |
||
70 | <FastField |
||
71 | key={checkboxKey} |
||
72 | id={checkboxKey} |
||
73 | name={checkboxKey} |
||
74 | label={intl.formatMessage(messages.educationJustificationLabel)} |
||
75 | component={CheckboxInput} |
||
76 | grid="base(1of2" |
||
77 | /> |
||
78 | </div> |
||
79 | </div> |
||
80 | <div |
||
81 | data-c-background="gray(20)" |
||
82 | data-c-radius="rounded" |
||
83 | data-c-padding="all(1)" |
||
84 | data-c-margin="bottom(1)" |
||
85 | > |
||
86 | <p data-c-font-weight="bold">{educationRequirement.title}</p> |
||
87 | <p>{educationRequirement.description}</p> |
||
88 | <p data-c-margin="tb(1)"> |
||
89 | <FormattedMessage |
||
90 | id="experienceModal.educationSubform.or" |
||
91 | defaultMessage="OR" |
||
92 | description="Conjunction used to join alternative experience requirements (ie Experience OR Equivalent Experience)." |
||
93 | /> |
||
94 | </p> |
||
95 | <p data-c-font-weight="bold">{equivalentRequirment.title}</p> |
||
96 | <p>{equivalentRequirment.description}</p> |
||
97 | </div> |
||
98 | </div> |
||
99 | </div> |
||
100 | </> |
||
101 | ); |
||
103 |