Skip to content

Commit 9f8750a

Browse files
committed
[RZB-2500048]: fixed survey form typing error
1 parent 8a87d06 commit 9f8750a

File tree

6 files changed

+53
-18
lines changed

6 files changed

+53
-18
lines changed

abcd.code-workspace

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@
153153
"titleBar.activeBackground": "#abcd00",
154154
"titleBar.activeForeground": "#15202b",
155155
"titleBar.inactiveBackground": "#abcd0099",
156-
"titleBar.inactiveForeground": "#15202b99"
156+
"titleBar.inactiveForeground": "#15202b99",
157+
"tab.activeBorder": "#d5ff01"
157158
},
158159
"files.exclude": {
159160
"**/.git": false,

src/components/surveyForm.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
2-
import type { SurveyData } from "../types/survey";
2+
import type { SurveyData } from "@/types";
33
import "@/assets/styles/survey.css";
4+
45
interface Props {
56
data: SurveyData;
67
}

src/data/survey.json

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,62 @@
66
"id": 1,
77
"questionText": "Do you have a handwritten sample of your child's first letters (A, B, C, etc.)?",
88
"type": "singleChoice",
9-
"options": ["Yes", "No", "Not yet, but I plan to"]
9+
"options": [
10+
"Yes",
11+
"No",
12+
"Not yet, but I plan to"
13+
]
1014
},
1115
{
1216
"id": 2,
1317
"questionText": "Have you captured your child’s first attempts at saying letters (A, B, C, etc.)?",
1418
"type": "singleChoice",
15-
"options": ["Yes", "No", "Not yet, but I plan to"]
19+
"options": [
20+
"Yes",
21+
"No",
22+
"Not yet, but I plan to"
23+
]
1624
},
1725
{
1826
"id": 3,
1927
"questionText": "When did your child start writing or speaking their first letters?",
2028
"type": "singleChoice",
21-
"options": ["Less than a month ago", "1-3 months ago", "More than 3 months ago"]
29+
"options": [
30+
"Less than a month ago",
31+
"1-3 months ago",
32+
"More than 3 months ago"
33+
]
2234
},
2335
{
2436
"id": 4,
2537
"questionText": "How long does your child spend practicing writing letters each day?",
2638
"type": "singleChoice",
27-
"options": ["Less than 15 minutes", "15-30 minutes", "30-60 minutes", "More than 60 minutes"]
39+
"options": [
40+
"Less than 15 minutes",
41+
"15-30 minutes",
42+
"30-60 minutes",
43+
"More than 60 minutes"
44+
]
2845
},
2946
{
3047
"id": 5,
3148
"questionText": "Would you be interested in setting your child’s handwriting as a personalized font for educational materials or keepsakes?",
3249
"type": "singleChoice",
33-
"options": ["Yes", "No", "Not sure"]
50+
"options": [
51+
"Yes",
52+
"No",
53+
"Not sure"
54+
]
3455
},
3556
{
3657
"id": 6,
3758
"questionText": "Do you think that learning methods affect handwriting quality? For instance, if a child practices incorrectly, can it impact their writing?",
3859
"type": "singleChoice",
39-
"options": ["Yes, it can affect handwriting quality.", "No, I don’t think it has a big impact.", "Not sure"]
60+
"options": [
61+
"Yes, it can affect handwriting quality.",
62+
"No, I don’t think it has a big impact.",
63+
"Not sure"
64+
]
4065
},
4166
{
4267
"id": 7,
@@ -53,13 +78,18 @@
5378
"id": 8,
5479
"questionText": "How often does your child practice writing or speaking letters?",
5580
"type": "singleChoice",
56-
"options": ["Daily", "Several times a week", "Weekly", "Occasionally"]
81+
"options": [
82+
"Daily",
83+
"Several times a week",
84+
"Weekly",
85+
"Occasionally"
86+
]
5787
},
5888
{
5989
"id": 9,
60-
"questionText": "Is there something specific you’d like to see in tools or resources for young children learning to write or speak?",
90+
"questionText": "Is there something specific you would like to see in tools or resources for young children learning to write or speak?",
6191
"type": "openEnded",
62-
"options": null
92+
"options": []
6393
}
6494
]
65-
}
95+
}

src/pages/survey.astro

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
---
22
import SurveyForm from "@/components/surveyForm.astro";
3-
import surveyData from "../data/survey.json";
43
import BaseLayout from "@/layouts/Base";
4+
import type { SurveyData } from "@/types";
5+
import { Debug } from "astro:components";
6+
import surveyData from "../data/survey.json";
57
---
68

7-
<BaseLayout meta={{ title: "Survey-Form" }}>
8-
<SurveyForm data={surveyData} />
9+
<Debug data={surveyData} />
10+
<BaseLayout meta={{ title: "Survey Form" }}>
11+
<SurveyForm data={surveyData as SurveyData} />
912
</BaseLayout>

src/types/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export type { LinkProps } from "./link";
21
export type { LetterEntity } from "./alphabet";
3-
42
export type { BlogCardProps, BlogMeta, BlogPost } from "./blog";
3+
export type { LinkProps } from "./link";
4+
export type { Question, SurveyData } from "./survey";

src/types/survey.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export type Question = {
33
id: number;
44
questionText: string;
55
type: "singleChoice" | "multiChoice" | "openEnded";
6-
options: string[] | null;
6+
options: string[];
77
};
88

99
export type SurveyData = {

0 commit comments

Comments
 (0)