Donate options

This commit is contained in:
Ben Grant 2021-05-05 22:21:27 +10:00
parent 01a8a26e04
commit 6ad9472434
12 changed files with 68 additions and 56 deletions

View file

@ -62,7 +62,7 @@ const AvailabilityViewer = ({
onSegmentFocus={count => setFocusCount(count)} onSegmentFocus={count => setFocusCount(count)}
/> />
<Center>Hover or tap the calendar below to see who is available</Center> <Center>Hover or tap the calendar below to see who is available</Center>
{!!people.length && ( {people.length > 1 && (
<> <>
<Center>Click the names below to view people individually</Center> <Center>Click the names below to view people individually</Center>
<People> <People>

View file

@ -5,7 +5,7 @@ import { useTWAStore } from 'stores';
const PAYMENT_METHOD = 'https://play.google.com/billing'; const PAYMENT_METHOD = 'https://play.google.com/billing';
const SKU = 'crab_donation'; const SKU = 'crab_donation';
const Donate = () => { const Donate = ({ onDonate = null }) => {
const store = useTWAStore(); const store = useTWAStore();
useEffect(() => { useEffect(() => {
@ -80,9 +80,12 @@ const Donate = () => {
alert('Cannot make donation through Google. Please try donating through the website crab.fit 🦀'); alert('Cannot make donation through Google. Please try donating through the website crab.fit 🦀');
} }
} }
} else if (onDonate !== null) {
event.preventDefault();
onDonate();
} }
}} }}
href="https://www.paypal.com/donate?business=N89X6YXRT5HKW&item_name=Crab+Fit+Donation&currency_code=AUD" href="https://www.paypal.com/donate?business=N89X6YXRT5HKW&item_name=Crab+Fit+Donation&currency_code=AUD&amount=5"
target="_blank" target="_blank"
rel="noreferrer" rel="noreferrer"
> >

View file

@ -0,0 +1,28 @@
import { useState } from 'react';
import { Donate } from 'components';
import { Wrapper, Link } from './footerStyle';
const Footer = () => {
const [donateMode, setDonateMode] = useState(false);
return (
<Wrapper id="donate" donateMode={donateMode}>
{donateMode ? (
<>
<Link href="https://www.paypal.com/donate?business=N89X6YXRT5HKW&item_name=Crab+Fit+Donation&currency_code=AUD&amount=2" target="_blank">Donate $2</Link>
<Link href="https://www.paypal.com/donate?business=N89X6YXRT5HKW&item_name=Crab+Fit+Donation&currency_code=AUD&amount=5" target="_blank"><strong>Donate $5</strong></Link>
<Link href="https://www.paypal.com/donate?business=N89X6YXRT5HKW&item_name=Crab+Fit+Donation&currency_code=AUD&amount=10" target="_blank">Donate $10</Link>
<Link href="https://www.paypal.com/donate?business=N89X6YXRT5HKW&item_name=Crab+Fit+Donation&currency_code=AUD" target="_blank">Choose an amount</Link>
</>
) : (
<>
<span>Thank you for using Crab Fit. If you like it, consider donating.</span>
<Donate onDonate={() => setDonateMode(true)} />
</>
)}
</Wrapper>
);
};
export default Footer;

View file

@ -0,0 +1,23 @@
import styled from '@emotion/styled';
export const Wrapper = styled.footer`
width: 600px;
margin: 20px auto;
max-width: calc(100% - 60px);
display: flex;
align-items: center;
justify-content: space-between;
${props => props.donateMode && `
flex-wrap: wrap;
`}
`;
export const Link = styled.a`
padding: 11px 10px;
white-space: nowrap;
& strong {
font-weight: 800;
}
`;

View file

@ -15,3 +15,4 @@ export { default as Center } from './Center/Center';
export { default as Donate } from './Donate/Donate'; export { default as Donate } from './Donate/Donate';
export { default as Settings } from './Settings/Settings'; export { default as Settings } from './Settings/Settings';
export { default as Egg } from './Egg/Egg'; export { default as Egg } from './Egg/Egg';
export { default as Footer } from './Footer/Footer';

View file

@ -9,7 +9,7 @@ import customParseFormat from 'dayjs/plugin/customParseFormat';
import { import {
Center, Center,
Donate, Footer,
TextField, TextField,
SelectField, SelectField,
Button, Button,
@ -20,7 +20,6 @@ import {
import { import {
StyledMain, StyledMain,
Footer,
Logo, Logo,
Title, Title,
EventName, EventName,
@ -442,10 +441,7 @@ const Event = (props) => {
</> </>
)} )}
<Footer id="donate"> <Footer />
<span>Thank you for using Crab Fit. If you like it, consider donating.</span>
<Donate />
</Footer>
</> </>
); );
}; };

View file

@ -6,15 +6,6 @@ export const StyledMain = styled.div`
max-width: calc(100% - 60px); max-width: calc(100% - 60px);
`; `;
export const Footer = styled.footer`
width: 600px;
margin: 50px auto 20px;
max-width: calc(100% - 60px);
display: flex;
align-items: center;
justify-content: space-between;
`;
export const Logo = styled.img` export const Logo = styled.img`
width: 2.5rem; width: 2.5rem;
margin-right: 16px; margin-right: 16px;

View file

@ -4,7 +4,7 @@ import { Link, useHistory } from 'react-router-dom';
import { import {
Button, Button,
Center, Center,
Donate, Footer,
AvailabilityViewer, AvailabilityViewer,
Legend, Legend,
} from 'components'; } from 'components';
@ -14,7 +14,6 @@ import {
Logo, Logo,
Title, Title,
AboutSection, AboutSection,
Footer,
P, P,
Step, Step,
FakeCalendar, FakeCalendar,
@ -94,10 +93,7 @@ const Help = () => {
</StyledMain> </StyledMain>
</AboutSection> </AboutSection>
<Footer id="donate"> <Footer />
<span>Thank you for using Crab Fit. If you like it, consider donating.</span>
<Donate />
</Footer>
</> </>
); );
}; };

View file

@ -27,15 +27,6 @@ export const AboutSection = styled.section`
padding: 20px 0; padding: 20px 0;
`; `;
export const Footer = styled.footer`
width: 600px;
margin: 20px auto;
max-width: calc(100% - 60px);
display: flex;
align-items: center;
justify-content: space-between;
`;
export const P = styled.p` export const P = styled.p`
font-weight: 500; font-weight: 500;
line-height: 1.6em; line-height: 1.6em;

View file

@ -14,8 +14,8 @@ import {
SelectField, SelectField,
Button, Button,
Center, Center,
Donate,
Error, Error,
Footer,
} from 'components'; } from 'components';
import { import {
@ -26,7 +26,6 @@ import {
Logo, Logo,
Links, Links,
AboutSection, AboutSection,
Footer,
P, P,
Stats, Stats,
Stat, Stat,
@ -245,18 +244,15 @@ const Home = ({ offline }) => {
</Stats> </Stats>
<P>Crab Fit helps you fit your event around everyone's schedules. Simply create an event above and send the link to everyone that is participating. Results update live and you will be able to see a heat-map of when everyone is free.<br /><Link to="/how-to">Learn more about how to Crab Fit</Link>.</P> <P>Crab Fit helps you fit your event around everyone's schedules. Simply create an event above and send the link to everyone that is participating. Results update live and you will be able to see a heat-map of when everyone is free.<br /><Link to="/how-to">Learn more about how to Crab Fit</Link>.</P>
{/* eslint-disable-next-line */} {/* eslint-disable-next-line */}
<P>Create a lot of Crab Fits? Get the <a href="https://chrome.google.com/webstore/detail/crab-fit/pnafiibmjbiljofcpjlbonpgdofjhhkj" target="_blank">Chrome extension</a> or <a href="https://addons.mozilla.org/en-US/firefox/addon/crab-fit/" target="_blank">Firefox extension</a> for your browser!</P> <P>Create a lot of Crab Fits? Get the <a href="https://chrome.google.com/webstore/detail/crab-fit/pnafiibmjbiljofcpjlbonpgdofjhhkj" target="_blank">Chrome extension</a> or <a href="https://addons.mozilla.org/en-US/firefox/addon/crab-fit/" target="_blank">Firefox extension</a> for your browser! You can also download the <a href="https://play.google.com/store/apps/details?id=fit.crab" target="_blank">Android app</a> to Crab Fit on the go.</P>
{/* eslint-disable-next-line */} {/* eslint-disable-next-line */}
<P>Created by <a href="https://bengrant.dev" target="_blank">Ben Grant</a>, Crab Fit is the modern-day solution to your group event planning debates.</P> <P>Created by <a href="https://bengrant.dev" target="_blank">Ben Grant</a>, Crab Fit is the modern-day solution to your group event planning debates.</P>
<P>The code for Crab Fit is open source, if you find any issues or want to contribute, you can visit the <a href="https://github.com/GRA0007/crab.fit" target="_blank" rel="noreferrer">repository</a>.</P> <P>The code for Crab Fit is open source, if you find any issues or want to contribute, you can visit the <a href="https://github.com/GRA0007/crab.fit" target="_blank" rel="noreferrer">repository</a>. By using Crab Fit you agree to the <Link to="/privacy">privacy policy</Link>.</P>
<P>Crab Fit costs more than <strong>$100 per month</strong> to run. Consider donating below if it helped you out so it can stay free for everyone. 🦀</P> <P>Crab Fit costs more than <strong>$100 per month</strong> to run. Consider donating below if it helped you out so it can stay free for everyone. 🦀</P>
</StyledMain> </StyledMain>
</AboutSection> </AboutSection>
<Footer id="donate"> <Footer />
<span>Thank you for using Crab Fit. If you like it, consider donating.</span>
<Donate />
</Footer>
</> </>
); );
}; };

View file

@ -51,15 +51,6 @@ export const AboutSection = styled.section`
padding: 20px 0; padding: 20px 0;
`; `;
export const Footer = styled.footer`
width: 600px;
margin: 20px auto;
max-width: calc(100% - 60px);
display: flex;
align-items: center;
justify-content: space-between;
`;
export const P = styled.p` export const P = styled.p`
font-weight: 500; font-weight: 500;
line-height: 1.6em; line-height: 1.6em;

View file

@ -4,7 +4,7 @@ import { Link, useHistory } from 'react-router-dom';
import { import {
Button, Button,
Center, Center,
Donate, Footer,
} from 'components'; } from 'components';
import { import {
@ -12,7 +12,6 @@ import {
Logo, Logo,
Title, Title,
AboutSection, AboutSection,
Footer,
P, P,
} from '../Help/helpStyle'; } from '../Help/helpStyle';
@ -95,10 +94,7 @@ const Privacy = () => {
</StyledMain> </StyledMain>
</AboutSection> </AboutSection>
<Footer id="donate"> <Footer />
<span>Thank you for using Crab Fit. If you like it, consider donating.</span>
<Donate />
</Footer>
</> </>
); );
}; };