Skip to content

Commit

Permalink
[#250] 코드 리뷰 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
iiuoon committed Jan 17, 2024
1 parent 35c240b commit 06760ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions YDS-Storybook/SwiftUI/Atom/LabelPageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import YDS_SwiftUI

@State var text: String? = "Label"
@State var typoStyleSelectedIndex = 0
@State var lineLimit: Int? = nil
@State var lineLimit: Int?
@State var textColorSelectedIndex: Int = 0
@State var alignmentSelectedIndex: Int = 1
@State var truncationModeSelectedIndex: Int = 2
Expand All @@ -38,7 +38,7 @@ import YDS_SwiftUI
VStack {
YDSLabel(
text: text,
style: selectedTypoStyle,
font: selectedTypoStyle,
lineLimit: lineLimit,
textColor: selectedColor,
alignment: selectedAlignment,
Expand Down
8 changes: 4 additions & 4 deletions YDS-SwiftUI/Source/Atom/YDSLabel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@ extension Text.TruncationMode {

public struct YDSLabel: View {
let text: String?
let style: Font
let font: Font
let lineLimit: Int?
let textColor: Color
let alignment: TextAlignment
let truncationMode: Text.TruncationMode
let allowsTightening: Bool

public init(text: String? = "Label",
style: Font = YDSFont.display1,
font: Font = YDSFont.display1,
lineLimit: Int? = nil,
textColor: Color = YDSColor.textPrimary,
alignment: TextAlignment = .center,
truncationMode: Text.TruncationMode = .tail,
allowsTightening: Bool = false
) {
self.text = text
self.style = style
self.font = font
self.lineLimit = lineLimit
self.textColor = textColor
self.alignment = alignment
Expand All @@ -41,7 +41,7 @@ public struct YDSLabel: View {
public var body: some View {
if let text = text {
Text(text)
.font(style)
.font(font)
.lineLimit(lineLimit)
.foregroundColor(textColor)
.multilineTextAlignment(alignment)
Expand Down

0 comments on commit 06760ff

Please sign in to comment.