Skip to content

Commit

Permalink
Group LEAs in selector
Browse files Browse the repository at this point in the history
  • Loading branch information
tewson committed Apr 9, 2024
1 parent 748396d commit 1f2249c
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions src/components/AreaSelector.astro
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,28 @@ const { dccElectoralAreaNames, fingalElectoralAreaNames } = Astro.props;
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg p-2 block w-full"
>
<option disabled selected>Choose your electoral area</option>
<option disabled>{LOCAL_AUTHORITY.DUBLIN_CITY_COUNCIL}</option>
{
dccElectoralAreaNames.map((electoralAreaName) => (
<option
value={`${lodash.kebabCase(LOCAL_AUTHORITY.DUBLIN_CITY_COUNCIL)}/${lodash.kebabCase(electoralAreaName)}`}
>
{electoralAreaName}
</option>
))
}
<option disabled>{LOCAL_AUTHORITY.FINGAL_COUNTY_COUNCIL}</option>
{
fingalElectoralAreaNames.map((electoralAreaName) => (
<option
value={`${lodash.kebabCase(LOCAL_AUTHORITY.FINGAL_COUNTY_COUNCIL)}/${lodash.kebabCase(electoralAreaName)}`}
>
{electoralAreaName}
</option>
))
}
<optgroup label={LOCAL_AUTHORITY.DUBLIN_CITY_COUNCIL}>
{
dccElectoralAreaNames.map((electoralAreaName) => (
<option
value={`${lodash.kebabCase(LOCAL_AUTHORITY.DUBLIN_CITY_COUNCIL)}/${lodash.kebabCase(electoralAreaName)}`}
>
{electoralAreaName}
</option>
))
}
</optgroup>
<optgroup label={LOCAL_AUTHORITY.FINGAL_COUNTY_COUNCIL}>
{
fingalElectoralAreaNames.map((electoralAreaName) => (
<option
value={`${lodash.kebabCase(LOCAL_AUTHORITY.FINGAL_COUNTY_COUNCIL)}/${lodash.kebabCase(electoralAreaName)}`}
>
{electoralAreaName}
</option>
))
}
</optgroup>
</select>
<script>
const selectElement = document.querySelector("select[name=electoral-area]");
Expand Down

0 comments on commit 1f2249c

Please sign in to comment.