Skip to content

Commit

Permalink
Remove redundant fragments
Browse files Browse the repository at this point in the history
  • Loading branch information
johannbm committed Aug 29, 2023
1 parent 55bc297 commit 9efb571
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 71 deletions.
70 changes: 34 additions & 36 deletions apps/frontend/src/components/team/ModalContactAllTeams.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,43 +104,41 @@ const getContactAddress = async (productTeam: ProductTeamResponse) => {
export const ModalContactAllTeams = (properties: ModalTeamProperties) => {
const { onClose, title, isOpen, teams } = properties;
return (
<>
<Modal className={styles.modalStyles} header={{ heading: title }} onClose={onClose} open={isOpen}>
<Modal.Body>
<Detail
className={css`
font-size: 16px;
`}
<Modal className={styles.modalStyles} header={{ heading: title }} onClose={onClose} open={isOpen}>
<Modal.Body>
<Detail
className={css`
font-size: 16px;
`}
>
Hvis "Åpne e-postklient" knappen ikke fungerer bruk "Kopier e-poster" knappen og lim disse inn i din
e-postklient
</Detail>
<div
className={css`
display: flex;
flex-direction: column;
align-items: center;
`}
>
<Button
className={styles.buttonStyle}
onClick={async () => {
await contactTeamsOutlook(teams);
}}
>
Hvis "Åpne e-postklient" knappen ikke fungerer bruk "Kopier e-poster" knappen og lim disse inn i din
e-postklient
</Detail>
<div
className={css`
display: flex;
flex-direction: column;
align-items: center;
`}
Åpne e-postklient
</Button>
<Button
className={styles.buttonStyle}
onClick={async () => {
await contactTeamsCopy(teams);
}}
>
<Button
className={styles.buttonStyle}
onClick={async () => {
await contactTeamsOutlook(teams);
}}
>
Åpne e-postklient
</Button>
<Button
className={styles.buttonStyle}
onClick={async () => {
await contactTeamsCopy(teams);
}}
>
Kopier e-poster
</Button>
</div>
</Modal.Body>
</Modal>
</>
Kopier e-poster
</Button>
</div>
</Modal.Body>
</Modal>
);
};
4 changes: 1 addition & 3 deletions apps/frontend/src/components/team/ShortSummarySection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ function TeamOwner(properties: { teamOwner?: Resource; area?: ProductArea }) {
const teamOwner = properties.teamOwner;

return (
<>
<TextWithLabel label="Teameier" text={teamOwner ? <TeamOwnerResource resource={teamOwner} /> : "Ingen eier"} />
</>
<TextWithLabel label="Teameier" text={teamOwner ? <TeamOwnerResource resource={teamOwner} /> : "Ingen eier"} />
);
}

Expand Down
47 changes: 23 additions & 24 deletions apps/frontend/src/pages/area/ModalArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -379,30 +379,29 @@ export const ModalArea = (properties: ModalAreaProperties) => {
`}
>
{resourceList.map((rl) => (
<>
<div
className={css`
display: flex;
justify-content: space-between;
align-items: center;
margin-left: 50%;
margin-bottom: 1rem;
`}
>
<BodyShort size="medium">
<b>{rl.fullName}</b> - ({rl.navIdent})
</BodyShort>
<Button
icon={<TrashIcon aria-hidden />}
onClick={() => {
const newArray = resourceList.filter((r) => r.navIdent !== rl.navIdent);
setResourceList([...newArray]);
}}
size="small"
variant="tertiary"
></Button>
</div>
</>
<div
className={css`
display: flex;
justify-content: space-between;
align-items: center;
margin-left: 50%;
margin-bottom: 1rem;
`}
key={rl.navIdent}
>
<BodyShort size="medium">
<b>{rl.fullName}</b> - ({rl.navIdent})
</BodyShort>
<Button
icon={<TrashIcon aria-hidden />}
onClick={() => {
const newArray = resourceList.filter((r) => r.navIdent !== rl.navIdent);
setResourceList([...newArray]);
}}
size="small"
variant="tertiary"
></Button>
</div>
))}
</div>
</div>
Expand Down
14 changes: 6 additions & 8 deletions apps/frontend/src/pages/location/LocationPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,12 @@ export const LocationPage = () => {
return (
<Fragment>
{!loading && locationBuilding && locationStats && (
<>
<BuildingInfo
locationBuilding={locationBuilding}
locationCode={parameters.locationCode || ""}
locationStats={locationStats.locationSummaryMap}
sectionList={locationBuilding.subLocations || []}
/>
</>
<BuildingInfo
locationBuilding={locationBuilding}
locationCode={parameters.locationCode || ""}
locationStats={locationStats.locationSummaryMap}
sectionList={locationBuilding.subLocations || []}
/>
)}
{parameters.locationCode && locationSection && locationStats && !loading && (
<BuildingFloors locationStats={locationStats.locationSummaryMap} section={locationSection} />
Expand Down

0 comments on commit 9efb571

Please sign in to comment.