Skip to content

Commit d83b0f8

Browse files
committed
feat: add feedback
1 parent ad8684a commit d83b0f8

File tree

4 files changed

+27
-1
lines changed

4 files changed

+27
-1
lines changed

src/i18n/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ i18n
1919
'home': 'Cryptography Learning Platform',
2020
'tutorial': 'Tutorial',
2121
'practice': 'Practice',
22-
'learning': 'Learning'
22+
'learning': 'Learning',
23+
'feedback': 'Feedback',
2324
},
2425
'homepage': {
2526
'intro': {
@@ -67,6 +68,7 @@ i18n
6768
'tutorial': '教程',
6869
'practice': '实践',
6970
'learning': '学习',
71+
'feedback': '反馈',
7072
},
7173
'homepage': {
7274
'intro': {

src/pages/feedback/index.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React from 'react'
2+
import styled from '@emotion/styled/macro'
3+
import { Div } from 'components/Div'
4+
import { navbarHeight } from 'components/common'
5+
import { WIP } from 'components/404'
6+
7+
const Wrapper = styled(Div)`
8+
min-height: calc(100vh - ${navbarHeight}px);
9+
text-align: center;
10+
display: flex;
11+
justify-content: center;
12+
align-items: center;
13+
`
14+
15+
export const Page: React.FC = () => {
16+
17+
return <Wrapper>
18+
<WIP />
19+
</Wrapper>
20+
}

src/pages/index/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ export const Page: React.FC = ({ children }) => {
6161
// const items = Object.keys(i18n.services.resourceStore.data)
6262
const [ dark, setDark ] = useState(false)
6363
const history = useHistory()
64+
const feedbackURL = process.env.REACT_APP_FEEDBACK_URL
65+
const handleOpenFeedback = feedbackURL ? () => window.open(feedbackURL) : () => history.push('/feedback')
6466

6567
return <Layout className={dark ? 'bp3-dark' : ''}>
6668
<Header>
@@ -74,6 +76,7 @@ export const Page: React.FC = ({ children }) => {
7476
{/* <Button minimal large icon={IconNames.HELP} text={t('nav.tutorial')} onClick={() => history.push('/tutorial')} /> */}
7577
{/* <Button minimal large icon={IconNames.SEARCH} text={t('nav.learning')} onClick={() => history.push('/learning')} /> */}
7678
<Button minimal large icon={IconNames.FLAG} text={t('nav.practice')} onClick={() => history.push('/practice')} />
79+
<Button minimal large icon={IconNames.ENVELOPE} text={t('nav.feedback')} onClick={handleOpenFeedback} />
7780
</Unselectable>
7881
</NavbarGroup>
7982
<NavbarGroup align={Alignment.RIGHT}>

src/route.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export const Routes: React.FC = () => {
3333
<RoutePage exact path={Pattern.Lab} page={import('pages/practice')} />
3434
<RoutePage path='/practice' page={import('pages/practice')} />
3535
<RoutePage path='/learning' page={import('pages/learning')} />
36+
<RoutePage path='/feedback' page={import('pages/feedback')} />
3637
<RoutePage exact path='/' page={import('pages/home')} />
3738
<Redirect to='/' />
3839
</Switch>

0 commit comments

Comments
 (0)