Skip to content

Commit

Permalink
[feat] #156 PokitCaution Type ๊ตฌ์„ฑ
Browse files Browse the repository at this point in the history
  • Loading branch information
stealmh committed Nov 24, 2024
1 parent 0230093 commit 07a383b
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions Projects/DSKit/Sources/Components/PokitCaution.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,70 @@

import SwiftUI

public enum CautionType {
case ์นดํ…Œ๊ณ ๋ฆฌ์—†์Œ
case ๋ฏธ๋ถ„๋ฅ˜_๋งํฌ์—†์Œ
case ๋งํฌ์—†์Œ
case ์ฆ๊ฒจ์ฐพ๊ธฐ_๋งํฌ์—†์Œ
case ๋งํฌ๋ถ€์กฑ
case ์•Œ๋ฆผ์—†์Œ

var image: PokitImage.Character {
switch self {
case .์นดํ…Œ๊ณ ๋ฆฌ์—†์Œ, .๋งํฌ์—†์Œ, .์ฆ๊ฒจ์ฐพ๊ธฐ_๋งํฌ์—†์Œ, .๋ฏธ๋ถ„๋ฅ˜_๋งํฌ์—†์Œ:
return .empty
case .๋งํฌ๋ถ€์กฑ:
return .sad
case .์•Œ๋ฆผ์—†์Œ:
return .pooki
}
}

var title: String {
switch self {
case .์นดํ…Œ๊ณ ๋ฆฌ์—†์Œ:
return "์ €์žฅ๋œ ํฌํ‚ท์ด ์—†์–ด์š”!"
case .๋ฏธ๋ถ„๋ฅ˜_๋งํฌ์—†์Œ:
return "๋ฏธ๋ถ„๋ฅ˜ ๋งํฌ๊ฐ€ ์—†์–ด์š”!"
case .๋งํฌ์—†์Œ:
return "์ €์žฅ๋œ ๋งํฌ๊ฐ€ ์—†์–ด์š”!"
case .์ฆ๊ฒจ์ฐพ๊ธฐ_๋งํฌ์—†์Œ:
return "์ฆ๊ฒจ์ฐพ๊ธฐ ๋งํฌ๊ฐ€ ์—†์–ด์š”!"
case .๋งํฌ๋ถ€์กฑ:
return "๋งํฌ๊ฐ€ ๋ถ€์กฑํ•ด์š”!"
case .์•Œ๋ฆผ์—†์Œ:
return "์•Œ๋ฆผ์ด ์—†์–ด์š”"
}
}

var message: String {
switch self {
case .์นดํ…Œ๊ณ ๋ฆฌ์—†์Œ:
return "ํฌํ‚ท์„ ์ƒ์„ฑํ•ด ๋งํฌ๋ฅผ ์ €์žฅํ•ด๋ณด์„ธ์š”"
case .๋ฏธ๋ถ„๋ฅ˜_๋งํฌ์—†์Œ:
return "๋งํฌ๋ฅผ ํฌํ‚ท์— ๊น”๋”ํ•˜๊ฒŒ ๋ถ„๋ฅ˜ํ•˜์…จ์–ด์š”"
case .๋งํฌ์—†์Œ:
return "๋‹ค์–‘ํ•œ ๋งํฌ๋ฅผ ํ•œ ๊ณณ์— ์ €์žฅํ•ด๋ณด์„ธ์š”"
case .์ฆ๊ฒจ์ฐพ๊ธฐ_๋งํฌ์—†์Œ:
return "๋งํฌ๋ฅผ ์ฆ๊ฒจ์ฐพ๊ธฐ๋กœ ๊ด€๋ฆฌํ•ด๋ณด์„ธ์š”"
case .๋งํฌ๋ถ€์กฑ:
return "๋งํฌ๋ฅผ 5๊ฐœ ์ด์ƒ ์ €์žฅํ•˜๊ณ  ์ถ”์ฒœ์„ ๋ฐ›์•„๋ณด์„ธ์š”"
case .์•Œ๋ฆผ์—†์Œ:
return "๋ฆฌ๋งˆ์ธ๋“œ ์•Œ๋ฆผ์„ ์„ค์ •ํ•˜์„ธ์š”"
}
}

var actionTitle: String? {
switch self {
case .์นดํ…Œ๊ณ ๋ฆฌ์—†์Œ:
return "ํฌํ‚ท ์ถ”๊ฐ€ํ•˜๊ธฐ"
case .๋ฏธ๋ถ„๋ฅ˜_๋งํฌ์—†์Œ:
return "๋งํฌ ์ถ”๊ฐ€ํ•˜๊ธฐ"
default: return nil
}
}
}

public struct PokitCaution: View {
private let image: PokitImage.Character
private let titleKey: String
Expand Down

0 comments on commit 07a383b

Please sign in to comment.