Skip to content

Commit

Permalink
Pr feedback fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vdegraaf committed Jan 13, 2025
1 parent 63a86f4 commit b367b6d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { BaseLayer } from './BaseLayer'

describe('BaseLayer', () => {
it('renders the component', () => {
const { container } = render(<BaseLayer />)
const { container } = render(<BaseLayer setCoordinates={() => {}} />)
expect(container.firstChild).toBeInTheDocument()
})
})
Expand Down
16 changes: 2 additions & 14 deletions apps/public/src/app/(map)/locatie/kies/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

import { Grid } from '@amsterdam/design-system-react'
import dynamic from 'next/dynamic'
import { useEffect, useState } from 'react'
import { useState } from 'react'

import { SideBar } from './_components/SideBar/SideBar'
import { reverseGeocodeService } from './utils.ts/reverse-geocode-service'

export type Coordinates = { lat: number; lon: number }

Expand All @@ -16,23 +15,12 @@ const Map = dynamic(() => import('./_components/BaseLayer').then((module) => mod

const KiesLocatie = () => {
const [coordinates, setCoordinates] = useState<Coordinates | null>(null)
const [address, setAddress] = useState<string | null>(null)

useEffect(() => {
const getAddress = async () => {
if (!coordinates) return
const result = await reverseGeocodeService({ lat: coordinates.lat, lon: coordinates.lon })

setAddress(result.response.docs[0].weergavenaam)
}
getAddress()
}, [coordinates])

return (
// TODO: Create a compact grid with padding 24px and the map that overflows it. https://designsystem.amsterdam/?path=/docs/brand-design-tokens-grid--docs
<Grid>
<Grid.Cell span={4}>
<SideBar address={address} />
<SideBar coordinates={coordinates} />
</Grid.Cell>
<Grid.Cell span={8}>
<Map setCoordinates={setCoordinates} />
Expand Down

0 comments on commit b367b6d

Please sign in to comment.