|
| 1 | +import { observer } from 'mobx-react'; |
| 2 | +import { FC, useContext } from 'react'; |
| 3 | +import { Card, Col, Container, Row } from 'react-bootstrap'; |
| 4 | + |
| 5 | +import { PageHead } from '../components/Layout/PageHead'; |
| 6 | +import { I18nContext } from '../models/Translation'; |
| 7 | +import styles from '../styles/Bounty.module.less'; |
| 8 | + |
| 9 | +interface BountyViewProps { |
| 10 | + title: string; |
| 11 | + url: string; |
| 12 | + icon: string; |
| 13 | +} |
| 14 | + |
| 15 | +const BountyView: FC<BountyViewProps> = ({ title, url, icon }) => ( |
| 16 | + <Col md={6} lg={4}> |
| 17 | + <Card className={styles.bountyCard}> |
| 18 | + <Card.Body> |
| 19 | + <h5 className={styles.cardTitle}> |
| 20 | + {icon} {title} |
| 21 | + </h5> |
| 22 | + <div className={styles.iframeContainer}> |
| 23 | + <iframe |
| 24 | + src={url} |
| 25 | + className={styles.bountyIframe} |
| 26 | + title={title} |
| 27 | + allow="clipboard-read; clipboard-write" |
| 28 | + /> |
| 29 | + </div> |
| 30 | + </Card.Body> |
| 31 | + </Card> |
| 32 | + </Col> |
| 33 | +); |
| 34 | + |
| 35 | +const BountyPage: FC = observer(() => { |
| 36 | + const { t } = useContext(I18nContext); |
| 37 | + |
| 38 | + const bountyViews: BountyViewProps[] = [ |
| 39 | + { |
| 40 | + title: t('bounty_dashboard'), |
| 41 | + url: 'https://open-source-bazaar.feishu.cn/share/base/dashboard/shrcnt4EaAxn3zx9faRarERgEqf', |
| 42 | + icon: '📊', |
| 43 | + }, |
| 44 | + { |
| 45 | + title: t('bounty_token_leaderboard'), |
| 46 | + url: 'https://open-source-bazaar.feishu.cn/share/base/view/shrcn6QBgImHEjFH5qDf5tjmrzb', |
| 47 | + icon: '🪙', |
| 48 | + }, |
| 49 | + { |
| 50 | + title: t('bounty_task_leaderboard'), |
| 51 | + url: 'https://open-source-bazaar.feishu.cn/share/base/view/shrcnUVgb8E73UthaB2Tk4glnSb', |
| 52 | + icon: '📋', |
| 53 | + }, |
| 54 | + { |
| 55 | + title: t('bounty_task_submission'), |
| 56 | + url: 'https://open-source-bazaar.feishu.cn/share/base/form/shrcn2Ss97TSu3XgPi7mbZbrXLe', |
| 57 | + icon: '📝', |
| 58 | + }, |
| 59 | + { |
| 60 | + title: t('bounty_achievement_leaderboard'), |
| 61 | + url: 'https://open-source-bazaar.feishu.cn/share/base/view/shrcne4IY9mYAfoo9a69oxyAdTb', |
| 62 | + icon: '🏆', |
| 63 | + }, |
| 64 | + { |
| 65 | + title: t('bounty_achievement_submission'), |
| 66 | + url: 'https://open-source-bazaar.feishu.cn/share/base/form/shrcn7yHGIOnPNjdZck3eBaiMVc', |
| 67 | + icon: '✅', |
| 68 | + }, |
| 69 | + { |
| 70 | + title: t('bounty_hero_leaderboard'), |
| 71 | + url: 'https://open-source-bazaar.feishu.cn/share/base/view/shrcnyrOkRfqSAjWEjCQ9T4OOwc', |
| 72 | + icon: '🦸', |
| 73 | + }, |
| 74 | + { |
| 75 | + title: t('bounty_debt_leaderboard'), |
| 76 | + url: 'https://open-source-bazaar.feishu.cn/share/base/view/shrcnImOzkBXW3okKp3nLskPMgd', |
| 77 | + icon: '💳', |
| 78 | + }, |
| 79 | + ]; |
| 80 | + |
| 81 | + return ( |
| 82 | + <> |
| 83 | + <PageHead title={t('bounty_page_title')} /> |
| 84 | + |
| 85 | + {/* Hero Section */} |
| 86 | + <section className={styles.hero}> |
| 87 | + <Container> |
| 88 | + <h1 className={`text-center ${styles.title}`}>{t('bounty_page_title')}</h1> |
| 89 | + <p className={`text-center ${styles.description}`}>{t('bounty_page_description')}</p> |
| 90 | + </Container> |
| 91 | + </section> |
| 92 | + |
| 93 | + <Container className="my-5"> |
| 94 | + <Row className="g-4"> |
| 95 | + {bountyViews.map(view => ( |
| 96 | + <BountyView key={view.url} {...view} /> |
| 97 | + ))} |
| 98 | + </Row> |
| 99 | + </Container> |
| 100 | + </> |
| 101 | + ); |
| 102 | +}); |
| 103 | + |
| 104 | +export default BountyPage; |
0 commit comments