Upgrade design & moved backend here & login and settings work with api

This commit is contained in:
2024-09-29 18:04:41 +02:00
parent 42d3212624
commit f2d1eb4289
43 changed files with 1881 additions and 359 deletions
+68
View File
@@ -0,0 +1,68 @@
'use client';
// ---------------------------------------------------------------------------------------------------------------------
// Imports
// ---------------------------------------------------------------------------------------------------------------------
// --------------------------------------------------- Components ------------------------------------------------------
import { DeckGL } from 'deck.gl';
import { Map } from 'react-map-gl';
// ---------------------------------------------------------------------------------------------------------------------
// -------------------------------------------------- Hooks & Utils ----------------------------------------------------
import { useData } from './hooks/useData';
// ---------------------------------------------------------------------------------------------------------------------
// ------------------------------------------------- Assets & Styles ---------------------------------------------------
import HeartIcon from '@/assets/HeartIcon';
import 'mapbox-gl/dist/mapbox-gl.css';
import './styles.scss';
// ---------------------------------------------------------------------------------------------------------------------
const Home = () => {
const { canUseGeolocation, geoError, initialState } = useData();
if (!canUseGeolocation && !geoError) {
return <p className='appMessage'>Chargement...</p>;
}
if (!canUseGeolocation && geoError) {
return (
<p className='appMessage'>
Nous avons besoin d&apos;accéder à votre position pour pouvoir
utiliser l&apos;application.
</p>
);
}
return (
<div className='mapContainer'>
<DeckGL
initialViewState={initialState}
layers={[]}
controller
useDevicePixels={false}
getCursor={({ isDragging }) =>
isDragging ? 'grabbing' : 'grab'
}
>
<Map
logoPosition='bottom-right'
style={{
width: '100%',
height: '100%',
}}
mapboxAccessToken={process.env.MAPBOX_TOKEN}
mapStyle={'mapbox://styles/mapbox/standard'}
preserveDrawingBuffer
></Map>
</DeckGL>
<button className='dropLove'>
<HeartIcon />
Placer un love
</button>
</div>
);
};
export default Home;