@@ -16,6 +16,7 @@ const TopBar: React.FC<TopBarProps> = ({ onSelectModel, onOpenSettingsDialog })
16
16
const [ selectedModelName , setSelectedModelName ] = useState ( '' ) ;
17
17
const [ selectedProvider , setSelectedProvider ] = useState ( '' ) ;
18
18
const [ isMaximized , setIsMaximized ] = useState ( false ) ;
19
+ const [ platform , setPlatform ] = useState ( '' ) ;
19
20
20
21
// Check if window is maximized on mount
21
22
useEffect ( ( ) => {
@@ -31,6 +32,11 @@ const TopBar: React.FC<TopBarProps> = ({ onSelectModel, onOpenSettingsDialog })
31
32
window . electron . onWindowMaximizedChange ( ( _event , maximized ) => {
32
33
setIsMaximized ( maximized ) ;
33
34
} ) ;
35
+
36
+ window . electron . getPlatform ( ) . then ( ( platform ) => {
37
+ setPlatform ( platform ) ;
38
+ } ) ;
39
+
34
40
} , [ ] ) ;
35
41
36
42
// Window control handlers
@@ -86,19 +92,26 @@ const TopBar: React.FC<TopBarProps> = ({ onSelectModel, onOpenSettingsDialog })
86
92
return (
87
93
< div className = "flex items-center justify-between h-16 bg-main-background-color app-region-drag" >
88
94
{ /* Logo area */ }
89
- < div className = "w-[68px] aspect-square flex items-center justify-center h-16" >
90
- < div className = "flex items-center justify-center w-10 h-10" >
91
- < img
92
- src = { tensorBlockLogo }
93
- alt = "TensorBlock Logo"
94
- className = "w-8 h-8"
95
- onError = { ( e ) => {
96
- const target = e . target as HTMLImageElement ;
97
- target . src = 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="2" width="20" height="20" rx="5" ry="5" /><path d="M16 16h.01" /><path d="M8 16h.01" /><path d="M12 8v8" /></svg>' ;
98
- } }
99
- />
95
+ {
96
+ platform === 'darwin' ?
97
+ < div className = 'w-[68px] aspect-square flex items-center justify-center h-16' >
100
98
</ div >
101
- </ div >
99
+ :
100
+ < div className = "w-[68px] aspect-square flex items-center justify-center h-16" >
101
+ < div className = "flex items-center justify-center w-10 h-10" >
102
+ < img
103
+ src = { tensorBlockLogo }
104
+ alt = "TensorBlock Logo"
105
+ className = "w-8 h-8"
106
+ onError = { ( e ) => {
107
+ const target = e . target as HTMLImageElement ;
108
+ target . src = 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="2" width="20" height="20" rx="5" ry="5" /><path d="M16 16h.01" /><path d="M8 16h.01" /><path d="M12 8v8" /></svg>' ;
109
+ } }
110
+ />
111
+ </ div >
112
+ </ div >
113
+ }
114
+
102
115
103
116
< div className = 'flex items-center justify-center w-full gap-2' >
104
117
< div className = "flex items-center w-3/5 gap-2 md:w-2/5" >
@@ -140,34 +153,41 @@ const TopBar: React.FC<TopBarProps> = ({ onSelectModel, onOpenSettingsDialog })
140
153
/>
141
154
</ div >
142
155
143
- < div className = 'flex items-start justify-center h-full gap-1' >
144
- < button
145
- className = 'btn hover:bg-gray-200 bg-transparent border-0 px-3 py-1.5 text-sm font-medium text-gray-600 flex justify-center items-center app-region-no-drag'
146
- onClick = { handleMinimize }
147
- >
148
- < Minus className = 'w-5 h-5' />
149
- </ button >
156
+ { platform === 'darwin' ?
157
+ < div className = 'flex items-start justify-center h-full gap-1' >
158
+ </ div >
159
+ :
160
+ < div className = 'flex items-start justify-center h-full gap-1' >
161
+ < button
162
+ className = 'btn hover:bg-gray-200 bg-transparent border-0 px-3 py-1.5 text-sm font-medium text-gray-600 flex justify-center items-center app-region-no-drag'
163
+ onClick = { handleMinimize }
164
+ >
165
+ < Minus className = 'w-5 h-5' />
166
+ </ button >
150
167
151
- < button
152
- className = 'btn hover:bg-gray-200 bg-transparent border-0 px-3 py-1.5 text-sm font-medium text-gray-600 flex justify-center items-center app-region-no-drag'
153
- onClick = { handleMaximize }
154
- >
155
- { isMaximized ?
156
- < svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 20 20" fill = "none" className = 'w-5 h-5 py-0.5' >
157
- < path d = "M2 16.5V6.5C2 5.67157 2.67157 5 3.5 5H13.5C14.3284 5 15 5.67157 15 6.5V16.5C15 17.3284 14.3284 18 13.5 18H3.5C2.67157 18 2 17.3284 2 16.5Z" stroke = "#111" stroke-width = "1.67" />
158
- < path d = "M6 5V3.5C6 2.67157 6.67157 2 7.5 2H16.5C17.3284 2 18 2.67157 18 3.5V12.5C18 13.3284 17.3284 14 16.5 14H15" stroke = "#111" stroke-width = "1.67" stroke-linecap = "round" />
159
- </ svg >
160
- :
161
- < Square className = 'w-5 h-5 p-0.5' /> }
162
- </ button >
168
+ < button
169
+ className = 'btn hover:bg-gray-200 bg-transparent border-0 px-3 py-1.5 text-sm font-medium text-gray-600 flex justify-center items-center app-region-no-drag'
170
+ onClick = { handleMaximize }
171
+ >
172
+ { isMaximized ?
173
+ < svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 20 20" fill = "none" className = 'w-5 h-5 py-0.5' >
174
+ < path d = "M2 16.5V6.5C2 5.67157 2.67157 5 3.5 5H13.5C14.3284 5 15 5.67157 15 6.5V16.5C15 17.3284 14.3284 18 13.5 18H3.5C2.67157 18 2 17.3284 2 16.5Z" stroke = "#111" stroke-width = "1.67" />
175
+ < path d = "M6 5V3.5C6 2.67157 6.67157 2 7.5 2H16.5C17.3284 2 18 2.67157 18 3.5V12.5C18 13.3284 17.3284 14 16.5 14H15" stroke = "#111" stroke-width = "1.67" stroke-linecap = "round" />
176
+ </ svg >
177
+ :
178
+ < Square className = 'w-5 h-5 p-0.5' /> }
179
+ </ button >
163
180
164
- < button
165
- className = 'btn hover:bg-red-500 bg-transparent border-0 px-3 py-1.5 text-sm font-medium text-gray-600 hover:text-white flex justify-center items-center app-region-no-drag'
166
- onClick = { handleClose }
167
- >
168
- < X className = 'w-5 h-5' />
169
- </ button >
170
- </ div >
181
+ < button
182
+ className = 'btn hover:bg-red-500 bg-transparent border-0 px-3 py-1.5 text-sm font-medium text-gray-600 hover:text-white flex justify-center items-center app-region-no-drag'
183
+ onClick = { handleClose }
184
+ >
185
+ < X className = 'w-5 h-5' />
186
+ </ button >
187
+ </ div >
188
+ }
189
+
190
+
171
191
</ div >
172
192
) ;
173
193
} ;
0 commit comments