From 0daf638b6864faab9af87d7a9afda6d40cf5ce2f Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Mon, 21 Aug 2023 04:41:54 +0900 Subject: [PATCH] =?UTF-8?q?=EB=9D=BC=EC=9D=B4=EB=B8=8C=20=EB=A9=94?= =?UTF-8?q?=EC=9D=B8=20-=20=EB=A9=94=EC=8B=9C=EC=A7=80=20=ED=83=AD=20?= =?UTF-8?q?=EB=B3=B4=EC=9D=B4=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Main/Home/BottomTabView.swift | 64 ++++++++----------- 1 file changed, 26 insertions(+), 38 deletions(-) diff --git a/SodaLive/Sources/Main/Home/BottomTabView.swift b/SodaLive/Sources/Main/Home/BottomTabView.swift index c11e073..9d1031d 100644 --- a/SodaLive/Sources/Main/Home/BottomTabView.swift +++ b/SodaLive/Sources/Main/Home/BottomTabView.swift @@ -9,22 +9,12 @@ import SwiftUI struct BottomTabView: View { let width: CGFloat - let tabWidth: CGFloat @Binding var currentTab: HomeViewModel.CurrentTab - init(width: CGFloat, currentTab: Binding) { - self.width = width - self._currentTab = currentTab - - if UserDefaults.bool(forKey: .auth) { - tabWidth = width / 5 - } else { - tabWidth = width / 4 - } - } - var body: some View { HStack(spacing: 0) { + let tabWidth = width / 5 + TabButton( title: "콘텐츠", action: { @@ -100,32 +90,30 @@ struct BottomTabView: View { width: tabWidth ) - if UserDefaults.bool(forKey: .auth) { - TabButton( - title: "메시지", - action: { - if currentTab != .message { - currentTab = .message - } - }, - image: { - currentTab == .message ? - "ic_tabbar_message_selected" : - "ic_tabbar_message_normal" - }, - fontName: { - currentTab == .message ? - Font.bold.rawValue : - Font.medium.rawValue - }, - color: { - currentTab == .message ? - Color(hex: "9970ff") : - Color(hex: "909090") - }, - width: tabWidth - ) - } + TabButton( + title: "메시지", + action: { + if currentTab != .message { + currentTab = .message + } + }, + image: { + currentTab == .message ? + "ic_tabbar_message_selected" : + "ic_tabbar_message_normal" + }, + fontName: { + currentTab == .message ? + Font.bold.rawValue : + Font.medium.rawValue + }, + color: { + currentTab == .message ? + Color(hex: "9970ff") : + Color(hex: "909090") + }, + width: tabWidth + ) TabButton( title: "마이",