File tree Expand file tree Collapse file tree 3 files changed +40
-3
lines changed Expand file tree Collapse file tree 3 files changed +40
-3
lines changed Original file line number Diff line number Diff line change 1+ import SwiftUI
2+
3+ public final class GroupProps : ObservableObject , Decodable {
4+ @Published public var style : StyleProps ?
5+
6+ enum CodingKeys : String , CodingKey {
7+ case style
8+ }
9+
10+ public required init ( from decoder: Decoder ) throws {
11+ let container = try decoder. container ( keyedBy: CodingKeys . self)
12+ style = try container. decodeIfPresent ( StyleProps . self, forKey: . style)
13+ }
14+
15+ public func merge( from other: GroupProps ) {
16+ style = other. style
17+ }
18+ }
Original file line number Diff line number Diff line change 1+ import SwiftUI
2+
3+ public struct GroupView < Content: View > : View {
4+ @ObservedObject public var props : GroupProps
5+ let content : ( ) -> Content
6+
7+ public init ( props: GroupProps , @ViewBuilder content: @escaping ( ) -> Content ) {
8+ self . props = props
9+ self . content = content
10+ }
11+
12+ public var body : some View {
13+ Group {
14+ content ( )
15+ }
16+ . applyViewStyles ( props. style)
17+ }
18+ }
Original file line number Diff line number Diff line change 11import { type PropsWithChildren } from "react" ;
22import { SwiftUIParentIdProvider } from "../contexts" ;
33import { useSwiftUINode } from "../hooks" ;
4- import type { FunctionComponentWithId } from "../types" ;
4+ import type { FunctionComponentWithId , NativeViewStyle } from "../types" ;
55
66// https://developer.apple.com/documentation/swiftui/form
77
8- // eslint-disable-next-line @typescript-eslint/no-empty-object-type
9- export type NativeGroupProps = { } ;
8+ export type NativeGroupProps = {
9+ style ?: NativeViewStyle ;
10+ } ;
1011
1112export const Group : FunctionComponentWithId < PropsWithChildren < NativeGroupProps > > = ( {
1213 children,
You can’t perform that action at this time.
0 commit comments