@@ -52,7 +52,43 @@ struct EmotesView: View, Equatable {
5252 self . onSelect ( DiscordEmote ( id: " stock " , name: self . search) )
5353 self . presentationMode. wrappedValue. dismiss ( )
5454 }
55- TabView ( selection: self . $selection) {
55+ HStack {
56+ Button {
57+ withAnimation ( . easeInOut) {
58+ self . selection = . emotes
59+ }
60+ } label: {
61+ Text ( " Emotes " )
62+ . fontWeight ( . medium)
63+ . padding ( 5 )
64+ . padding ( . horizontal, 3 )
65+ . if ( self . selection == . emotes, transform: {
66+ $0
67+ . background ( RoundedRectangle ( cornerRadius: 5 ) . fill ( Color . secondary. opacity ( 0.5 ) ) )
68+ } )
69+ }
70+ . buttonStyle ( . plain)
71+ . foregroundColor ( . primary)
72+ Button {
73+ withAnimation ( . easeInOut) {
74+ self . selection = . stickers
75+ }
76+ } label: {
77+ Text ( " Stickers " )
78+ . fontWeight ( . medium)
79+ . padding ( 5 )
80+ . padding ( . horizontal, 3 )
81+ . if ( self . selection == . stickers, transform: {
82+ $0
83+ . background ( RoundedRectangle ( cornerRadius: 5 ) . fill ( Color . secondary. opacity ( 0.5 ) ) )
84+ } )
85+ }
86+ . buttonStyle ( . plain)
87+ . foregroundColor ( . primary)
88+ }
89+ . padding ( 1 )
90+ . background ( RoundedRectangle ( cornerRadius: 10 ) . fill ( Color ( NSColor . windowBackgroundColor) ) )
91+ if self . selection == . emotes {
5692 ScrollView {
5793 LazyVStack ( alignment: . leading) {
5894 if search. isEmpty {
@@ -82,7 +118,7 @@ struct EmotesView: View, Equatable {
82118 }
83119 }
84120 }
85-
121+
86122 } else {
87123 LazyVGrid ( columns: columns) {
88124 ForEach ( Storage . emotes. values. flatMap { $0 } . filter { $0. name. contains ( search) } , id: \. id) { emote in
@@ -104,10 +140,9 @@ struct EmotesView: View, Equatable {
104140 }
105141 }
106142 . padding ( )
107- . tabItem ( { Text ( " Emotes " ) } )
143+ } else {
108144 if #available( macOS 12 . 0 , * ) {
109145 StickersView ( )
110- . tabItem ( { Text ( " Stickers " ) } )
111146 }
112147 }
113148 }
0 commit comments