+ >
+ );
+ }
+ }
+
+ return () => {
+ if (rootRef.current) {
+ rootRef.current.unmount();
+ containerRef.current?.remove();
+ rootRef.current = null;
+ containerRef.current = null;
+ }
+ };
+ }, [location.pathname]);
+
+ return null;
+}
\ No newline at end of file
diff --git a/src/theme/Footer/Rating/Rating.module.css b/src/theme/Footer/Rating/Rating.module.css
new file mode 100644
index 000000000000..97126eb58283
--- /dev/null
+++ b/src/theme/Footer/Rating/Rating.module.css
@@ -0,0 +1,79 @@
+/* /src/theme/Footer/Rating/Rating.module.css */
+.feedbackContainer {
+ width: 100%;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+}
+
+.feedbackDivider {
+ width: 100%;
+ border: 0;
+ height: 1px;
+ background-color: var(--ifm-color-emphasis-200);
+ margin: 1rem 0;
+}
+
+.feedbackContent {
+ display: flex;
+ align-items: center;
+ gap: 1rem;
+}
+
+.questionText {
+ color: var(--ifm-color-emphasis-700);
+}
+
+.feelbackButtonsCustom :global(.feelback-buttons) {
+ display: flex;
+ gap: 0.5rem;
+}
+
+.feelbackButtonsCustom :global(.feelback-btn) {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ padding: 0.5rem 1rem;
+ border: 1px solid var(--ifm-color-primary);
+ border-radius: 0.375rem;
+ background-color: transparent;
+ color: var(--ifm-color-primary);
+ cursor: pointer;
+ transition: all 0.2s ease;
+}
+
+.feelbackButtonsCustom :global(.feelback-btn:hover),
+.feelbackButtonsCustom :global(.feelback-btn.active) {
+ background-color: var(--ifm-color-primary);
+ color: white;
+}
+
+/* Updated SVG styling */
+.feelbackButtonsCustom :global(.feelback-btn) svg {
+ width: 1.25rem;
+ height: 1.25rem;
+ transition: transform 0.2s ease;
+}
+
+.feelbackButtonsCustom :global(.feelback-btn) svg path {
+ fill: none;
+ stroke: currentColor;
+ stroke-width: 1.5px;
+ transition: stroke-width 0.2s ease;
+}
+
+/* Modified hover selectors */
+.feelbackButtonsCustom :global(.feelback-btn:hover) svg {
+ transform: scale(1.1);
+}
+
+.feelbackButtonsCustom :global(.feelback-btn:hover) svg path {
+ stroke-width: 2px;
+}
+
+@media (max-width: 768px) {
+ .feedbackContent {
+ flex-direction: column;
+ text-align: center;
+ }
+}
\ No newline at end of file
diff --git a/src/theme/Footer/custom.feedback.css b/src/theme/Footer/custom.feedback.css
deleted file mode 100644
index 66a9725d4660..000000000000
--- a/src/theme/Footer/custom.feedback.css
+++ /dev/null
@@ -1,17 +0,0 @@
-:root {
- --feedback-primary-color: #789806;
- --feedback-button-dark-bg-color: var(--feedback-primary-color);
-}
-
-.feedback-wrapper {
- visibility: hidden;
-}
-
-.feedback-wrapper.loaded {
- visibility: visible;
-}
-
-/* Hide the feedback button initially */
-.feedback-wrapper:not(.loaded) pushfeedback-button {
- display: none;
-}
\ No newline at end of file
diff --git a/src/theme/Footer/index.js b/src/theme/Footer/index.js
index ad4bbb53c71b..3c5c6ba6ce09 100644
--- a/src/theme/Footer/index.js
+++ b/src/theme/Footer/index.js
@@ -1,143 +1,15 @@
-import React, { useEffect, useState } from 'react';
-import Footer from '@theme-original/Footer';
-import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
-
-import { FeedbackButton } from 'pushfeedback-react';
-import { defineCustomElements } from 'pushfeedback/loader';
-import 'pushfeedback/dist/pushfeedback/pushfeedback.css';
-import './custom.feedback.css';
+// /src/theme/Footer/index.js
+import React from 'react';
+import OriginalFooter from '@theme-original/Footer';
+import PushFeedback from './Feedback/Feedback';
+import FeelbackRating from './Rating/Rating';
export default function FooterWrapper(props) {
- const { i18n } = useDocusaurusContext();
- const language = i18n.currentLocale;
- const [isLoaded, setIsLoaded] = useState(false);
-
- const projectId = '8ou0itrmqd';
-
- const placeholders = {
- 'en': {
- feedbackButtonText: "Make this page better",
- modalTitle: "Your feedback makes a difference. Let us know how we can do better.",
- emailPlaceholder: "Enter your email",
- errorMessage: "Please try again later.",
- modalTitleError403: "The request URL does not match the one defined in PushFeedback for this project.",
- modalTitleError404: "We could not find the provided project id in PushFeedback.",
- messagePlaceholder: "Comments",
- modalTitleError: "Oops!",
- modalTitleSuccess: "Thanks for your feedback!",
- screenshotButtonText: "Add a Screenshot",
- screenshotTopbarText: "SELECT AN ELEMENT ON THE PAGE",
- sendButtonText: "Send",
- ratingPlaceholder: "Was this page helpful?",
- ratingStarsPlaceholder: "How would you rate this page"
- },
- 'ko': {
- feedbackButtonText: "페이지를 개선해 주세요",
- modalTitle: "여러분의 피드백은 소중합니다. 개선할 부분을 알려주세요.",
- emailPlaceholder: "이메일을 입력해 주세요",
- errorMessage: "나중에 다시 시도해주세요.",
- modalTitleError403: "요청 URL이 PushFeedback에서 정의된 URL과 일치하지 않습니다.",
- modalTitleError404: "PushFeedback에서 제공된 프로젝트 ID를 찾을 수 없습니다.",
- messagePlaceholder: "의견",
- modalTitleError: "이런!",
- modalTitleSuccess: "피드백을 보내주셔서 감사합니다!",
- screenshotButtonText: "스크린샷 찍기",
- screenshotTopbarText: "해당 위치를 선택하세요",
- sendButtonText: "보내기",
- ratingPlaceholder: "이 페이지가 도움이 되었나요?",
- ratingStarsPlaceholder: "이 페이지를 평가해 주세요"
- },
- 'zh-CN': {
- feedbackButtonText: "让这个页面变得更好",
- modalTitle: "您的反馈使我们与众不同。让我们知道如何做得更好",
- emailPlaceholder: "输入您的电子邮件",
- errorMessage: "请稍后再试",
- modalTitleError403: "请求的 URL 与 PushFeedback 中为该项目定义的 URL 不匹配",
- modalTitleError404: "我们无法在 PushFeedback 中找到所提供的项目 ID。",
- messagePlaceholder: "评论",
- modalTitleError: "哎呀!",
- modalTitleSuccess: "感谢您的反馈!",
- screenshotButtonText: "添加截图",
- screenshotTopbarText: "在页面上选择一个元素",
- sendButtonText: "发送",
- ratingPlaceholder: "本页对您有帮助吗?",
- ratingStarsPlaceholder: "您如何评价本页面?"
- },
- 'vi': {
- feedbackButtonText: "Cải thiện trang này",
- modalTitle: "Hãy cho chúng tôi biết cách chúng tôi có thể làm tốt hơn.",
- emailPlaceholder: "Nhập email của bạn",
- errorMessage: "Vui lòng thử lại sau.",
- modalTitleError403: "URL yêu cầu không khớp với URL được xác định trong PushFeedback cho dự án này.",
- modalTitleError404: "Chúng tôi không thể tìm thấy ID dự án được cung cấp trong PushFeedback.",
- messagePlaceholder: "Nhận xét",
- modalTitleError: "Ôi!",
- modalTitleSuccess: "Cảm ơn bạn đã phản hồi!",
- screenshotButtonText: "Chụp ảnh màn hình",
- screenshotTopbarText: "CHỌN MỘT YẾU TỐ TRÊN TRANG",
- sendButtonText: "Gửi",
- ratingPlaceholder: "Trang này có hữu ích không?",
- ratingStarsPlaceholder: "Bạn đánh giá trang này như thế nào"
- }
- };
-
- useEffect(() => {
- if (typeof window !== 'undefined') {
- defineCustomElements(window);
- }
-
- // Use the same timing as the main content load
- const timer = setTimeout(() => {
- setIsLoaded(true);
- }, 100);
-
- return () => clearTimeout(timer);
- }, []);
-
- const {
- feedbackButtonText,
- modalTitle,
- emailPlaceholder,
- errorMessage,
- modalTitleError403,
- modalTitleError404,
- messagePlaceholder,
- modalTitleError,
- modalTitleSuccess,
- screenshotButtonText,
- screenshotTopbarText,
- sendButtonText,
- ratingPlaceholder,
- ratingStarsPlaceholder
- } = placeholders[language] || placeholders.en;
-
return (
<>
-
-
- {feedbackButtonText}
-
-
-
+
+
+
>
);
}
\ No newline at end of file
diff --git a/static/img/misc/button-thumbs-down.svg b/static/img/misc/button-thumbs-down.svg
new file mode 100644
index 000000000000..72bf4521a64d
--- /dev/null
+++ b/static/img/misc/button-thumbs-down.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/static/img/misc/button-thumbs-up.svg b/static/img/misc/button-thumbs-up.svg
new file mode 100644
index 000000000000..6bea92a63a5d
--- /dev/null
+++ b/static/img/misc/button-thumbs-up.svg
@@ -0,0 +1,3 @@
+
\ No newline at end of file