From ef1fed7aa43de2bb7af2d1e941277f4f8d998dff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=84=ED=98=95?= <108233361+ShapeKim98@users.noreply.github.com> Date: Tue, 10 Dec 2024 14:06:28 +0900 Subject: [PATCH] =?UTF-8?q?[design]=20#167=20=EB=A7=81=ED=81=AC=20?= =?UTF-8?q?=EB=AF=B8=EB=A6=AC=EB=B3=B4=EA=B8=B0=20shadow=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=EB=B0=8F=20=ED=96=85=ED=8B=B1=20=ED=94=BC=EB=93=9C?= =?UTF-8?q?=EB=B0=B1=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Components/PokitLinkPreview.swift | 19 +++++++++++-------- .../ContentSettingFeature.swift | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Projects/DSKit/Sources/Components/PokitLinkPreview.swift b/Projects/DSKit/Sources/Components/PokitLinkPreview.swift index 844619af..88828f43 100644 --- a/Projects/DSKit/Sources/Components/PokitLinkPreview.swift +++ b/Projects/DSKit/Sources/Components/PokitLinkPreview.swift @@ -7,6 +7,7 @@ import SwiftUI +import Util import NukeUI public struct PokitLinkPreview: View { @@ -33,7 +34,6 @@ public struct PokitLinkPreview: View { } } - private var buttonLabel: some View { HStack(spacing: 16) { Group { @@ -54,18 +54,13 @@ public struct PokitLinkPreview: View { .background { RoundedRectangle(cornerRadius: 12, style: .continuous) .fill(.pokit(.bg(.base))) + .shadow(color: .black.opacity(0.06), radius: 3, x: 2, y: 2) } .overlay { RoundedRectangle(cornerRadius: 12, style: .continuous) .stroke(.pokit(.border(.tertiary)), lineWidth: 1) } - .shadow(color: .black.opacity(0.06), radius: 3, x: 2, y: 2) - .onAppear { - withAnimation { - UINotificationFeedbackGenerator() - .notificationOccurred(.success) - } - } + .onChange(of: imageURL, perform: onChangeImageURL) } @MainActor @@ -134,6 +129,14 @@ public struct PokitLinkPreview: View { else { return } openURL(url) } + + private func onChangeImageURL(_ imageURL: String?) { + guard imageURL != nil else { return } + let isError = title == Constants.제목을_입력해주세요_문구 + print("\(#function): \(isError), \(title)") + UINotificationFeedbackGenerator() + .notificationOccurred(isError ? .error : .success) + } } #Preview { diff --git a/Projects/Feature/FeatureContentSetting/Sources/ContentSetting/ContentSettingFeature.swift b/Projects/Feature/FeatureContentSetting/Sources/ContentSetting/ContentSettingFeature.swift index a5847ac0..db01fe14 100644 --- a/Projects/Feature/FeatureContentSetting/Sources/ContentSetting/ContentSettingFeature.swift +++ b/Projects/Feature/FeatureContentSetting/Sources/ContentSetting/ContentSettingFeature.swift @@ -255,8 +255,8 @@ private extension ContentSettingFeature { let contentTitle = state.title.isEmpty ? Constants.제목을_입력해주세요_문구 : state.title - state.linkTitle = title ?? contentTitle state.linkImageURL = imageURL ?? Constants.기본_썸네일_주소.absoluteString + state.linkTitle = title ?? contentTitle if let title, state.domain.title.isEmpty { state.domain.title = title }