Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
JMM00 committed Apr 23, 2024
1 parent 9eaf790 commit 7d9ce8c
Show file tree
Hide file tree
Showing 5 changed files with 280 additions and 664 deletions.
39 changes: 27 additions & 12 deletions HappyAnding/HappyAnding/Extensions/String/String+Date.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,32 @@ extension String {

func getPostDateFormat() -> String? {
let inputFormatter = DateFormatter()
inputFormatter.dateFormat = "yyyyMMddHHmmss"

if let date = inputFormatter.date(from: self) {
let outputFormatter = DateFormatter()
outputFormatter.locale = Locale(identifier: "ko_KR")
outputFormatter.dateFormat = "M월 d일 a h시 m분"

let output = outputFormatter.string(from: date)
return output
} else {
return nil
}
inputFormatter.dateFormat = "yyyyMMddHHmmss"

if let date = inputFormatter.date(from: self) {
let outputFormatter = DateFormatter()
outputFormatter.locale = Locale(identifier: "ko_KR")
outputFormatter.dateFormat = "M월 d일 a h시 m분"

let output = outputFormatter.string(from: date)
return output
} else {
return nil
}
}
func getVersionDateFormat() -> String? {
let inputFormatter = DateFormatter()
inputFormatter.dateFormat = "yyyyMMddHHmmss"

if let date = inputFormatter.date(from: self) {
let outputFormatter = DateFormatter()
outputFormatter.locale = Locale(identifier: "ko_KR")
outputFormatter.dateFormat = "yyyy년 M월 d일"

let output = outputFormatter.string(from: date)
return output
} else {
return nil
}
}
}
10 changes: 10 additions & 0 deletions HappyAnding/HappyAnding/Extensions/View/View+Shape.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ extension View {
)
.clipShape(RoundedRectangle(cornerRadius: cornerRadius))
}

func roundedBackground() -> some View {
self
.font(.system(size: 14, weight: .regular))
.foregroundStyle(SCZColor.CharcoalGray.opacity64)
.padding(.horizontal, 10)
.padding(.vertical, 8)
.background(SCZColor.CharcoalGray.opacity04)
.roundedBorder(cornerRadius: 16, color: Color.white.opacity(0.12), isNormalBlend: true)
}
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ final class ReadShortcutViewModel: ObservableObject {
}

init(data: Shortcuts) {
print("*****init")
self.author = User()
self.shortcut = shortcutsZipViewModel.fetchShortcutDetail(id: data.id) ?? data
self.isMyLike = shortcutsZipViewModel.checkLikedShortrcut(shortcutID: data.id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct ShortcutIcon: View {
.roundedBorder(cornerRadius: 13, color: .white, isNormalBlend: true, opacity: 0.24)
.frame(width: size, height: size)
Image(systemName: sfSymbol)
.font(.system(size: 28))
.font(.system(size: size/2 - 5))
.foregroundStyle(Color.white)
}
}
Expand Down
Loading

0 comments on commit 7d9ce8c

Please sign in to comment.