46 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Swift
		
	
	
	
	
	
			
		
		
	
	
			46 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Swift
		
	
	
	
	
	
//
 | 
						|
//  DetailNavigationBar.swift
 | 
						|
//  SodaLive
 | 
						|
//
 | 
						|
//  Created by klaus on 2023/08/09.
 | 
						|
//
 | 
						|
 | 
						|
import SwiftUI
 | 
						|
 | 
						|
struct DetailNavigationBar: View {
 | 
						|
    
 | 
						|
    let title: String
 | 
						|
    var backAction: (() -> Void)? = nil
 | 
						|
    
 | 
						|
    var body: some View {
 | 
						|
        HStack(spacing: 0) {
 | 
						|
            Button {
 | 
						|
                if let backAction = backAction {
 | 
						|
                    backAction()
 | 
						|
                } else {
 | 
						|
                    AppState.shared.back()
 | 
						|
                }
 | 
						|
            } label: {
 | 
						|
                Image("ic_back")
 | 
						|
                    .resizable()
 | 
						|
                    .frame(width: 20, height: 20)
 | 
						|
                
 | 
						|
                Text(title)
 | 
						|
                    .font(.custom(Font.preBold.rawValue, size: 18.3))
 | 
						|
                    .foregroundColor(.grayee)
 | 
						|
            }
 | 
						|
            
 | 
						|
            Spacer()
 | 
						|
        }
 | 
						|
        .padding(.horizontal, 13.3)
 | 
						|
        .frame(height: 50)
 | 
						|
        .background(Color.black)
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
struct DetailNavigationBar_Previews: PreviewProvider {
 | 
						|
    static var previews: some View {
 | 
						|
        DetailNavigationBar(title: "이전으로")
 | 
						|
    }
 | 
						|
}
 |