Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/drawer #34

Merged
merged 3 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions android/app/capacitor.build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
dependencies {
implementation project(':capacitor-community-bluetooth-le')
implementation project(':capacitor-app')
implementation project(':capacitor-browser')
implementation project(':capacitor-geolocation')
implementation project(':capacitor-haptics')
implementation project(':capacitor-preferences')
Expand Down
3 changes: 3 additions & 0 deletions android/capacitor.settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ project(':capacitor-community-bluetooth-le').projectDir = new File('../node_modu
include ':capacitor-app'
project(':capacitor-app').projectDir = new File('../node_modules/@capacitor/app/android')

include ':capacitor-browser'
project(':capacitor-browser').projectDir = new File('../node_modules/@capacitor/browser/android')

include ':capacitor-geolocation'
project(':capacitor-geolocation').projectDir = new File('../node_modules/@capacitor/geolocation/android')

Expand Down
1 change: 1 addition & 0 deletions ios/App/App/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
return true
}


func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
Expand Down
4 changes: 3 additions & 1 deletion ios/App/App/capacitor.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
"appId": "de.reedu.senseboxbike",
"appName": "senseBox:Bike",
"webDir": "out",
"server": {}
"server": {
"url": "http://192.168.2.135:3000"
}
}
1 change: 1 addition & 0 deletions ios/App/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ def capacitor_pods
pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
pod 'CapacitorCommunityBluetoothLe', :path => '../../node_modules/@capacitor-community/bluetooth-le'
pod 'CapacitorApp', :path => '../../node_modules/@capacitor/app'
pod 'CapacitorBrowser', :path => '../../node_modules/@capacitor/browser'
pod 'CapacitorGeolocation', :path => '../../node_modules/@capacitor/geolocation'
pod 'CapacitorHaptics', :path => '../../node_modules/@capacitor/haptics'
pod 'CapacitorPreferences', :path => '../../node_modules/@capacitor/preferences'
Expand Down
8 changes: 7 additions & 1 deletion ios/App/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ PODS:
- CapacitorCordova
- CapacitorApp (5.0.6):
- Capacitor
- CapacitorBrowser (5.1.0):
- Capacitor
- CapacitorCommunityBluetoothLe (3.1.1):
- Capacitor
- CapacitorCordova (5.5.1)
Expand All @@ -18,6 +20,7 @@ PODS:
DEPENDENCIES:
- "Capacitor (from `../../node_modules/@capacitor/ios`)"
- "CapacitorApp (from `../../node_modules/@capacitor/app`)"
- "CapacitorBrowser (from `../../node_modules/@capacitor/browser`)"
- "CapacitorCommunityBluetoothLe (from `../../node_modules/@capacitor-community/bluetooth-le`)"
- "CapacitorCordova (from `../../node_modules/@capacitor/ios`)"
- "CapacitorGeolocation (from `../../node_modules/@capacitor/geolocation`)"
Expand All @@ -30,6 +33,8 @@ EXTERNAL SOURCES:
:path: "../../node_modules/@capacitor/ios"
CapacitorApp:
:path: "../../node_modules/@capacitor/app"
CapacitorBrowser:
:path: "../../node_modules/@capacitor/browser"
CapacitorCommunityBluetoothLe:
:path: "../../node_modules/@capacitor-community/bluetooth-le"
CapacitorCordova:
Expand All @@ -46,13 +51,14 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
Capacitor: 9da0a2415e3b6098511f8b5ffdb578d91ee79f8f
CapacitorApp: 024e1b1bea5f883d79f6330d309bc441c88ad04a
CapacitorBrowser: 7a0fb6a1011abfaaf2dfedfd8248f942a8eda3d6
CapacitorCommunityBluetoothLe: 86ca83c89199336039bad94f45f8363114ae1464
CapacitorCordova: e128cc7688c070ca0bfa439898a5f609da8dbcfe
CapacitorGeolocation: 7be5f77abc205c0efe319fff8587a7183e7b0240
CapacitorHaptics: 1fffc1217c7e64a472d7845be50fb0c2f7d4204c
CapacitorPreferences: f03954bcb0ff09c792909e46bff88e3183c16b10
FelixerdyBackgroundGeolocation: 1e6a92a836b58a62b20e0eb6b78bff201265deb8

PODFILE CHECKSUM: bba8950299207db0030e4a5579a05b0a869d2434
PODFILE CHECKSUM: 79469dfe9cf56c75910e3633086d611221d504b4

COCOAPODS: 1.14.0
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"@capacitor-community/bluetooth-le": "^3.1.1",
"@capacitor/android": "^5.5.1",
"@capacitor/app": "^5.0.6",
"@capacitor/browser": "^5.1.0",
"@capacitor/core": "^5.5.1",
"@capacitor/geolocation": "^5.0.6",
"@capacitor/haptics": "^5.0.6",
Expand Down
8 changes: 7 additions & 1 deletion src/app/page.tsx
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 />
</>
)
}
46 changes: 46 additions & 0 deletions src/components/Device/GeolocationPermissionDrawer.tsx
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>
)
}
Loading