File tree Expand file tree Collapse file tree 7 files changed +83
-18
lines changed
apps/frontend/src/routes/_auth/questionnaire Expand file tree Collapse file tree 7 files changed +83
-18
lines changed Original file line number Diff line number Diff line change 11import { Button , Group } from "@quassel/ui" ;
22import { createFileRoute , Link , useNavigate } from "@tanstack/react-router" ;
3+ import { i18n } from "../../../../stores/i18n" ;
4+ import { useStore } from "@nanostores/react" ;
5+
6+ export const messages = i18n ( "questionnaireEntries" , {
7+ formAction : "Continue" ,
8+ backAction : "Back" ,
9+ } ) ;
310
411function QuestionnaireEntries ( ) {
512 const n = useNavigate ( ) ;
613 const p = Route . useParams ( ) ;
714
15+ const t = useStore ( messages ) ;
16+
817 const handleSubmit = ( ) => {
918 n ( { to : "/questionnaire/$id/remarks" , params : p } ) ;
1019 } ;
@@ -13,9 +22,9 @@ function QuestionnaireEntries() {
1322 < form onSubmit = { handleSubmit } >
1423 < Group >
1524 < Link to = "/questionnaire/$id/period" params = { p } >
16- < Button variant = "light" > Back </ Button >
25+ < Button variant = "light" > { t . backAction } </ Button >
1726 </ Link >
18- < Button type = "submit" > Continue </ Button >
27+ < Button type = "submit" > { t . formAction } </ Button >
1928 </ Group >
2029 </ form >
2130 ) ;
Original file line number Diff line number Diff line change 11import { Button , Group } from "@quassel/ui" ;
22import { createFileRoute , Link , useNavigate } from "@tanstack/react-router" ;
3+ import { i18n } from "../../../../../stores/i18n" ;
4+ import { useStore } from "@nanostores/react" ;
5+
6+ export const messages = i18n ( "questionnaireOverview" , {
7+ title : "Thanks for submitting the questionnaire!" ,
8+ newPeriodAction : "Continue with new period" ,
9+ closeAction : "Close" ,
10+ } ) ;
311
412function QuestionnaireOverview ( ) {
513 const n = useNavigate ( ) ;
14+ const t = useStore ( messages ) ;
615
716 const handleClose = ( ) => {
817 // TODO handle closing quesitonnaire ("logout")
@@ -12,12 +21,12 @@ function QuestionnaireOverview() {
1221
1322 return (
1423 < >
15- < h3 > Thanks for submitting the questionnaire! </ h3 >
24+ < h3 > { t . title } </ h3 >
1625 < Group >
1726 < Link to = "/questionnaire/new" >
18- < Button variant = "outline" > Continue with new period </ Button >
27+ < Button variant = "outline" > { t . newPeriodAction } </ Button >
1928 </ Link >
20- < Button onClick = { handleClose } > Close </ Button >
29+ < Button onClick = { handleClose } > { t . closeAction } </ Button >
2130 </ Group >
2231 </ >
2332 ) ;
Original file line number Diff line number Diff line change 11import { Button } from "@quassel/ui" ;
22import { createFileRoute , useNavigate } from "@tanstack/react-router" ;
3+ import { i18n } from "../../../../../stores/i18n" ;
4+ import { useStore } from "@nanostores/react" ;
5+
6+ export const messages = i18n ( "questionnairePeriod" , {
7+ title : "Period" ,
8+ formAction : "Continue" ,
9+ } ) ;
310
411function QuestionnairePeriod ( ) {
512 const n = useNavigate ( ) ;
613 const p = Route . useParams ( ) ;
714
15+ const t = useStore ( messages ) ;
16+
817 const handleSubmit = ( ) => {
918 n ( { to : "/questionnaire/$id/entries" , params : p } ) ;
1019 } ;
1120
1221 return (
1322 < >
14- < h3 > Period </ h3 >
23+ < h3 > { t . title } </ h3 >
1524 < form onSubmit = { handleSubmit } >
16- < Button type = "submit" > Continue </ Button >
25+ < Button type = "submit" > { t . formAction } </ Button >
1726 </ form >
1827 </ >
1928 ) ;
Original file line number Diff line number Diff line change 11import { Button , Group } from "@quassel/ui" ;
22import { createFileRoute , Link , useNavigate } from "@tanstack/react-router" ;
3+ import { i18n } from "../../../../../stores/i18n" ;
4+ import { useStore } from "@nanostores/react" ;
5+
6+ export const messages = i18n ( "questionnaireRemarks" , {
7+ title : "Add remarks" ,
8+ backAction : "Back" ,
9+ saveAction : "Save" ,
10+ formAction : "Save and complete" ,
11+ } ) ;
312
413function QuestionnaireRemarks ( ) {
514 const n = useNavigate ( ) ;
615 const p = Route . useParams ( ) ;
716
17+ const t = useStore ( messages ) ;
18+
819 const handleSubmit = ( ) => {
920 n ( { to : "/questionnaire/$id/overview" , params : p } ) ;
1021 } ;
1122
1223 return (
1324 < form onSubmit = { handleSubmit } >
14- < h3 > Add remarks </ h3 >
25+ < h3 > { t . title } </ h3 >
1526 < Group >
1627 < Link to = "/questionnaire/$id/entries" params = { p } >
17- < Button variant = "light" > Back </ Button >
28+ < Button variant = "light" > { t . backAction } </ Button >
1829 </ Link >
19- < Button variant = "outline" > Save </ Button >
20- < Button type = "submit" > Save and Complete </ Button >
30+ < Button variant = "outline" > { t . saveAction } </ Button >
31+ < Button type = "submit" > { t . formAction } </ Button >
2132 </ Group >
2233 </ form >
2334 ) ;
Original file line number Diff line number Diff line change 11import { Button , Stack , TextInput } from "@quassel/ui" ;
22import { createFileRoute , useNavigate } from "@tanstack/react-router" ;
3+ import { i18n } from "../../../../stores/i18n" ;
4+ import { useStore } from "@nanostores/react" ;
5+
6+ export const messages = i18n ( "questionnaire" , {
7+ title : "Start new questionnaire" ,
8+ formAction : "Continue" ,
9+ } ) ;
310
411function Questionnaire ( ) {
512 const n = useNavigate ( ) ;
13+ const t = useStore ( messages ) ;
614
715 const handleSubmit = ( ) => {
816 n ( { to : "/questionnaire/participant" } ) ;
917 } ;
1018
1119 return (
1220 < >
13- < h3 > Questionnaire </ h3 >
21+ < h3 > { t . title } </ h3 >
1422 < form onSubmit = { handleSubmit } >
1523 < Stack >
1624 < TextInput />
1725 < TextInput />
18- < Button type = "submit" > Start questionnaire </ Button >
26+ < Button type = "submit" > { t . formAction } </ Button >
1927 </ Stack >
2028 </ form >
2129 </ >
Original file line number Diff line number Diff line change 11import { Button } from "@quassel/ui" ;
22import { createFileRoute , useNavigate } from "@tanstack/react-router" ;
3+ import { i18n } from "../../../../stores/i18n" ;
4+ import { useStore } from "@nanostores/react" ;
5+
6+ export const messages = i18n ( "questionnaireNew" , {
7+ title : "Create new period of life" ,
8+ formAction : "Create" ,
9+ } ) ;
310
411function QuestionnaireNew ( ) {
512 const n = useNavigate ( ) ;
13+ const t = useStore ( messages ) ;
614
715 const handleSubmit = ( ) => {
816 // TODO create new questionnaire and receive ID
@@ -12,10 +20,10 @@ function QuestionnaireNew() {
1220
1321 return (
1422 < >
15- < h3 > Period </ h3 >
23+ < h3 > { t . title } </ h3 >
1624 < form onSubmit = { handleSubmit } >
1725 { /* TODO period form */ }
18- < Button type = "submit" > Create </ Button >
26+ < Button type = "submit" > { t . formAction } </ Button >
1927 </ form >
2028 </ >
2129 ) ;
Original file line number Diff line number Diff line change 11import { Button } from "@quassel/ui" ;
22import { createFileRoute , useNavigate } from "@tanstack/react-router" ;
3+ import { i18n } from "../../../../stores/i18n" ;
4+ import { useStore } from "@nanostores/react" ;
5+
6+ export const messages = i18n ( "questionnaireParticipant" , {
7+ title : "Participant" ,
8+ formAction : "Continue" ,
9+ } ) ;
310
411function QuestionnaireParticipant ( ) {
512 const n = useNavigate ( ) ;
13+ const t = useStore ( messages ) ;
614
715 const handleSubmit = ( ) => {
816 n ( { to : "/questionnaire/new" } ) ;
917 } ;
1018
1119 return (
12- < form onSubmit = { handleSubmit } >
13- < Button type = "submit" > New questionnaire</ Button >
14- </ form >
20+ < >
21+ < h3 > { t . title } </ h3 >
22+ < form onSubmit = { handleSubmit } >
23+ < Button type = "submit" > { t . formAction } </ Button >
24+ </ form >
25+ </ >
1526 ) ;
1627}
1728
You can’t perform that action at this time.
0 commit comments