Skip to content

Commit

Permalink
[Refactor/#319] 프로필 이미지 블러 처리 로직 제거 #320
Browse files Browse the repository at this point in the history
  • Loading branch information
JongHoooon committed Oct 16, 2024
1 parent 92cf979 commit 98629e0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public struct IntroductionView: View {
} else if store.isStopped == false {
UserProfileView(
imageURL: store.userImageURL,
isBlurred: true,
userName: store.userName,
userAge: store.age
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ private extension ReportUserView {
var userProfile: some View {
UserProfileView(
imageURL: store.userProfile.imageURL,
isBlurred: true,
userName: store.userProfile.userName,
userAge: store.userProfile.userAge
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@ public struct UserProfileTestView: View {
VStack(spacing: .xl) {
UserProfileView(
imageURL: "https://static.wikia.nocookie.net/wallaceandgromit/images/3/38/Gromit-3.png/revision/latest/scale-to-width/360?cb=20191228190308",
isBlurred: true,
userName: "임현규",
userAge: 26
)
.border(.red)

UserProfileView(
imageURL: "",
isBlurred: false,
userName: "임현규",
userAge: 26
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,15 @@ import SwiftUI

public struct UserProfileView: View {
private let imageURL: String
private let isBlurred: Bool
private let userName: String
private let userAge: Int

public init(
imageURL: String,
isBlurred: Bool,
userName: String,
userAge: Int
) {
self.imageURL = imageURL
self.isBlurred = isBlurred
self.userName = userName
self.userAge = userAge
}
Expand All @@ -41,25 +38,13 @@ private extension UserProfileView {

@ViewBuilder
var profileImage: some View {
switch isBlurred {
case true:
BlurImageView(
imageURL: imageURL,
downsamplingWidth: 80.0,
downsamplingHeight: 80.0
)
.clipShape(Circle())
.frame(width: 80.0, height: 80.0)

case false:
RemoteImageView(
imageURL: imageURL,
downsamplingWidth: 80.0,
downsamplingHeight: 80.0
)
.clipShape(Circle())
.frame(width: 80, height: 80)
}
RemoteImageView(
imageURL: imageURL,
downsamplingWidth: 80.0,
downsamplingHeight: 80.0
)
.clipShape(Circle())
.frame(width: 80, height: 80)
}

var userNameText: some View {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public struct BottleStorageItem: View {

Spacer()

BlurImageView(
RemoteImageView(
imageURL: imageURL,
downsamplingWidth: 60.0,
downsamplingHeight: 60.0
Expand Down

0 comments on commit 98629e0

Please sign in to comment.