add fixed ADS
This commit is contained in:
31
App.tsx
31
App.tsx
@@ -17,6 +17,15 @@ const App: React.FC = () => {
|
||||
const [errorMsg, setErrorMsg] = useState<string | null>(null);
|
||||
|
||||
// Polling Logic
|
||||
useEffect(() => {
|
||||
try {
|
||||
// @ts-ignore
|
||||
(window.adsbygoogle = window.adsbygoogle || []).push({});
|
||||
} catch (e) {
|
||||
console.error("AdSense error", e);
|
||||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
let isMounted = true;
|
||||
let timeoutId: number;
|
||||
@@ -136,8 +145,7 @@ const App: React.FC = () => {
|
||||
<nav className="flex-1 px-4 space-y-2 mt-4">
|
||||
<button
|
||||
onClick={() => setActiveTab('dashboard')}
|
||||
className={`w-full flex items-center p-3 rounded-xl transition-all ${
|
||||
activeTab === 'dashboard'
|
||||
className={`w-full flex items-center p-3 rounded-xl transition-all ${activeTab === 'dashboard'
|
||||
? 'bg-blue-600 text-white shadow-lg shadow-blue-900/20'
|
||||
: 'text-gray-400 hover:bg-gray-800 hover:text-gray-200'
|
||||
}`}
|
||||
@@ -147,8 +155,7 @@ const App: React.FC = () => {
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setActiveTab('settings')}
|
||||
className={`w-full flex items-center p-3 rounded-xl transition-all ${
|
||||
activeTab === 'settings'
|
||||
className={`w-full flex items-center p-3 rounded-xl transition-all ${activeTab === 'settings'
|
||||
? 'bg-blue-600 text-white shadow-lg shadow-blue-900/20'
|
||||
: 'text-gray-400 hover:bg-gray-800 hover:text-gray-200'
|
||||
}`}
|
||||
@@ -158,6 +165,22 @@ const App: React.FC = () => {
|
||||
</button>
|
||||
</nav>
|
||||
|
||||
{/* AdSense Unit */}
|
||||
<div className="px-4 pb-2">
|
||||
<div className="text-[10px] text-gray-600 text-center mb-1">Sponsored</div>
|
||||
<ins className="adsbygoogle"
|
||||
style={{ display: "block" }}
|
||||
data-ad-client="ca-pub-4444852135420953"
|
||||
data-ad-slot="7799405796"
|
||||
data-ad-format="auto"
|
||||
data-full-width-responsive="true"></ins>
|
||||
<script>
|
||||
(adsbygoogle = window.adsbygoogle || []).push({ });
|
||||
</script>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div className="p-4 border-t border-gray-800">
|
||||
<div className="flex flex-col gap-2">
|
||||
{connectionState === ConnectionState.CONNECTED ? (
|
||||
|
||||
Reference in New Issue
Block a user