Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Commit

Permalink
(Market): update sparkline color according to variation
Browse files Browse the repository at this point in the history
  • Loading branch information
LFBarreto committed Feb 14, 2022
1 parent 998926a commit 879c557
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/renderer/screens/market/MarketItemChart.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
import React, { memo } from "react";
import { useTheme } from "styled-components";
import { SparklineSvgData } from "@ledgerhq/live-common/lib/market/types";

type Props = {
sparklineIn7d: SparklineSvgData;
color?: string;
};

function SmallMarketItemChartComponent({ sparklineIn7d, color }: Props) {
const { path, viewBox } = sparklineIn7d;
function SmallMarketItemChartComponent({ sparklineIn7d }: Props) {
// @ts-expect-error to update with next live-common update
const { path, viewBox, isPositive } = sparklineIn7d;

const { colors } = useTheme();
const color =
isPositive !== undefined
? isPositive
? colors.success.c80
: colors.error.c80
: colors.neutral.c80;

return (
<svg
Expand Down

1 comment on commit 879c557

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint outputs ✅

Tests outputs ✅

PASS src/generate-cryptoassets-md.test.js

Test Suites: 1 skipped, 1 passed, 1 of 2 total
Tests: 5 skipped, 1 passed, 6 total
Snapshots: 0 total
Time: 2.445 s
Test results written to: report.json

Diff output ✅

Please sign in to comment.