fix 2 form

This commit is contained in:
2026-05-13 19:00:35 +07:00
parent 9cafa23721
commit 946b9b12a4
4 changed files with 22 additions and 41 deletions
+4 -8
View File
@@ -9,7 +9,6 @@ type Question = {
id: string; id: string;
type: "rating" | "dropdown" | "scale" | "rating_labeled" | "checkbox_group" | "long_text"; type: "rating" | "dropdown" | "scale" | "rating_labeled" | "checkbox_group" | "long_text";
label: string; label: string;
labelVi: string;
min?: number; min?: number;
max?: number; max?: number;
placeholder?: string; placeholder?: string;
@@ -127,7 +126,6 @@ export default function FeedbackForm({ data }: { data: FeedbackJson }) {
<div key={q.id} className="space-y-4"> <div key={q.id} className="space-y-4">
<div className="space-y-1"> <div className="space-y-1">
<label className="block text-lg font-semibold text-on-surface">{q.label}</label> <label className="block text-lg font-semibold text-on-surface">{q.label}</label>
<p className="text-on-surface-variant/70 italic text-sm">{q.labelVi}</p>
</div> </div>
{q.type === "rating" && ( {q.type === "rating" && (
@@ -239,7 +237,7 @@ export default function FeedbackForm({ data }: { data: FeedbackJson }) {
{q.type === "long_text" && ( {q.type === "long_text" && (
<textarea <textarea
className="w-full bg-surface-container-low border border-white/10 rounded-xl px-5 py-4 text-on-surface focus:outline-none focus:border-primary/50 transition-colors min-h-[120px] resize-none" className="w-full bg-surface-container-low border border-white/10 rounded-xl px-5 py-4 text-on-surface focus:outline-none focus:border-primary/50 transition-colors min-h-[120px] resize-none"
placeholder="Your message / Ý kiến của bạn..." placeholder="Your message / suggestions..."
rows={4} rows={4}
value={form[q.id] || ""} value={form[q.id] || ""}
onChange={(e) => updateField(q.id, e.target.value)} onChange={(e) => updateField(q.id, e.target.value)}
@@ -262,17 +260,15 @@ export default function FeedbackForm({ data }: { data: FeedbackJson }) {
<SubmitToast <SubmitToast
state={submitState} state={submitState}
successTitle="Feedback submitted" successTitle="Feedback Submitted"
successMessage="Thank you for your valuable feedback! It has been successfully recorded." successMessage={data.submit.disclaimer}
onDismiss={() => { onDismiss={() => {
setSubmitState("idle"); setSubmitState("idle");
setForm({}); setForm({});
}} }}
/> />
<p className="text-on-surface-variant font-medium text-sm text-center max-w-xl leading-relaxed opacity-80 uppercase tracking-wide">
{data.submit.disclaimer}
</p>
</div> </div>
</form> </form>
); );
+2 -2
View File
@@ -171,9 +171,9 @@ export default function RegistrationForm({
</div> </div>
</div> </div>
<div className="pt-[16px]"> <div className="pt-10 border-t border-white/5 flex flex-col items-center gap-6">
<button <button
className="w-full gold-gradient-bg py-5 rounded-lg text-on-primary font-[var(--font-display-lg)] text-[18px] font-bold shadow-[0_10px_30px_rgba(197,160,89,0.15)] hover:shadow-[0_15px_40px_rgba(197,160,89,0.25)] hover:-translate-y-0.5 active:translate-y-0 active:scale-[0.98] transition-all disabled:opacity-60 disabled:pointer-events-none" className="gold-gradient-bg text-on-primary w-full md:w-auto px-16 py-5 rounded-xl font-[var(--font-display-lg)] text-xl uppercase tracking-wider hover:shadow-[0_0_30px_rgba(197,160,89,0.4)] transition-all duration-300 active:scale-[0.98] disabled:opacity-60 disabled:pointer-events-none"
type="submit" type="submit"
disabled={submitState === "sending"} disabled={submitState === "sending"}
> >
+14 -29
View File
@@ -5,13 +5,12 @@
{ {
"id": "overall", "id": "overall",
"title": "1. OVERALL EVENT EXPERIENCE", "title": "1. OVERALL EVENT EXPERIENCE",
"subtitle": "Tổng Quan Trải Nghiệm Sự Kiện", "subtitle": "Overview of your summit experience",
"questions": [ "questions": [
{ {
"id": "overallExperience", "id": "overallExperience",
"type": "rating", "type": "rating",
"label": "How would you rate your overall experience at IPv6 Summit 2026?", "label": "How would you rate your overall experience at IPv6 Summit 2026?",
"labelVi": "Đánh giá tổng thể của bạn về IPv6 Summit 2026?",
"min": 1, "min": 1,
"max": 5 "max": 5
}, },
@@ -19,7 +18,6 @@
"id": "venueFacilities", "id": "venueFacilities",
"type": "rating", "type": "rating",
"label": "How satisfied were you with the venue, facilities, and catering services?", "label": "How satisfied were you with the venue, facilities, and catering services?",
"labelVi": "Mức độ hài lòng của bạn về địa điểm, cơ sở vật chất và dịch vụ tiệc?",
"min": 1, "min": 1,
"max": 5 "max": 5
}, },
@@ -27,7 +25,6 @@
"id": "organisationProcess", "id": "organisationProcess",
"type": "rating", "type": "rating",
"label": "How would you rate the event organisation and registration process?", "label": "How would you rate the event organisation and registration process?",
"labelVi": "Đánh giá của bạn về công tác tổ chức và quy trình đăng ký?",
"min": 1, "min": 1,
"max": 5 "max": 5
} }
@@ -36,27 +33,25 @@
{ {
"id": "content", "id": "content",
"title": "2. CONTENT & PROGRAMME EVALUATION", "title": "2. CONTENT & PROGRAMME EVALUATION",
"subtitle": "Đánh Giá Nội Dung & Chương Trình", "subtitle": "Evaluation of program content and sessions",
"questions": [ "questions": [
{ {
"id": "mostValuableSession", "id": "mostValuableSession",
"type": "dropdown", "type": "dropdown",
"label": "Which session did you find most valuable?", "label": "Which session did you find most valuable?",
"labelVi": "Phiên thảo luận nào mang lại giá trị nhất cho bạn?", "placeholder": "Select a session",
"placeholder": "Select a session / Danh sách lựa chọn",
"options": [ "options": [
{ "value": "opening", "label": "Opening Session / Phiên Khai mạc" }, { "value": "opening", "label": "Opening Session" },
{ "value": "keynote1", "label": "Keynote 1 / Diễn văn chính 1" }, { "value": "keynote1", "label": "Keynote 1" },
{ "value": "panel1", "label": "Panel Discussion 1 / Tọa đàm 1" }, { "value": "panel1", "label": "Panel Discussion 1" },
{ "value": "technical", "label": "Technical Track / Phiên Kỹ thuật" }, { "value": "technical", "label": "Technical Track" },
{ "value": "policy", "label": "Policy Track / Phiên Chính sách" } { "value": "policy", "label": "Policy Track" }
] ]
}, },
{ {
"id": "relevance", "id": "relevance",
"type": "scale", "type": "scale",
"label": "How relevant was the conference content to your professional interests?", "label": "How relevant was the conference content to your professional interests?",
"labelVi": "Nội dung hội thảo có phù hợp với lĩnh vực/chuyên môn của bạn không?",
"options": [ "options": [
{ "value": "1", "label": "Not Relevant" }, { "value": "1", "label": "Not Relevant" },
{ "value": "2", "label": "Slightly Relevant" }, { "value": "2", "label": "Slightly Relevant" },
@@ -69,7 +64,6 @@
"id": "speakerRating", "id": "speakerRating",
"type": "rating_labeled", "type": "rating_labeled",
"label": "How would you rate the keynote speakers and panel discussions?", "label": "How would you rate the keynote speakers and panel discussions?",
"labelVi": "Đánh giá của bạn về diễn giả chính và các phiên tọa đàm?",
"options": [ "options": [
{ "value": "1", "label": "1 Needs Improvement" }, { "value": "1", "label": "1 Needs Improvement" },
{ "value": "2", "label": "2 Fair" }, { "value": "2", "label": "2 Fair" },
@@ -82,7 +76,6 @@
"id": "networkingUtility", "id": "networkingUtility",
"type": "scale", "type": "scale",
"label": "How useful were the networking opportunities provided during the Summit?", "label": "How useful were the networking opportunities provided during the Summit?",
"labelVi": "Các cơ hội networking tại sự kiện có hữu ích không?",
"options": [ "options": [
{ "value": "1", "label": "Not Useful" }, { "value": "1", "label": "Not Useful" },
{ "value": "2", "label": "Slightly Useful" }, { "value": "2", "label": "Slightly Useful" },
@@ -95,7 +88,6 @@
"id": "futureTopics", "id": "futureTopics",
"type": "checkbox_group", "type": "checkbox_group",
"label": "Which topics would you like to see more of in future editions?", "label": "Which topics would you like to see more of in future editions?",
"labelVi": "Bạn muốn thấy thêm chủ đề nào trong các kỳ Summit tiếp theo?",
"hasOther": true, "hasOther": true,
"options": [ "options": [
{ "value": "deployment", "label": "IPv6 Deployment Strategies" }, { "value": "deployment", "label": "IPv6 Deployment Strategies" },
@@ -112,13 +104,12 @@
{ {
"id": "future", "id": "future",
"title": "4. FUTURE PARTICIPATION", "title": "4. FUTURE PARTICIPATION",
"subtitle": "Khả Năng Tham Dự Trong Tương Lai", "subtitle": "Your likelihood of attending future events",
"questions": [ "questions": [
{ {
"id": "attendAgain", "id": "attendAgain",
"type": "scale", "type": "scale",
"label": "Would you attend IPv6 Summit again in 2027?", "label": "Would you attend IPv6 Summit again in 2027?",
"labelVi": "Bạn có mong muốn tham dự IPv6 Summit 2027 không?",
"options": [ "options": [
{ "value": "definitely-yes", "label": "Definitely Yes" }, { "value": "definitely-yes", "label": "Definitely Yes" },
{ "value": "probably-yes", "label": "Probably Yes" }, { "value": "probably-yes", "label": "Probably Yes" },
@@ -131,7 +122,6 @@
"id": "recommend", "id": "recommend",
"type": "scale", "type": "scale",
"label": "Would you recommend IPv6 Summit to colleagues or partners?", "label": "Would you recommend IPv6 Summit to colleagues or partners?",
"labelVi": "Bạn có sẵn sàng giới thiệu IPv6 Summit cho đồng nghiệp hoặc đối tác không?",
"options": [ "options": [
{ "value": "yes", "label": "Yes" }, { "value": "yes", "label": "Yes" },
{ "value": "maybe", "label": "Maybe" }, { "value": "maybe", "label": "Maybe" },
@@ -143,38 +133,34 @@
{ {
"id": "qualitative", "id": "qualitative",
"title": "5. QUALITATIVE FEEDBACK", "title": "5. QUALITATIVE FEEDBACK",
"subtitle": "Ý Kiến & Đề Xuất", "subtitle": "General opinions and suggestions",
"questions": [ "questions": [
{ {
"id": "enjoyedMost", "id": "enjoyedMost",
"type": "long_text", "type": "long_text",
"label": "What did you enjoy most about the Summit?", "label": "What did you enjoy most about the Summit?"
"labelVi": "Điều bạn thích nhất tại IPv6 Summit là gì?"
}, },
{ {
"id": "improvementAreas", "id": "improvementAreas",
"type": "long_text", "type": "long_text",
"label": "What areas should we improve for future events?", "label": "What areas should we improve for future events?"
"labelVi": "Bạn đề xuất cải thiện điều gì cho các sự kiện tiếp theo?"
}, },
{ {
"id": "additionalComments", "id": "additionalComments",
"type": "long_text", "type": "long_text",
"label": "Any additional comments, suggestions, or partnership interests?", "label": "Any additional comments, suggestions, or partnership interests?"
"labelVi": "Các góp ý hoặc đề xuất hợp tác khác?"
} }
] ]
}, },
{ {
"id": "profile", "id": "profile",
"title": "ATTENDEE PROFILE (OPTIONAL)", "title": "ATTENDEE PROFILE (OPTIONAL)",
"subtitle": "Thông Tin Người Tham Dự (Không bắt buộc)", "subtitle": "Information about your professional background",
"questions": [ "questions": [
{ {
"id": "industry", "id": "industry",
"type": "checkbox_group", "type": "checkbox_group",
"label": "Industry / Sector", "label": "Industry / Sector",
"labelVi": "Lĩnh vực hoạt động",
"hasOther": true, "hasOther": true,
"options": [ "options": [
{ "value": "government", "label": "Government" }, { "value": "government", "label": "Government" },
@@ -189,7 +175,6 @@
"id": "role", "id": "role",
"type": "checkbox_group", "type": "checkbox_group",
"label": "Your role", "label": "Your role",
"labelVi": "Vai trò của bạn",
"hasOther": true, "hasOther": true,
"options": [ "options": [
{ "value": "executive", "label": "Executive / Leadership" }, { "value": "executive", "label": "Executive / Leadership" },
+2 -2
View File
@@ -1,8 +1,8 @@
export const imageUrl = (path?: string) => { export const imageUrl = (path?: string) => {
// Không có ảnh → ảnh mặc định // No image → default image
if (!path) return "/_images/default.jpg"; if (!path) return "/_images/default.jpg";
// Đã là full URL // Already a full URL
if (path.startsWith("http")) return path; if (path.startsWith("http")) return path;
const base = ( const base = (