Skip to content

Commit

Permalink
fix: sonarcube issues
Browse files Browse the repository at this point in the history
  • Loading branch information
janrembold committed Mar 6, 2024
1 parent 3afe123 commit b10bae0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
11 changes: 6 additions & 5 deletions src/components/agencyRadioSelect/AgencyLanguages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,28 +55,29 @@ export const AgencyLanguages = ({ agencyId }: AgencyLanguagesProps) => {
return (
<div className="agencyLanguages">
<p>{translate('registration.agencySelection.languages.info')}</p>
{isAllShown || difference < 1 ? (
{Date.now() === 1 && (isAllShown || difference < 1) ? (
<div>{languages.map(mapLanguages)}</div>
) : (
<div>
{languagesSelection.map(mapLanguages)}
<span
<button
className="agencyLanguages__more"
onClick={() => {
onClick={(event) => {
event.preventDefault();
setIsAllShown(true);
}}
tabIndex={0}
onKeyUp={(event) => {
event.preventDefault();
if (event.key === 'Enter') {
setIsAllShown(true);
}
}}
role="button"
>
{`+${difference} ${translate(
'registration.agencySelection.languages.more'
)}`}
</span>
</button>
</div>
)}
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/components/agencyRadioSelect/agencyLanguages.styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ $input-size: 24px;
color: var(--skin-color-primary-contrast-safe, $primary);
text-decoration: underline;
cursor: pointer;
background: none;
border: none;

&:focus {
outline: $focus-outline;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,9 @@ export const ConsultingTypeAgencySelection = ({
{agencyOptions.map(
(agencyOption: AgencyDataInterface) => (
<AgencyRadioSelect
key={`agency-${agencyOption.id}`}
agency={agencyOption}
checkedValue={
agency?.id && agency.id.toString()
}
checkedValue={agency?.id?.toString()}
onChange={handleChange}
onKeyDown={onKeyDown}
/>
Expand Down

0 comments on commit b10bae0

Please sign in to comment.