فهرست منبع

Removed animations

Fela Maslen 5 سال پیش
والد
کامیت
5696db17e6
1فایلهای تغییر یافته به همراه6 افزوده شده و 1 حذف شده
  1. 6 1
      src/components/graph-cases.tsx

+ 6 - 1
src/components/graph-cases.tsx

@@ -129,6 +129,7 @@ const GraphCases: React.FC<Props> = ({ countries }) => {
             yAxisId="left"
             dot={false}
             strokeWidth={2}
+            isAnimationActive={false}
           />
         ))}
         {enabledCountries.map(({ country, color }) => (
@@ -139,6 +140,7 @@ const GraphCases: React.FC<Props> = ({ countries }) => {
             stroke={lighten(0.1)(color)}
             yAxisId="left"
             dot={false}
+            isAnimationActive={false}
           />
         ))}
       </LineChart>
@@ -150,7 +152,10 @@ const GraphCases: React.FC<Props> = ({ countries }) => {
                 type="checkbox"
                 checked={enabledList[country] !== false}
                 onChange={(): void =>
-                  setEnabledList((last: EnabledList) => ({ ...last, [country]: !last[country] }))
+                  setEnabledList((last: EnabledList) => ({
+                    ...last,
+                    [country]: last[country] === false,
+                  }))
                 }
               />
               {country}{' '}