Skip to content

Commit

Permalink
🐛 fix room highlights (#418)
Browse files Browse the repository at this point in the history
  • Loading branch information
BuildmodeOne authored Sep 17, 2024
1 parent fe7ac30 commit ecff058
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 35 deletions.
6 changes: 0 additions & 6 deletions rogue-thi-app/capacitor.config.json

This file was deleted.

2 changes: 0 additions & 2 deletions rogue-thi-app/components/map/AttributionControl.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ export default function AttributionControl({ attribution }) {
// hides the attribution after 5 seconds
useEffect(() => {
const timeout = setTimeout(() => {
console.log('clickedOnce', clickedOnce)

// if the use opens the attribution, don't hide it
if (clickedOnce) {
return
Expand Down
47 changes: 21 additions & 26 deletions rogue-thi-app/pages/rooms/index.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import PropTypes from 'prop-types'
import React from 'react'
import { useRouter } from 'next/router'

import AppBody from '../../components/page/AppBody'
import AppContainer from '../../components/page/AppContainer'
Expand All @@ -14,35 +13,12 @@ import { useTranslation } from 'next-i18next'

import RoomMap from '../../components/map/RoomMap'

const ROOMDATA_URL = 'https://assets.neuland.app/rooms_neuland_v2.4.geojson'

// import RoomMap without SSR because react-leaflet really does not like SSR
// const RoomMap = dynamic(() => import('../../components/RoomMap'), {
// ssr: false,
// })

export async function getStaticProps({ locale }) {
const response = await fetch(ROOMDATA_URL)
const roomData = await response.json()
return {
props: {
...(await serverSideTranslations(locale ?? 'en', [
'rooms',
'common',
'api-translations',
])),
roomData,
},
}
}
const ROOM_DATA_URL = 'https://assets.neuland.app/rooms_neuland_v2.4.geojson'

/**
* Page containing the room map.
*/
export default function Rooms({ roomData }) {
const router = useRouter()
const { highlight } = router.query

export default function Rooms({ roomData, highlight }) {
const { t } = useTranslation('rooms')

return (
Expand Down Expand Up @@ -81,3 +57,22 @@ export default function Rooms({ roomData }) {
Rooms.propTypes = {
roomData: PropTypes.object,
}

export async function getServerSideProps({ locale, query }) {
const response = await fetch(ROOM_DATA_URL)
const roomData = await response.json()

const highlight = query.highlight || null

return {
props: {
...(await serverSideTranslations(locale ?? 'en', [
'rooms',
'common',
'api-translations',
])),
roomData,
highlight,
},
}
}
1 change: 0 additions & 1 deletion rogue-thi-app/pages/rooms/search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ export default function RoomSearch() {

const rooms = await filterRooms(date, time, building, duration)

console.log(`Found ${rooms.length} results`)
setFilterResults(rooms)
}, [building, date, duration, time])

Expand Down

0 comments on commit ecff058

Please sign in to comment.