크리에이터 채널 - 팔로우와 알림설정
- 팔로잉 상태에서 알림 켜기/끄기 상태 추가
This commit is contained in:
107
SodaLive/Sources/Dialog/CreatorFollowNotifyDialog.swift
Normal file
107
SodaLive/Sources/Dialog/CreatorFollowNotifyDialog.swift
Normal file
@@ -0,0 +1,107 @@
|
||||
//
|
||||
// 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("알림")
|
||||
.font(.custom(Font.bold.rawValue, size: 18.3))
|
||||
.foregroundColor(Color.grayee)
|
||||
|
||||
CreatorFollowNotifyItem(
|
||||
image: "ic_notify_all",
|
||||
title: "전체",
|
||||
onTapGesture: {
|
||||
isShowing = false
|
||||
onClickNotifyAll()
|
||||
}
|
||||
)
|
||||
CreatorFollowNotifyItem(
|
||||
image: "ic_notify_none",
|
||||
title: "없음",
|
||||
onTapGesture: {
|
||||
isShowing = false
|
||||
onClickNotifyNone()
|
||||
}
|
||||
)
|
||||
CreatorFollowNotifyItem(
|
||||
image: "ic_avatar_unfollow",
|
||||
title: "팔로우 취소",
|
||||
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)
|
||||
.font(.custom(Font.medium.rawValue, size: 13.3))
|
||||
.foregroundColor(Color.grayee)
|
||||
|
||||
Spacer()
|
||||
}
|
||||
.onTapGesture(perform: onTapGesture)
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
CreatorFollowNotifyDialog(
|
||||
isShowing: .constant(true),
|
||||
onClickNotifyAll: {},
|
||||
onClickNotifyNone: {},
|
||||
onClickUnFollow: {}
|
||||
)
|
||||
}
|
Reference in New Issue
Block a user