]> git.localhorst.tv Git - alttp.git/commitdiff
update front page title on navigate
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Thu, 12 May 2022 10:30:45 +0000 (12:30 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Thu, 12 May 2022 10:30:45 +0000 (12:30 +0200)
resources/js/components/pages/AosFront.js

index 8ae6d8b912737b0cb3993fae563b081d1dad1ab2..d308f7d6b2ca3b349a9e1a0c3854cd56cd10c85c 100644 (file)
@@ -5,70 +5,80 @@ import { withTranslation } from 'react-i18next';
 import Icon from '../common/Icon';
 import i18n from '../../i18n';
 
-const AosFront = () => <Container>
-       <div className="my-5 text-center">
-               <h1>Castlevania: Aria of Sorrow</h1>
-       </div>
-       <Row>
-               <Col className="text-center mb-3" sm={6} md={4}>
-                       <Button
-                               href="https://discord.gg/VEtVYNr"
-                               size="lg"
-                               target="_blank"
-                               variant="discord"
-                       >
-                               <Icon.DISCORD />
-                               {' '}
-                               {i18n.t('aos.randoDiscord')}
-                       </Button>
-               </Col>
-               <Col className="text-center mb-3" sm={6} md={4}>
-                       <Button
-                               href="https://aosrando.surge.sh/"
-                               size="lg"
-                               target="_blank"
-                               variant="primary"
-                       >
-                               {i18n.t('aos.randoWeb')}
-                       </Button>
-               </Col>
-               <Col className="text-center mb-3" sm={6} md={4}>
-                       <Button
-                               href="https://discord.gg/ApVyJnd"
-                               size="lg"
-                               target="_blank"
-                               variant="discord"
-                       >
-                               <Icon.DISCORD />
-                               {' '}
-                               {i18n.t('aos.tourneyDiscord')}
-                       </Button>
-               </Col>
-               <Col className="text-center mb-3" sm={6} md={4}>
-                       <Button
-                               href="https://discord.com/oauth2/authorize?client_id=951113702839549982&scope=bot%20applications.commands"
-                               size="lg"
-                               target="_blank"
-                               variant="discord"
-                       >
-                               <Icon.DISCORD />
-                               {' '}
-                               {i18n.t('aos.inviteBot')}
-                       </Button>
-               </Col>
-               <Col className="text-center mb-3" sm={6} md={4}>
-                       <Button
-                               href="https://discord.com/oauth2/authorize?client_id=951113702839549982&scope=applications.commands"
-                               size="lg"
-                               target="_blank"
-                               variant="discord"
-                       >
-                               <Icon.DISCORD />
-                               {' '}
-                               {i18n.t('aos.inviteCommand')}
-                       </Button>
-               </Col>
-       </Row>
-</Container>;
+const authEndpoint = 'https://discord.com/oauth2/authorize';
+const clientId = '951113702839549982';
+const botUrl = `${authEndpoint}?client_id=${clientId}&scope=bot%20applications.commands`;
+const commandUrl = `${authEndpoint}?client_id=${clientId}&scope=applications.commands`;
+
+const AosFront = () => {
+       React.useEffect(() => {
+               window.document.title = 'Aos';
+       }, []);
+       return <Container>
+               <div className="my-5 text-center">
+                       <h1>Castlevania: Aria of Sorrow</h1>
+               </div>
+               <Row>
+                       <Col className="text-center mb-3" sm={6} md={4}>
+                               <Button
+                                       href="https://discord.gg/VEtVYNr"
+                                       size="lg"
+                                       target="_blank"
+                                       variant="discord"
+                               >
+                                       <Icon.DISCORD />
+                                       {' '}
+                                       {i18n.t('aos.randoDiscord')}
+                               </Button>
+                       </Col>
+                       <Col className="text-center mb-3" sm={6} md={4}>
+                               <Button
+                                       href="https://aosrando.surge.sh/"
+                                       size="lg"
+                                       target="_blank"
+                                       variant="primary"
+                               >
+                                       {i18n.t('aos.randoWeb')}
+                               </Button>
+                       </Col>
+                       <Col className="text-center mb-3" sm={6} md={4}>
+                               <Button
+                                       href="https://discord.gg/ApVyJnd"
+                                       size="lg"
+                                       target="_blank"
+                                       variant="discord"
+                               >
+                                       <Icon.DISCORD />
+                                       {' '}
+                                       {i18n.t('aos.tourneyDiscord')}
+                               </Button>
+                       </Col>
+                       <Col className="text-center mb-3" sm={6} md={4}>
+                               <Button
+                                       href={botUrl}
+                                       size="lg"
+                                       target="_blank"
+                                       variant="discord"
+                               >
+                                       <Icon.DISCORD />
+                                       {' '}
+                                       {i18n.t('aos.inviteBot')}
+                               </Button>
+                       </Col>
+                       <Col className="text-center mb-3" sm={6} md={4}>
+                               <Button
+                                       href={commandUrl}
+                                       size="lg"
+                                       target="_blank"
+                                       variant="discord"
+                               >
+                                       <Icon.DISCORD />
+                                       {' '}
+                                       {i18n.t('aos.inviteCommand')}
+                               </Button>
+                       </Col>
+               </Row>
+       </Container>;
+};
 
 export default withTranslation()(AosFront);