You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/07/28 01:49:12 UTC

[GitHub] [apisix-website] Baoyuantop commented on a change in pull request #430: fix: contributor card state

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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org