File tree 2 files changed +6
-6
lines changed
YDS-Storybook/SwiftUI/Atom
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import YDS_SwiftUI
13
13
14
14
@State var text : String ? = " Label "
15
15
@State var typoStyleSelectedIndex = 0
16
- @State var lineLimit : Int ? = nil
16
+ @State var lineLimit : Int ?
17
17
@State var textColorSelectedIndex : Int = 0
18
18
@State var alignmentSelectedIndex : Int = 1
19
19
@State var truncationModeSelectedIndex : Int = 2
@@ -38,7 +38,7 @@ import YDS_SwiftUI
38
38
VStack {
39
39
YDSLabel (
40
40
text: text,
41
- style : selectedTypoStyle,
41
+ font : selectedTypoStyle,
42
42
lineLimit: lineLimit,
43
43
textColor: selectedColor,
44
44
alignment: selectedAlignment,
Original file line number Diff line number Diff line change @@ -14,23 +14,23 @@ extension Text.TruncationMode {
14
14
15
15
public struct YDSLabel : View {
16
16
let text : String ?
17
- let style : Font
17
+ let font : Font
18
18
let lineLimit : Int ?
19
19
let textColor : Color
20
20
let alignment : TextAlignment
21
21
let truncationMode : Text . TruncationMode
22
22
let allowsTightening : Bool
23
23
24
24
public init ( text: String ? = " Label " ,
25
- style : Font = YDSFont . display1,
25
+ font : Font = YDSFont . display1,
26
26
lineLimit: Int ? = nil ,
27
27
textColor: Color = YDSColor . textPrimary,
28
28
alignment: TextAlignment = . center,
29
29
truncationMode: Text . TruncationMode = . tail,
30
30
allowsTightening: Bool = false
31
31
) {
32
32
self . text = text
33
- self . style = style
33
+ self . font = font
34
34
self . lineLimit = lineLimit
35
35
self . textColor = textColor
36
36
self . alignment = alignment
@@ -41,7 +41,7 @@ public struct YDSLabel: View {
41
41
public var body : some View {
42
42
if let text = text {
43
43
Text ( text)
44
- . font ( style )
44
+ . font ( font )
45
45
. lineLimit ( lineLimit)
46
46
. foregroundColor ( textColor)
47
47
. multilineTextAlignment ( alignment)
You can’t perform that action at this time.
0 commit comments