bigbuffet-rw/app/soapbox/features/crypto-donate/index.tsx

41 lines
1.3 KiB
TypeScript
Raw Normal View History

2022-03-25 13:24:10 -07:00
import React, { useState } from 'react';
import { defineMessages, useIntl, FormattedMessage } from 'react-intl';
2022-11-16 09:30:24 -08:00
import { Accordion, Column, Stack } from 'soapbox/components/ui';
2022-11-26 08:38:16 -08:00
import { useInstance } from 'soapbox/hooks';
2022-03-25 13:24:10 -07:00
2022-11-15 09:23:36 -08:00
import SiteWallet from './components/site-wallet';
2022-03-25 13:24:10 -07:00
const messages = defineMessages({
heading: { id: 'column.crypto_donate', defaultMessage: 'Donate Cryptocurrency' },
});
const CryptoDonate: React.FC = (): JSX.Element => {
const intl = useIntl();
2022-11-26 08:38:16 -08:00
const instance = useInstance();
const [explanationBoxExpanded, toggleExplanationBox] = useState(true);
2022-03-25 13:24:10 -07:00
return (
<Column label={intl.formatMessage(messages.heading)} withHeader>
2022-04-24 16:54:46 -07:00
<Stack space={5}>
<Accordion
headline={<FormattedMessage id='crypto_donate.explanation_box.title' defaultMessage='Sending cryptocurrency donations' />}
expanded={explanationBoxExpanded}
onToggle={toggleExplanationBox}
>
<FormattedMessage
id='crypto_donate.explanation_box.message'
defaultMessage='{siteTitle} accepts cryptocurrency donations. You may send a donation to any of the addresses below. Thank you for your support!'
2022-11-26 08:38:16 -08:00
values={{ siteTitle: instance.title }}
2022-04-24 16:54:46 -07:00
/>
</Accordion>
2022-03-25 13:24:10 -07:00
<SiteWallet />
2022-04-24 16:54:46 -07:00
</Stack>
2022-03-25 13:24:10 -07:00
</Column>
);
};
export default CryptoDonate;