Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit f254167

Browse files
committedMar 3, 2020
add improve page button
1 parent 853603d commit f254167

File tree

5 files changed

+20
-11
lines changed

5 files changed

+20
-11
lines changed
 

‎src/components/ItemActionsMenu.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const ItemActionsMenu = ({
5454
>
5555
{(isAuthor || !hideEdits) && (
5656
<MenuItem button onClick={() => handleClick('edit')}>
57-
{translate('edit_page')}
57+
{translate('improve_page')}
5858
</MenuItem>
5959
)}
6060

‎src/components/PostView.tsx

+16-10
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,20 @@ const PostView = ({ chapterId, item, preview, topicId }: PostViewProps) => {
8484

8585
{links && youtube && <YoutubePlayer id={youtube} />}
8686

87-
{next && (
88-
<div
89-
style={{
90-
display: 'flex',
91-
justifyContent: 'flex-end',
92-
margin: theme.spacing(2),
93-
}}
94-
>
87+
<div
88+
style={{
89+
display: 'flex',
90+
justifyContent: 'space-between',
91+
margin: theme.spacing(2),
92+
}}
93+
>
94+
<NextLink href="/posts/[id]/edit" as={`/posts/${id}/edit`} passHref>
95+
<Button component="a" color="primary">
96+
{translate('improve_page')}
97+
</Button>
98+
</NextLink>
99+
100+
{next && (
95101
<NextLink
96102
href="/topics/[id]/chapters/[chapterId]/[lessonId]"
97103
as={`/topics/${topicId}/chapters/${next.chapterId}/${next.lessonId}`}
@@ -101,8 +107,8 @@ const PostView = ({ chapterId, item, preview, topicId }: PostViewProps) => {
101107
{translate('next_lesson')}
102108
</Button>
103109
</NextLink>
104-
</div>
105-
)}
110+
)}
111+
</div>
106112
</Card>
107113
);
108114
};

‎src/locale/en.ts

+1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ const translate: TranslationFn = (key, args) => {
9696
having_issues:
9797
'Are you finding this confusing or are you having any issues?',
9898
home: 'Home',
99+
improve_page: 'Improve this page',
99100
items_empty: 'No items found.',
100101
leaderboard: 'Leaderboard',
101102
learn_about: `Learn about ${args?.title}`,

‎src/locale/pt.ts

+1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ const translate: TranslationFn = (key, args) => {
9797
go_home: 'Ir para a página inicial.',
9898
having_issues: 'Está achando complicado ou encontrando alguma dificuldade?',
9999
home: 'Início',
100+
improve_page: 'Melhore esta página',
100101
items_empty: 'Nenhum item encontrado.',
101102
leaderboard: 'Ranking',
102103
learn_about: `Aprenda sobre ${args?.title}`,

‎src/models/i18n.ts

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ export type TranslationKeys =
9292
| 'go_home'
9393
| 'having_issues'
9494
| 'home'
95+
| 'improve_page'
9596
| 'items_empty'
9697
| 'leaderboard'
9798
| 'learn_about'

0 commit comments

Comments
 (0)
This repository has been archived.