Skip to content

Commit

Permalink
chore: replace campaign bar with sponsor bar
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasbach committed Jul 6, 2024
1 parent 74676c5 commit c98329d
Showing 1 changed file with 16 additions and 28 deletions.
44 changes: 16 additions & 28 deletions packages/docs/src/components/CampaignBar.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import styles from './CampaignBar.module.css';
import React, { useState, useEffect } from 'react';
import { Campaign } from '@lukasbach/campaigns-react';

const localStorageKey = 'hide-campaign-bar';
const days = 1000 * 60 * 60 * 24;
Expand All @@ -18,32 +17,21 @@ export default function CampaignBar() {
}

return (
<Campaign
dontRenderIfLoading={true}
ignore={['react-complex-tree']}
changeInterval={30}
weighted={true}
render={campaign =>
campaign && (
<div className={styles.bar}>
<a href={campaign.url} target="_blank" className={styles.content} title={campaign.long ?? campaign.short}>
<div className={styles.alsocheckout}>Also checkout:</div>
<div className={styles.title}>{campaign.product}</div>
<div className={styles.description}>{campaign.short}</div>
</a>
<div
aria-label="Hide banner"
className={styles.close}
onClick={() => {
setHide(true);
localStorage.setItem(localStorageKey, `${Date.now()}`);
}}
>
×
</div>
</div>
)
}
/>
<div className={styles.bar}>
<a href="https://github.com/sponsors/lukasbach" target="_blank" className={styles.content} >
<div className={styles.alsocheckout}>Github Sponsors</div>
<div className={styles.title}>If react-complex-tree provides meaningful value to you, consider supporting its developement and maintanence by sponsoring on Github</div>
</a>
<div
aria-label="Hide banner"
className={styles.close}
onClick={() => {
setHide(true);
localStorage.setItem(localStorageKey, `${Date.now()}`);
}}
>
×
</div>
</div>
);
}

0 comments on commit c98329d

Please sign in to comment.