Skip to content

Commit

Permalink
feature: 고양이 랜덤 문구 노출
Browse files Browse the repository at this point in the history
  • Loading branch information
devMinseok committed Aug 20, 2024
1 parent 53115c2 commit 67642c6
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
16 changes: 16 additions & 0 deletions Projects/Domain/CatService/Interface/Model/CatFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public struct AnyCat: CatFactoryProtocol, Identifiable, Equatable {
public var focusEndPushTitle: String { base.focusEndPushTitle }
public var restEndPushTitle: String { base.restEndPushTitle }
public var disturbPushTitle: String { base.disturbPushTitle }
public var tooltipMessage: String { base.tooltipMessage }

public static func == (lhs: AnyCat, rhs: AnyCat) -> Bool {
lhs.base.id == rhs.base.id
Expand All @@ -56,6 +57,11 @@ public struct CheeseCat: CatFactoryProtocol {
public var focusEndPushTitle: String = "집중이 끝났다냥! 이제 나랑 놀아달라냥"
public var restEndPushTitle: String = "이제 다시 집중해볼까냥?"
public var disturbPushTitle: String = "날 두고 어디갔냥.."

public var tooltipMessage: String {
let messages = ["나랑 함께할 시간이다냥!", "자주 와서 쓰다듬어 달라냥", "집중이 잘 될 거 같다냥"]
return messages.randomElement() ?? ""
}
}

// MARK: BLACK CAT
Expand All @@ -76,6 +82,11 @@ public struct BlackCat: CatFactoryProtocol {
public var focusEndPushTitle: String = "집중이 끝났다냥! 이제 나랑 놀아달라냥"
public var restEndPushTitle: String = "이제 다시 집중해볼까냥?"
public var disturbPushTitle: String = "날 두고 어디갔냥.."

public var tooltipMessage: String {
let messages = ["나랑 함께할 시간이다냥!", "자주 와서 쓰다듬어 달라냥", "집중이 잘 될 거 같다냥"]
return messages.randomElement() ?? ""
}
}

// MARK: THREE_COLOR CAT
Expand All @@ -96,6 +107,11 @@ public struct ThreeColorCat: CatFactoryProtocol {
public var focusEndPushTitle: String = "집중이 끝났다냥! 원하는 만큼 집중했냥?"
public var restEndPushTitle: String = "집중할 시간이다냥! 빨리 들어오라냥"
public var disturbPushTitle: String = "지금 뭐하고 있냥? 내가 감시하고 있다냥"

public var tooltipMessage: String {
let messages = ["\"시간이 없어서\"는 변명이다냥", "휴대폰 그만보고 집중하라냥", "기회란 금새 왔다 사라진다냥"]
return messages.randomElement() ?? ""
}
}

// MARK: MAKE CAT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ public protocol CatFactoryProtocol {
var focusEndPushTitle: String { get }
var restEndPushTitle: String { get }
var disturbPushTitle: String { get }
var tooltipMessage: String { get }
}
2 changes: 1 addition & 1 deletion Projects/Feature/HomeFeature/Sources/Home/HomeCore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public struct HomeCore {
}

case .setHomeCatTooltip:
state.homeCatTooltip = .init(title: "오랜만이다냥") // TODO: - 문구 랜덤변경하기
state.homeCatTooltip = .init(title: state.selectedCat.tooltipMessage)
return .none

case let .setHomeCategoryGuideTooltip(tooltip):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ public struct HomeCatDialogueTooltip: Tooltip {

public var targetCornerRadius: CGFloat? { nil }

public var padding: CGFloat { -12 }
public var padding: CGFloat { -30 }
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ public struct PomodoroDialogueTooltip: Tooltip {

public var targetCornerRadius: CGFloat? { nil }

public var padding: CGFloat { -12 }
public var padding: CGFloat { -30 }
}

0 comments on commit 67642c6

Please sign in to comment.