Skip to content

Commit

Permalink
Merge pull request #561 from Onlineberatung/bugfix/VIC-1180-preselect…
Browse files Browse the repository at this point in the history
…ed-BS-should-have-a-radio-button

fix: show radio button for preselected agency
  • Loading branch information
tarikalmashni authored Aug 4, 2022
2 parents 1c39349 + aa4716f commit e0eca66
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 13 deletions.
16 changes: 11 additions & 5 deletions src/components/agencySelection/PreselectedAgency.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as React from 'react';
import { Text } from '../text/Text';
import { AgencyDataInterface } from '../../globalState';
import { Headline } from '../headline/Headline';
import { RadioButton } from '../radioButton/RadioButton';
import { AgencyInfo } from './AgencyInfo';
import './preselectedAgency.styles';
import { AgencyLanguages } from './AgencyLanguages';
import './preselectedAgency.styles';

export interface PreselectedAgencyProps {
prefix: string;
Expand All @@ -16,13 +16,19 @@ export const PreselectedAgency = (props: PreselectedAgencyProps) => (
<div className="preselectedAgency" data-cy="show-preselected-agency">
<Headline semanticLevel="4" styleLevel="5" text={props.prefix} />
<div className="preselectedAgency__item">
<Text text={props.agencyData.name} type="standard" />
<RadioButton
name="agencySelection"
type="smaller"
value={props.agencyData.id.toString()}
checked
inputId={props.agencyData.id.toString()}
label={props.agencyData.name}
handleRadioButton={() => void 0}
/>
<AgencyInfo
agency={props.agencyData}
isProfileView={props.isProfileView}
/>
</div>
<div>
<AgencyLanguages agencyId={props.agencyData.id} />
</div>
</div>
Expand Down
26 changes: 18 additions & 8 deletions src/components/agencySelection/preselectedAgency.styles.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
$maxFormElementWidth: 320px;
$infoIconSize: 16px;

.preselectedAgency {
margin-top: 28px;
animation: fadeIn linear 0.2s;
position: relative;

.headline {
margin: 0 0 12px;
Expand All @@ -10,18 +13,25 @@ $infoIconSize: 16px;

&__item {
display: flex;
position: relative;
flex-wrap: wrap;
justify-content: space-between;
padding: 12px 0;

.text {
width: 100%;
.radioButton {
flex-basis: calc(100% - #{$infoIconSize + 1px});
min-height: unset;
}

.agencyLanguages {
margin-left: 32px;
}
}

.agencyInfo {
top: 34px;
.agencyInfo {
top: 34px;

&--above {
top: auto;
&--above {
top: auto;
}
}
}
}

0 comments on commit e0eca66

Please sign in to comment.