Browse Source

ref(js): useTheme for projectsDashboard/Chart (#29190)

Evan Purkhiser 3 years ago
parent
commit
82b27e343c
1 changed files with 5 additions and 5 deletions
  1. 5 5
      static/app/views/projectsDashboard/chart.tsx

+ 5 - 5
static/app/views/projectsDashboard/chart.tsx

@@ -1,27 +1,27 @@
 import * as React from 'react';
-import {withTheme} from '@emotion/react';
+import {useTheme} from '@emotion/react';
 
 import BaseChart from 'app/components/charts/baseChart';
 import {t} from 'app/locale';
 import {Project} from 'app/types';
 import {axisLabelFormatter} from 'app/utils/discover/charts';
-import {Theme} from 'app/utils/theme';
 
 import NoEvents from './noEvents';
 
 type BaseChartProps = React.ComponentProps<typeof BaseChart>;
 
 type Props = {
-  theme: Theme;
   firstEvent: boolean;
   stats: Project['stats'];
   transactionStats?: Project['transactionStats'];
 };
 
-const Chart = ({theme, firstEvent, stats, transactionStats}: Props) => {
+const Chart = ({firstEvent, stats, transactionStats}: Props) => {
   const series: BaseChartProps['series'] = [];
   const hasTransactions = transactionStats !== undefined;
 
+  const theme = useTheme();
+
   if (transactionStats) {
     const transactionSeries = transactionStats.map(([timestamp, value]) => [
       timestamp * 1000,
@@ -164,4 +164,4 @@ const Chart = ({theme, firstEvent, stats, transactionStats}: Props) => {
   );
 };
 
-export default withTheme(Chart);
+export default Chart;