Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

๐Ÿ”€ :: (#1220) ํ”Œ๋ฆฌ ๋ณด๊ด€ํ•จ์— ์ž ๊ธˆ ์œ ๋ฌด ํ‘œ์‹œ #1229

Merged
merged 8 commits into from
Aug 25, 2024
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@ public struct PlaylistEntity: Equatable {
image: String,
songCount: Int,
userId: String,
private: Bool,
isSelected: Bool = false
) {
self.key = key
self.title = title
self.image = image
self.private = `private`
self.isSelected = isSelected
self.songCount = songCount
self.userId = userId
}

public let key, title, image, userId: String
public let songCount: Int
public var isSelected: Bool
public var `private`, isSelected: Bool
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public struct PlaylistResponseDTO: Decodable {
public let user: PlaylistResponseDTO.User
public let imageUrl: String
public let songCount: Int
public let `private`: Bool

public struct User: Decodable {
public let handle: String
Expand All @@ -30,7 +31,8 @@ public extension PlaylistResponseDTO {
title: title,
image: imageUrl,
songCount: songCount,
userId: user.handle
userId: user.handle,
private: `private`
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,36 @@ import UserDomainInterface

public struct FetchPlaylistUseCaseStub: FetchPlaylistUseCase {
let items: [PlaylistEntity] = [
.init(key: "123", title: "์šฐ์ค‘์ถฉํ•œ ์žฅ๋งˆ์ฒ  ์—ฌ๋ฆ„์— ๋“ฃ๊ธฐ ์ข‹์€ ์ผ๋ณธ ์‹œํ‹ฐํŒ ํ”Œ๋ ˆ์ด๋ฆฌ์ŠคํŠธ", image: "", songCount: 0, userId: ""),
.init(key: "1234", title: "๋น„๋‚ด๋ฆฌ๋Š” ๋„์‹œ, ์„ธ๋ จ๋œ ๋ฌด๋“œ ๊ฐ๊ฐ์ ์ธ ํŒ์†กโ˜”๏ธ ๋ถ„์œ„๊ธฐ ์žˆ๋Š” ๋…ธ๋ž˜ ๋ชจ์Œ", image: "", songCount: 1, userId: ""),
.init(key: "1424", title: "[๐๐ฅ๐š๐ฒ๐ฅ๐ข๐ฌ๐ญ] แ„‹แ…งแ„…แ…ณแ†ท แ„‡แ…กแ†ท, แ„แ…ฌแ„€แ…ณแ†ซแ„€แ…ตแ†ฏ์— ๊ฝ‚๋Š” แ„‘แ…ณแ†ฏแ„…แ…ฆแ„‹แ…ตแ„…แ…ตแ„‰แ…ณแ„แ…ณ๐Ÿšƒ", image: "", songCount: 200, userId: ""),
.init(
key: "123",
title: "์šฐ์ค‘์ถฉํ•œ ์žฅ๋งˆ์ฒ  ์—ฌ๋ฆ„์— ๋“ฃ๊ธฐ ์ข‹์€ ์ผ๋ณธ ์‹œํ‹ฐํŒ ํ”Œ๋ ˆ์ด๋ฆฌ์ŠคํŠธ",
image: "",
songCount: 0,
userId: "",
private: true
),
.init(
key: "1234",
title: "๋น„๋‚ด๋ฆฌ๋Š” ๋„์‹œ, ์„ธ๋ จ๋œ ๋ฌด๋“œ ๊ฐ๊ฐ์ ์ธ ํŒ์†กโ˜”๏ธ ๋ถ„์œ„๊ธฐ ์žˆ๋Š” ๋…ธ๋ž˜ ๋ชจ์Œ",
image: "",
songCount: 1,
userId: "",
private: true
),
.init(
key: "1424",
title: "[๐๐ฅ๐š๐ฒ๐ฅ๐ข๐ฌ๐ญ] แ„‹แ…งแ„…แ…ณแ†ท แ„‡แ…กแ†ท, แ„แ…ฌแ„€แ…ณแ†ซแ„€แ…ตแ†ฏ์— ๊ฝ‚๋Š” แ„‘แ…ณแ†ฏแ„…แ…ฆแ„‹แ…ตแ„…แ…ตแ„‰แ…ณแ„แ…ณ๐Ÿšƒ",
image: "",
songCount: 200,
userId: "",
private: false
),
.init(
key: "1324",
title: "๐๐ฅ๐š๐ฒ๐ฅ๐ข๐ฌ๐ญ ๋ฒŒ์จ ์—ฌ๋ฆ„์ด์•ผ? ๋‚ด ๋ฐฉ์„ ์ฒญ๋Ÿ‰ํ•œ ์บ˜๋ฆฌํฌ๋‹ˆ์•„ ํ•ด๋ณ€์œผ๋กœ ์‹ ๋‚˜๋Š” ์—ฌ๋ฆ„ ํŒ์†ก ๐’๐ฎ๐ฆ๐ฆ๐ž๐ซ ๐ข๐ฌ ๐œ๐จ๐ฆ๐ข๐ง๐  ๐ŸŒด",
image: "",
songCount: 1000,
userId: ""
userId: "", private: true
)
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,8 @@ private extension MyPlaylistDetailReactor {
return updateTitleAndPrivateUseCase.execute(key: key, title: nil, isPrivate: prev.private)
.andThen(.concat([
.just(.updateHeader(prev)),
.just(.showToast(message))
.just(.showToast(message)),
.just(.postNotification(.shouldRefreshPlaylist))

]))
.catch { error in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ class ListStorageTableViewCell: UITableViewCell {
$0.lineBreakMode = .byTruncatingTail
}

private let countLabel = WMLabel(
text: "",
textColor: DesignSystemAsset.BlueGrayColor.blueGray300.color,
font: .t7(weight: .light),
kernValue: -0.5
)
private let verticalStackView = UIStackView().then {
$0.axis = .vertical
}
Expand All @@ -57,6 +51,20 @@ class ListStorageTableViewCell: UITableViewCell {
)
}

private let lockImageView: UIImageView = UIImageView().then {
$0.image = DesignSystemAsset.Storage.storageClose.image
$0.isHidden = true
}

private let countLabel = WMLabel(
text: "",
textColor: DesignSystemAsset.BlueGrayColor.blueGray300.color,
font: .t7(weight: .light),
kernValue: -0.5
)

private let countContainerView: UIView = UIView()

private let cellSelectButton = UIButton()
private let listSelectButton = UIButton()

Expand Down Expand Up @@ -85,10 +93,8 @@ extension ListStorageTableViewCell {
cellSelectButton,
listSelectButton
)
verticalStackView.addArrangedSubviews(
nameLabel,
countLabel
)
verticalStackView.addArrangedSubviews(nameLabel, countContainerView)
countContainerView.addSubviews(countLabel, lockImageView)
}

func setLayout() {
Expand Down Expand Up @@ -128,6 +134,14 @@ extension ListStorageTableViewCell {

countLabel.snp.makeConstraints {
$0.height.equalTo(18)
$0.top.bottom.equalToSuperview()
$0.leading.equalToSuperview()
}

lockImageView.snp.makeConstraints {
$0.leading.equalTo(countLabel.snp.trailing)
$0.width.height.equalTo(16)
$0.bottom.equalToSuperview().offset(-1)
}
}

Expand Down Expand Up @@ -160,6 +174,7 @@ extension ListStorageTableViewCell {
self.cellSelectButton.isHidden = !isEditing
self.listSelectButton.isHidden = isEditing
self.playButton.isHidden = isEditing
self.lockImageView.isHidden = !model.private

self.playButton.snp.updateConstraints {
$0.right.equalToSuperview().inset(isEditing ? -24 : 20)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading