Files
sodalive-ios/SodaLive/Sources/Dialog/CreatorFollowNotifyDialog.swift
Yu Sung 280e424385 커스텀 폰트 pretendard-medium, gmarket-medium를 사용하고 있던 것을 appFont 모디
파이어를 사용하여 한국어는 pretendard, 그 외에는 시스템 폰트를 사용하도록 수정
2026-01-23 03:09:20 +09:00

109 lines
3.2 KiB
Swift

//
// CreatorFollowNotifyDialog.swift
// SodaLive
//
// Created by klaus on 9/23/24.
//
import SwiftUI
struct CreatorFollowNotifyDialog: View {
@Binding var isShowing: Bool
let onClickNotifyAll: () -> Void
let onClickNotifyNone: () -> Void
let onClickUnFollow: () -> Void
@State private var isShow: Bool = false
var body: some View {
ZStack {
Color.black.opacity(0.7).ignoresSafeArea()
.onTapGesture {
isShowing = false
}
VStack(spacing: 0) {
Spacer()
if isShow {
VStack(alignment: .leading, spacing: 24) {
Text("알림")
.appFont(size: 18.3, weight: .bold)
.foregroundColor(Color.grayee)
CreatorFollowNotifyItem(
image: "ic_notify_all",
title: I18n.MemberChannel.all,
onTapGesture: {
isShowing = false
onClickNotifyAll()
}
)
CreatorFollowNotifyItem(
image: "ic_notify_none",
title: I18n.MemberChannel.none,
onTapGesture: {
isShowing = false
onClickNotifyNone()
}
)
CreatorFollowNotifyItem(
image: "ic_avatar_unfollow",
title: I18n.MemberChannel.unfollow,
onTapGesture: {
isShowing = false
onClickUnFollow()
}
)
}
.frame(maxWidth:.infinity)
.padding(.horizontal, 16)
.padding(.top, 16)
.padding(.bottom, 32)
.background(Color.gray22)
.cornerRadius(10, corners: [.topLeft, .topRight])
.transition(.move(edge: .bottom))
.animation(.easeInOut(duration: 0.5), value: isShow)
}
}
.ignoresSafeArea()
}
.onAppear {
withAnimation {
isShow = true
}
}
}
}
struct CreatorFollowNotifyItem: View {
let image: String
let title: String
let onTapGesture: () -> Void
var body: some View {
HStack(spacing: 16) {
Image(image)
Text(title)
.appFont(size: 13.3, weight: .medium)
.foregroundColor(Color.grayee)
Spacer()
}
.contentShape(Rectangle())
.onTapGesture(perform: onTapGesture)
}
}
#Preview {
CreatorFollowNotifyDialog(
isShowing: .constant(true),
onClickNotifyAll: {},
onClickNotifyNone: {},
onClickUnFollow: {}
)
}