Baoyuantop commented on a change in pull request #430:
URL: https://github.com/apache/apisix-website/pull/430#discussion_r677914316



##########
File path: website/src/pages/index.js
##########
@@ -259,20 +259,23 @@ const NewsletterSection = () => {
 };
 
 const Contributor200Poster = () => {
-  const [display, setDisplay] = useState(true);
+  const [display, setDisplay] = useState(false);
   const [theme, setTheme] = useState('light');
 
   useEffect(() => {
     addEventListener('click', () => {
-      if (localStorage.getItem('theme') !== theme) {
-        setTheme(localStorage.getItem('theme'));
-      };
+      setTheme(localStorage.getItem('theme'));
     });
-  }, [theme]);
-
-  if (!display || (typeof window !== 'undefined' && 
localStorage.getItem('SHOW_200_CONTRIBUTOR_EVENT_ENTRY'))) {
-    return null;
-  }
+    if (localStorage.getItem("theme")) {
+      setTheme(localStorage.getItem('theme'));
+    };
+    if (window.matchMedia('(prefers-color-scheme: dark)').matches) {

Review comment:
       1. Switch the operating system to dark mode.
   2. open `apisix.apache.org`.
   3. website is in dark mode but this component is light.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to