-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from reedu-reengineering-education/feat/drawer
Feat/drawer
- Loading branch information
Showing
17 changed files
with
380 additions
and
240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
import DeviceMapWrapper from '@/components/Device/DeviceMapWrapper' | ||
import GeolocationPermissionDrawer from '@/components/Device/GeolocationPermissionDrawer' | ||
|
||
export default function Home() { | ||
return <DeviceMapWrapper /> | ||
return ( | ||
<> | ||
<DeviceMapWrapper /> | ||
<GeolocationPermissionDrawer /> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
'use client' | ||
|
||
import { usePermissionsStore } from '@/lib/store/usePermissionsStore' | ||
import { Drawer } from 'vaul' | ||
import { Button } from '../ui/button' | ||
import SliderDrawer from '../ui/slider-drawer' | ||
|
||
export default function GeolocationPermissionDrawer() { | ||
const showGeolocationPermissionsDrawer = usePermissionsStore( | ||
state => state.showGeolocationPermissionsDrawer, | ||
) | ||
const setShowGeolocationPermissionsDrawer = usePermissionsStore( | ||
state => state.setShowGeolocationPermissionsDrawer, | ||
) | ||
const setGeolocationPermissionGranted = usePermissionsStore( | ||
state => state.setGeolocationPermissionGranted, | ||
) | ||
|
||
return ( | ||
<SliderDrawer | ||
open={showGeolocationPermissionsDrawer} | ||
onOpenChange={setShowGeolocationPermissionsDrawer} | ||
> | ||
<div className="mx-auto max-w-md"> | ||
<Drawer.Title>Geolocation permission required</Drawer.Title> | ||
|
||
<p className="my-6"> | ||
senseBox:bike erhebt Standortdaten, um deine Fahrt aufzuzeichnen und | ||
deine Positionen mit Umweltdaten zu verknüpfen, auch wenn die App | ||
geschlossen ist oder nicht verwendet wird. | ||
</p> | ||
<div className="flex w-full gap-2"> | ||
<Drawer.Close className="flex-1" asChild> | ||
<Button variant={'secondary'}>Ablehnen</Button> | ||
</Drawer.Close> | ||
<Button | ||
className="flex-1" | ||
onClick={() => setGeolocationPermissionGranted(true)} | ||
> | ||
Akzeptieren | ||
</Button> | ||
</div> | ||
</div> | ||
</SliderDrawer> | ||
) | ||
} |
Oops, something went wrong.