Skip to content

Commit

Permalink
💄 [#220] MyPageFeature / 필요한 View 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
kimsh153 committed Aug 22, 2023
1 parent c4f89b0 commit d8aa705
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 26 deletions.
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)
}
}
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)))
}
}
}
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)
}
}

0 comments on commit d8aa705

Please sign in to comment.