Skip to content

Commit

Permalink
fix: ou-tree field styling
Browse files Browse the repository at this point in the history
  • Loading branch information
cooper-joe committed Dec 17, 2024
1 parent d153156 commit f0e6d18
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
8 changes: 8 additions & 0 deletions src/components/form/fields/OrganisationUnitField.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.OrganisationUnitTreeWrapper {
padding: var(--spacers-dp4);
border: 1px solid var(--colors-grey300);
border-radius: 3px;
width: 640px;
max-height: 800px;
overflow: auto;
}
17 changes: 10 additions & 7 deletions src/components/form/fields/OrganisationUnitField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
import React from 'react'
import { useField } from 'react-final-form'
import { useCurrentUserRootOrgUnits } from '../../../lib/user/currentUserStore'
import classes from './OrganisationUnitField.module.css'

type OrganisationUnitFieldProps = {
name?: string
Expand Down Expand Up @@ -66,13 +67,15 @@ export const OrganisationUnitField = ({
error={meta.touched && meta.error}
validationText={meta.touched && meta.error}
>
<OrganisationUnitTree
roots={rootIds}
singleSelection={singleSelection}
onChange={handleChange}
selected={selectedPaths}
initiallyExpanded={rootIds}
/>
<div className={classes.OrganisationUnitTreeWrapper}>
<OrganisationUnitTree
roots={rootIds}
singleSelection={singleSelection}
onChange={handleChange}
selected={selectedPaths}
initiallyExpanded={rootIds}
/>
</div>
</Field>
)
}

0 comments on commit f0e6d18

Please sign in to comment.