wuhp commited on
Commit
f226ca1
·
verified ·
1 Parent(s): d359dfb

Update components/Sidebar.tsx

Browse files
Files changed (1) hide show
  1. components/Sidebar.tsx +9 -6
components/Sidebar.tsx CHANGED
@@ -1,3 +1,4 @@
 
1
  import React from 'react';
2
  import { LAYER_DEFINITIONS } from '../constants';
3
  import { LayerType } from '../types';
@@ -192,11 +193,13 @@ const Sidebar: React.FC<SidebarProps> = ({ onOpenAIBuilder, onSelectTemplate, is
192
  ))
193
  )}
194
 
195
- {/* Sidebar Ad Spot */}
196
- <div className="pt-4 border-t border-slate-800/50">
197
- <div className="text-[10px] text-slate-600 mb-2 uppercase tracking-wider font-semibold text-center">Sponsored</div>
198
- <GoogleAd />
199
- </div>
 
 
200
 
201
  </div>
202
 
@@ -210,4 +213,4 @@ const Sidebar: React.FC<SidebarProps> = ({ onOpenAIBuilder, onSelectTemplate, is
210
  );
211
  };
212
 
213
- export default Sidebar;
 
1
+
2
  import React from 'react';
3
  import { LAYER_DEFINITIONS } from '../constants';
4
  import { LayerType } from '../types';
 
193
  ))
194
  )}
195
 
196
+ {/* Sidebar Ad Spot - Only render when open to avoid 0-width errors */}
197
+ {isOpen && (
198
+ <div className="pt-4 border-t border-slate-800/50">
199
+ <div className="text-[10px] text-slate-600 mb-2 uppercase tracking-wider font-semibold text-center">Sponsored</div>
200
+ <GoogleAd />
201
+ </div>
202
+ )}
203
 
204
  </div>
205
 
 
213
  );
214
  };
215
 
216
+ export default Sidebar;