generated from GSM-MSG/MSG-Repository-Generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
💄 [#220] MyPageFeature / 필요한 View 추가
- Loading branch information
Showing
3 changed files
with
91 additions
and
26 deletions.
There are no files selected for viewing
43 changes: 34 additions & 9 deletions
43
Projects/Feature/MyPageFeature/Sources/Scene/View/ImageMethodPickerView.swift
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,9 +1,34 @@ | ||
// | ||
// ImageMethodPickerView.swift | ||
// MyPageFeature | ||
// | ||
// Created by sunghun on 8/16/23. | ||
// Copyright © 2023 com.msg. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import DesignSystem | ||
import SwiftUI | ||
|
||
struct ImageMethodPickerView: View { | ||
private var albumAction: () -> Void | ||
private var cameraAction: () -> Void | ||
|
||
init( | ||
albumAction: @escaping () -> Void, | ||
cameraAction: @escaping () -> Void | ||
) { | ||
self.albumAction = albumAction | ||
self.cameraAction = cameraAction | ||
} | ||
|
||
var body: some View { | ||
VStack(spacing: 28) { | ||
Group { | ||
ImageMethodRowView(title: "앨범에서 가져오기", icon: .photo) { | ||
albumAction() | ||
} | ||
|
||
ImageMethodRowView(title: "카메라에서 촬영하기", icon: .camera) { | ||
cameraAction() | ||
} | ||
} | ||
.buttonStyle(.plain) | ||
.frame(maxWidth: .infinity, alignment: .leading) | ||
} | ||
.frame(maxWidth: .infinity, alignment: .leading) | ||
.padding(.horizontal, 20) | ||
.padding(.top, 16) | ||
} | ||
} |
39 changes: 31 additions & 8 deletions
39
Projects/Feature/MyPageFeature/Sources/Scene/View/ImageMethodRowView.swift
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,9 +1,32 @@ | ||
// | ||
// ImageMethodRowView.swift | ||
// MyPageFeature | ||
// | ||
// Created by sunghun on 8/16/23. | ||
// Copyright © 2023 com.msg. All rights reserved. | ||
// | ||
import DesignSystem | ||
import SwiftUI | ||
|
||
import Foundation | ||
struct ImageMethodRowView: View { | ||
private var title: String | ||
private var icon: SMSIcon.Icon | ||
private var action: () -> Void | ||
|
||
init( | ||
title: String, | ||
icon: SMSIcon.Icon, | ||
action: @escaping () -> Void | ||
) { | ||
self.title = title | ||
self.icon = icon | ||
self.action = action | ||
} | ||
|
||
var body: some View { | ||
Button { | ||
action() | ||
} label: { | ||
Label { | ||
SMSText(title, font: .body1) | ||
} icon: { | ||
SMSIcon(icon) | ||
} | ||
.frame(maxWidth: .infinity, alignment: .leading) | ||
.background(Color.sms(.system(.white))) | ||
} | ||
} | ||
} |
35 changes: 26 additions & 9 deletions
35
Projects/Feature/MyPageFeature/Sources/Scene/View/MajorRowView.swift
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,9 +1,26 @@ | ||
// | ||
// MajorRowView.swift | ||
// MyPageFeature | ||
// | ||
// Created by sunghun on 8/16/23. | ||
// Copyright © 2023 com.msg. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import DesignSystem | ||
import SwiftUI | ||
|
||
struct MajorRowView: View { | ||
private var text: String | ||
@Binding private var isSeleted: Bool | ||
|
||
init(text: String, isSeleted: Binding<Bool>) { | ||
self.text = text | ||
_isSeleted = isSeleted | ||
} | ||
|
||
var body: some View { | ||
HStack { | ||
SMSText(text, font: .body1) | ||
|
||
Spacer() | ||
|
||
SMSRadioButton(isSelected: $isSeleted) | ||
.buttonWrapper {} | ||
} | ||
.padding(.horizontal, 20) | ||
.padding(.vertical, 12) | ||
.frame(maxWidth: .infinity, alignment: .leading) | ||
} | ||
} |