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

편행 리뷰 남기기 버튼 클릭 시 이동하는 기능 추가 #121

Merged
merged 1 commit into from
Mar 22, 2024
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
12 changes: 12 additions & 0 deletions PyeonHaeng-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
BAB5CF252B6B7C5A008B24BF /* Services.swift in Sources */ = {isa = PBXBuildFile; fileRef = BAB5CF242B6B7C5A008B24BF /* Services.swift */; };
BAB5CF272B6B7CF3008B24BF /* HomeViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BAB5CF262B6B7CF3008B24BF /* HomeViewModel.swift */; };
BAB720342B9325F200C2CA1A /* PromotionSelectBottomSheetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BAB720332B9325F200C2CA1A /* PromotionSelectBottomSheetView.swift */; };
BAB8C3AD2BAC7A11003DF3CC /* LeaveReviewView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BAB8C3AC2BAC7A11003DF3CC /* LeaveReviewView.swift */; };
BAE159D82B65FA6F002DCF94 /* HomeProductDetailSelectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BAE159D72B65FA6F002DCF94 /* HomeProductDetailSelectionView.swift */; };
BAE159DA2B65FC35002DCF94 /* HomeProductListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BAE159D92B65FC35002DCF94 /* HomeProductListView.swift */; };
BAE159DE2B663A9A002DCF94 /* HomeProductSorterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BAE159DD2B663A9A002DCF94 /* HomeProductSorterView.swift */; };
Expand Down Expand Up @@ -123,6 +124,7 @@
BAB5CF242B6B7C5A008B24BF /* Services.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Services.swift; sourceTree = "<group>"; };
BAB5CF262B6B7CF3008B24BF /* HomeViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeViewModel.swift; sourceTree = "<group>"; };
BAB720332B9325F200C2CA1A /* PromotionSelectBottomSheetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PromotionSelectBottomSheetView.swift; sourceTree = "<group>"; };
BAB8C3AC2BAC7A11003DF3CC /* LeaveReviewView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LeaveReviewView.swift; sourceTree = "<group>"; };
BABFEA6F2B6399C30084C0EC /* Shared */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = Shared; sourceTree = "<group>"; };
BAE159D72B65FA6F002DCF94 /* HomeProductDetailSelectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeProductDetailSelectionView.swift; sourceTree = "<group>"; };
BAE159D92B65FC35002DCF94 /* HomeProductListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeProductListView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -307,6 +309,7 @@
BA28F18C2B6155EC0052855E /* SettingsScene */ = {
isa = PBXGroup;
children = (
BAB8C3AB2BAC7A09003DF3CC /* LeaveReview */,
BA097F0C2B9CA820002D3E1E /* Mail */,
BA1688EB2B99D0B700A8F462 /* Notice */,
BA28F18D2B6156420052855E /* SettingsView.swift */,
Expand Down Expand Up @@ -427,6 +430,14 @@
path = View;
sourceTree = "<group>";
};
BAB8C3AB2BAC7A09003DF3CC /* LeaveReview */ = {
isa = PBXGroup;
children = (
BAB8C3AC2BAC7A11003DF3CC /* LeaveReviewView.swift */,
);
path = LeaveReview;
sourceTree = "<group>";
};
E5462C6B2B65CF7800E9FDF2 /* Components */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -649,6 +660,7 @@
E50176262B6A204F0098D1BE /* ProductInfoLineGraphView.swift in Sources */,
BAB5CF252B6B7C5A008B24BF /* Services.swift in Sources */,
BAA4D9AF2B5A1795005999F8 /* SplashView.swift in Sources */,
BAB8C3AD2BAC7A11003DF3CC /* LeaveReviewView.swift in Sources */,
BA8E83242B8EF83B00FE968C /* ProductConfiguration.swift in Sources */,
BAA4D9AD2B5A1795005999F8 /* PyeonHaengApp.swift in Sources */,
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
//
// LeaveReviewView.swift
// PyeonHaeng-iOS
//
// Created by 홍승현 on 3/21/24.
//

import DesignSystem
import SwiftUI

// MARK: - LeaveReviewView

struct LeaveReviewView: View {
@Environment(\.openURL) private var openURL

var body: some View {
Button(action: openAppReview) {
HStack {
Image.appstore
.renderingMode(.template)
.foregroundStyle(.gray900)
Text("Leave a Review")
.font(.b1)
.foregroundStyle(.gray900)
Spacer()
Image(systemName: Constants.disclosureImageName)
.font(.system(size: Metrics.disclosureSize, weight: .semibold)) // Styled to look like a disclosure indicator
.foregroundStyle(.gray.opacity(Metrics.disclosureOpacity))
}
}
}

// MARK: Private methods

/// Opens the Mail app's page in the App Store.
private func openAppReview() {
if let url = URL(string: Constants.reviewURL) {
openURL(url)
}
}
}

// MARK: - Metrics

private enum Metrics {
static let disclosureSize: CGFloat = 14
static let disclosureOpacity: CGFloat = 0.5
}

// MARK: - Constants

private enum Constants {
static let disclosureImageName: String = "chevron.right"

static let reviewURL: String = "https://apps.apple.com/app/id1665633509?action=write-review"
}

#Preview {
LeaveReviewView()
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import SwiftUI
struct MailRowItem: View {
@State private var isMailPresented: Bool = false
@State private var showAlert: Bool = false
@Environment(\.openURL) var openURL
@Environment(\.openURL) private var openURL

private let deviceProvider: DeviceInformationProvider

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ private struct SettingsRow: View {
case .contacts:
MailRowItem(deviceProvider: SystemDeviceProvider())

case .leaveReview:
LeaveReviewView()

default:
NavigationLink {} label: {
subject
Expand Down