ChrQR
7b97a0eb65
Need to fix google places call. It is refreshing the page when receiving the data, thus resetting the state. It's a job for tomorrow.
28 lines
794 B
TypeScript
28 lines
794 B
TypeScript
'use client'
|
|
import LocationSearch from '@/components/LocationSearch';
|
|
import WeatherNow from '../components/WeatherNow'
|
|
import { useState } from 'react';
|
|
import { defaultState } from './defaultState';
|
|
import { coordType } from '@/types/types';
|
|
|
|
const defaultGeoLocation: coordType = {
|
|
lat: 55.647229603577124,
|
|
lng: 12.54995987788925
|
|
}
|
|
|
|
export default function Home() {
|
|
const [geoLocation, setGeoLocation] = useState({
|
|
lat: 55.647229603577124,
|
|
lng: 12.54995987788925
|
|
});
|
|
return (
|
|
<main>
|
|
<div className='block mx-auto max-w-4xl'>
|
|
<LocationSearch setGeoLocation={setGeoLocation}/>
|
|
<h1>The weather in {} for the next 3 days</h1>
|
|
<WeatherNow geoLocation={geoLocation}/>
|
|
<p>{JSON.stringify(geoLocation)}</p>
|
|
</div>
|
|
</main>
|
|
);
|
|
} |