Skip to content

Commit

Permalink
Homepage: Add support us section (#891)
Browse files Browse the repository at this point in the history
  • Loading branch information
jvaclavik authored Jan 13, 2025
1 parent a96b183 commit b92b6b2
Show file tree
Hide file tree
Showing 5 changed files with 196 additions and 20 deletions.
Binary file added public/openclimbing/btcln.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 31 additions & 20 deletions src/components/HomepagePanel/HomepageOpenClimbing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ import { LogoMaptiler } from '../../assets/LogoMaptiler';
import { DividerOpenClimbing } from './DividerOpenClimbing';
import { useMobileMode } from '../helpers';
import { HomepageOpenClimbingGallery } from './HomepageOpenClimbingGallery';
import VolunteerActivismIcon from '@mui/icons-material/VolunteerActivism';
import { SupportUs } from './SupportUs';
const AccordionStyle = {
'&:before': {
backgroundColor: 'transparent !important',
},
};

export const Divider = styled.div`
align-items: center;
Expand Down Expand Up @@ -131,12 +138,32 @@ const StyledGithubIcon = styled(GithubIcon)`
margin: -2px 8px 0 0;
`;

const Banners = () => (
<Stack
spacing={1}
direction={'row'}
mt={6}
mb={2}
justifyContent="space-between"
>
<a href="https://www.maptiler.com" target="_blank">
<LogoMaptiler width={140} />
</a>
<a
href="https://vercel.com/?utm_source=osm-app-team&utm_campaign=oss"
target="_blank"
>
<img src="/vercel.svg" alt="Vercel" width="160" />
</a>
</Stack>
);

const ImportantLinks = () => (
<>
<Typography variant="h6" paragraph mt={4}>
{t('homepage.important_links')}
</Typography>
<Accordion sx={{ background: 'rgba(0,0,0,0.05)' }}>
<Accordion disableGutters elevation={0} sx={AccordionStyle}>
<AccordionSummary
expandIcon={<ExpandMoreIcon />}
aria-controls="panel1-content"
Expand All @@ -155,7 +182,7 @@ const ImportantLinks = () => (
</Typography>
</AccordionDetails>
</Accordion>
<Accordion sx={{ background: 'rgba(0, 0, 0, 0.05)' }}>
<Accordion disableGutters elevation={0} sx={AccordionStyle}>
<AccordionSummary
expandIcon={<ExpandMoreIcon />}
aria-controls="panel1-content"
Expand All @@ -174,24 +201,6 @@ const ImportantLinks = () => (
</Typography>
</AccordionDetails>
</Accordion>

<Stack
spacing={1}
direction={'row'}
mt={6}
mb={2}
justifyContent="space-between"
>
<a href="https://www.maptiler.com" target="_blank">
<LogoMaptiler width={140} />
</a>
<a
href="https://vercel.com/?utm_source=osm-app-team&utm_campaign=oss"
target="_blank"
>
<img src="/vercel.svg" alt="Vercel" width="160" />
</a>
</Stack>
</>
);

Expand Down Expand Up @@ -219,6 +228,8 @@ export function HomepageOpenClimbing({ onClose }: { onClose: () => void }) {
</Divider>

<ImportantLinks />
<SupportUs />
<Banners />
</Stack>
</Content>
</PanelScrollbars>
Expand Down
141 changes: 141 additions & 0 deletions src/components/HomepagePanel/SupportUs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
import {
Accordion,
AccordionDetails,
AccordionSummary,
AppBar,
Box,
Dialog,
DialogContent,
IconButton,
Stack,
Toolbar,
Tooltip,
Typography,
} from '@mui/material';
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
import React, { useState } from 'react';
import CloseIcon from '@mui/icons-material/Close';
import styled from '@emotion/styled';
import { useUserThemeContext } from '../../helpers/theme';
import { t } from '../../services/intl';

const AccordionStyle = {
'&:before': {
backgroundColor: 'transparent !important',
},
};
const Qr = styled.img<{ $isDark: boolean }>`
${({ $isDark }) => $isDark && `filter: invert(1);`}
`;

export const SupportUs = () => {
const [isBitcoinDialogOpen, setIsBitcoinDialogOpen] = useState(false);
const { currentTheme } = useUserThemeContext();
const isDark = currentTheme === 'dark';

const onClose = () => {
setIsBitcoinDialogOpen(false);
};
return (
<>
<Box mt={5}>
<Accordion disableGutters sx={AccordionStyle} elevation={0}>
<AccordionSummary
expandIcon={<ExpandMoreIcon />}
aria-controls="panel1-content"
id="panel1-header"
>
<Stack direction="row" spacing={2} alignItems="center">
<div style={{ fontSize: 32 }}>❤️</div>
<Typography variant="body1" paragraph>
{t('support_us.title')}
</Typography>
</Stack>
</AccordionSummary>
<AccordionDetails>
<Typography variant="body2" mb={2}>
{t('support_us.p1')}
</Typography>
<Typography variant="body2" mt={2}>
{t('support_us.p2')}
</Typography>
<Typography variant="body2" mt={2}>
{t('support_us.how_to_help')}
</Typography>
<ul>
<li>
<Typography variant="body2">{t('support_us.share')}</Typography>
</li>
<li>
<Typography variant="body2">
<a href="mailto:[email protected]">
{t('support_us.feedback')}
</a>
</Typography>
</li>
<li>
<Typography variant="body2">
{t('support_us.add_content')}
</Typography>
</li>
<li>
<Typography variant="body2">
{t('support_us.develop')}
</Typography>
</li>
<li>
<Typography variant="body2">
{t('support_us.contribute_financially')}
</Typography>
<ul>
<li>
<Typography variant="body2">
<a onClick={() => setIsBitcoinDialogOpen(true)}>
Bitcoin
</a>
</Typography>
</li>
<li>
<Typography variant="body2">
<a href="https://github.com/sponsors/zbycz">
Github sponsor
</a>
</Typography>
</li>
<li>
<Typography variant="body2">
<a href="https://buymeacoffee.com/openclimbing.org">
Buy me a coffee
</a>
</Typography>
</li>
</ul>
</li>
</ul>
{t('support_us.thanks')}
</AccordionDetails>
</Accordion>
</Box>
<Dialog open={isBitcoinDialogOpen} onClose={onClose}>
<AppBar position="static" color="transparent">
<Toolbar>
<Typography noWrap variant="h6" component="div">
{t('support_us.bitcoin_dialog_title')}
</Typography>

<Tooltip title="Close crag detail">
<IconButton color="primary" edge="end" onClick={onClose}>
<CloseIcon fontSize="small" />
</IconButton>
</Tooltip>
</Toolbar>
</AppBar>

<DialogContent dividers>
<Qr src="/openclimbing/btcln.png" $isDark={isDark} />
<Typography variant="body1">[email protected]</Typography>
</DialogContent>
</Dialog>
</>
);
};
12 changes: 12 additions & 0 deletions src/locales/cs.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,18 @@ export default {
'homepage.discover_more_p1': `Prozkoumat dalších`,
'homepage.discover_more_p2': `oblastí`,

'support_us.title': `Podpořte nás`,
'support_us.p1': `Děláme tuto aplikaci ve volném čase protože nás to baví a protože věříme, že informace o lezeckých cestách ve veřejném prostoru by měly být svobodně dostupné informace podobně jako třeba názvy ulic.`,
'support_us.p2': `Pokud vám tato aplikace pomáhá nebo souzníte s tímto přístupem, budeme moc rádi pokud nás jakkoliv podpoříte.`,
'support_us.how_to_help': `Jak pomoci:`,
'support_us.share': `Sdílejte openclimbing.org mezi svými kamarády nebo na sociálních sítích`,
'support_us.feedback': `Napište nám zpětnou vazbu`,
'support_us.add_content': `Zakreslete lezecké cesty`,
'support_us.develop': `Umíte programovat? Pošlete pull request do repozitáře.`,
'support_us.contribute_financially': `Přispějte finančně`,
'support_us.thanks': `Thank you!`,
'support_us.bitcoin_dialog_title': `Support us with Bitcoin`,

'searchbox.placeholder': 'Prohledat OpenStreetMap',
'searchbox.category': 'kategorie',
'searchbox.overpass_success': 'Nalezeno výsledků: __count__',
Expand Down
12 changes: 12 additions & 0 deletions src/locales/vocabulary.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,18 @@ export default {
'homepage.discover_more_p1': `Discover other`,
'homepage.discover_more_p2': `areas`,

'support_us.title': `Support us`,
'support_us.p1': `We're building this app in our spare time because we enjoy it and because we believe that information about climbing routes in public spaces should be freely available, just like street names.`,
'support_us.p2': `If this app helps you or resonates with you, we'd be thrilled if you supported us in any way.`,
'support_us.how_to_help': `How to help:`,
'support_us.share': `Share openclimbing.org with your friends or on social media`,
'support_us.feedback': `Send us your feedback`,
'support_us.add_content': `Map out the climbing routes`,
'support_us.develop': `Can you code? Submit a pull request to our repository.`,
'support_us.contribute_financially': `Contribute financially`,
'support_us.thanks': `Thank you!`,
'support_us.bitcoin_dialog_title': `Support us with Bitcoin`,

'searchbox.placeholder': 'Search OpenStreetMap',
'searchbox.category': 'category',
'searchbox.overpass_success': 'Results found: __count__',
Expand Down

0 comments on commit b92b6b2

Please sign in to comment.