크리에이터 커뮤니티 페이지 추가

This commit is contained in:
Yu Sung
2023-12-15 19:14:03 +09:00
parent b8fbb664d5
commit 650b6808e6
11 changed files with 331 additions and 2 deletions

View File

@@ -0,0 +1,40 @@
//
// IconAndTitleButton.swift
// SodaLive
//
// Created by klaus on 2023/12/15.
//
import SwiftUI
struct IconAndTitleButton: View {
let iconName: String
let title: String
let onClick: () -> Void
var body: some View {
HStack(spacing: 4) {
Image(iconName)
Text(title)
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "d2d2d2"))
}
.padding(.horizontal, 13.3)
.padding(.vertical, 5.3)
.background(Color(hex: "ffffff").opacity(0.1))
.cornerRadius(26.7)
.onTapGesture { onClick() }
}
}
struct IconAndTitleButton_Previews: PreviewProvider {
static var previews: some View {
IconAndTitleButton(
iconName: "ic_audio_content_share",
title: "공유",
onClick: {}
)
}
}

View File

@@ -0,0 +1,45 @@
//
// IconAndTitleToggleButton.swift
// SodaLive
//
// Created by klaus on 2023/12/15.
//
import SwiftUI
struct IconAndTitleToggleButton: View {
@Binding var isChecked: Bool
let title: String
let normalIconName: String
let checkedIconName: String
let onClick: () -> Void
var body: some View {
HStack(spacing: 4) {
Image(isChecked ? checkedIconName : normalIconName)
Text("\(title)")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "d2d2d2"))
}
.padding(.horizontal, 13.3)
.padding(.vertical, 5.3)
.background(Color(hex: "ffffff").opacity(0.1))
.cornerRadius(26.7)
.onTapGesture { onClick() }
}
}
struct IconAndTitleToggleButton_Previews: PreviewProvider {
static var previews: some View {
IconAndTitleToggleButton(
isChecked: .constant(true),
title: "100",
normalIconName: "ic_audio_content_heart_normal",
checkedIconName: "ic_audio_content_heart_pressed"
) {}
}
}