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.
Merge pull request #340 from GSM-MSG/339-portfolio-link-dialog
🔀 :: [#339] 포트폴리오 공유 다이얼로그 추가
- Loading branch information
Showing
7 changed files
with
281 additions
and
6 deletions.
There are no files selected for viewing
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
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
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
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
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
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
46 changes: 46 additions & 0 deletions
46
Projects/Feature/StudentDetailFeature/Sources/Scene/View/EffectiveDateRadioGroupView.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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import SwiftUI | ||
import DesignSystem | ||
|
||
struct EffectiveDateRadioGroupView<T, ID, Content>: View where ID: Hashable, Content: View { | ||
let columns = [GridItem(.flexible()), GridItem(.flexible())] | ||
let data: [T] | ||
let id: KeyPath<T, ID> | ||
let isSelected: (T) -> Bool | ||
let selectAction: (T) -> Void | ||
let content: (T) -> Content | ||
|
||
init( | ||
data: [T], | ||
id: KeyPath<T, ID>, | ||
isSelected: @escaping (T) -> Bool, | ||
selectAction: @escaping (T) -> Void, | ||
@ViewBuilder content: @escaping (T) -> Content | ||
) { | ||
self.data = data | ||
self.id = id | ||
self.isSelected = isSelected | ||
self.selectAction = selectAction | ||
self.content = content | ||
} | ||
|
||
var body: some View { | ||
VStack(alignment: .leading) { | ||
LazyVGrid(columns: columns) { | ||
ForEach(data, id: id) { index in | ||
HStack(spacing: 8) { | ||
SMSRadioButton( | ||
isSelected: Binding( | ||
get: { isSelected(index) }, | ||
set: { _ in selectAction(index) } | ||
) | ||
) | ||
|
||
content(index) | ||
|
||
Spacer() | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |