diff --git a/rogue-thi-app/capacitor.config.json b/rogue-thi-app/capacitor.config.json deleted file mode 100644 index f10a5c1f..00000000 --- a/rogue-thi-app/capacitor.config.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "appId": "app.neuland", - "appName": "neuland.app", - "webDir": "out", - "bundledWebRuntime": false -} diff --git a/rogue-thi-app/components/map/AttributionControl.jsx b/rogue-thi-app/components/map/AttributionControl.jsx index 32134cd5..421ba41c 100644 --- a/rogue-thi-app/components/map/AttributionControl.jsx +++ b/rogue-thi-app/components/map/AttributionControl.jsx @@ -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 diff --git a/rogue-thi-app/pages/rooms/index.jsx b/rogue-thi-app/pages/rooms/index.jsx index d0008df7..706f52bf 100644 --- a/rogue-thi-app/pages/rooms/index.jsx +++ b/rogue-thi-app/pages/rooms/index.jsx @@ -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' @@ -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 ( @@ -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, + }, + } +} diff --git a/rogue-thi-app/pages/rooms/search.jsx b/rogue-thi-app/pages/rooms/search.jsx index 724e9502..62b41b91 100644 --- a/rogue-thi-app/pages/rooms/search.jsx +++ b/rogue-thi-app/pages/rooms/search.jsx @@ -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])