Skip to content

Commit

Permalink
Merge pull request #206 from makinosp/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
makinosp authored Nov 15, 2024
2 parents 180620b + a162696 commit ab40564
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 33 deletions.
18 changes: 18 additions & 0 deletions PrivacyPolicy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Privacy Policy

## About the App

This application is a tool that uses the VRChat Web API to display and manage information related to VRChat accounts. The app respects user privacy and operates in accordance with the policies outlined below.

## Collection of Personal Information

This application does not collect, store, or share any personal information from users. All data is obtained through the VRChat Web API and used only within the app.

## Handling of Authentication Information

The app uses VRChat authentication tokens to access the API. These tokens are securely stored on the device and are not shared with any third parties.

## VRChat Privacy Policy

When using the VRChat API, users must comply with VRChat’s Privacy Policy. Please refer to the following link for details:
[VRChat Privacy Policy](https://hello.vrchat.com/privacy)
33 changes: 33 additions & 0 deletions harmonie/Components/GeometricScreen.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// GeometricScreen.swift
// Harmonie
//
// Created by makinosp on 2024/11/15.
//

import SwiftUICore

struct GeometricScreen<Content>: View where Content: View {
private let content: () -> Content
private let action: (_ geometry: GeometryProxy) -> Void

init(
@ViewBuilder content: @escaping () -> Content,
action: @escaping (_ geometry: GeometryProxy) -> Void
) {
self.content = content
self.action = action
}

var body: some View {
GeometryReader { geometry in
content()
.onChange(of: geometry) {
action(geometry)
}
.onAppear {
action(geometry)
}
}
}
}
38 changes: 16 additions & 22 deletions harmonie/Views/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,23 @@ struct ContentView: View {
@Environment(FavoriteViewModel.self) var favoriteVM: FavoriteViewModel

var body: some View {
GeometryReader { geometry in
Group {
switch appVM.step {
case .initializing:
ProgressScreen()
.task {
appVM.step = await appVM.setup(service: appVM.services.authenticationService)
}
.errorAlert()
case .loggingIn:
LoginView()
.errorAlert()
case .done:
MainTabView()
.errorAlert()
}
}
.onChange(of: geometry) {
setScreenSize(geometry)
}
.onAppear {
setScreenSize(geometry)
GeometricScreen {
switch appVM.step {
case .initializing:
ProgressScreen()
.task {
appVM.step = await appVM.setup(service: appVM.services.authenticationService)
}
.errorAlert()
case .loggingIn:
LoginView()
.errorAlert()
case .done:
MainTabView()
.errorAlert()
}
} action: { geometry in
setScreenSize(geometry)
}
}

Expand Down
1 change: 1 addition & 0 deletions harmonie/Views/Location/LocationsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ struct LocationsView: View {
}
}
}
.safeAreaPadding(.top, 20)
.background(Color(.systemGroupedBackground))
.setColumn(appVM.screenSize)
}
Expand Down
22 changes: 11 additions & 11 deletions harmonie/Views/MainTabView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import VRCKit

struct MainTabView: View {
@Environment(\.scenePhase) var scenePhase
@Environment(\.horizontalSizeClass) var defaultHorizontalSizeClass
@Environment(AppViewModel.self) var appVM: AppViewModel
@Environment(FriendViewModel.self) var friendVM: FriendViewModel
@Environment(FavoriteViewModel.self) var favoriteVM: FavoriteViewModel
Expand Down Expand Up @@ -48,15 +49,6 @@ extension MainTabViewSegment {
case .settings: SettingsView()
}
}

var label: Label<Text, Image> {
Label(description, systemImage: icon.systemName)
}

@available(iOS 18, *)
var tab: some TabContent {
Tab(description, systemImage: icon.systemName, value: self) { content }
}
}

@MainActor
Expand Down Expand Up @@ -85,17 +77,25 @@ extension MainTabView {
tabSegment.content
.tag(tabSegment)
.tabItem {
tabSegment.label
Label(
tabSegment.description,
systemImage: tabSegment.icon.systemName
)
}
}
}
}

@available(iOS 18, *) private var tabView: some View {
TabView(selection: $selection) {
return ForEach(MainTabViewSegment.allCases) { $0.tab }
ForEach(MainTabViewSegment.allCases) { segment in
Tab(segment.description, systemImage: segment.icon.systemName, value: segment) {
segment.content.environment(\.horizontalSizeClass, defaultHorizontalSizeClass)
}
}
}
.tabViewStyle(.sidebarAdaptable)
.environment(\.horizontalSizeClass, .compact)
}

private func fetchFriendsTask() async {
Expand Down

0 comments on commit ab40564

Please sign in to comment.