Skip to content

Commit

Permalink
[design] #167 링크 미리보기 shadow 수정 및 햅틱 피드백 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
ShapeKim98 committed Dec 10, 2024
1 parent f2f1552 commit ef1fed7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
19 changes: 11 additions & 8 deletions Projects/DSKit/Sources/Components/PokitLinkPreview.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import SwiftUI

import Util
import NukeUI

public struct PokitLinkPreview: View {
Expand All @@ -33,7 +34,6 @@ public struct PokitLinkPreview: View {
}
}


private var buttonLabel: some View {
HStack(spacing: 16) {
Group {
Expand All @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit ef1fed7

Please sign in to comment.