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 (#4738)
Browse files Browse the repository at this point in the history
  • Loading branch information
LFBarreto authored Feb 18, 2022
1 parent a493b81 commit 518dd06
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 518dd06

@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.206 s
Test results written to: report.json

Diff output ❌

    <strong>windows</strong>

    | Actual | Diff | Expected |
    |:------:|:----:|:--------:|
  
      | live-app-request-single-account-output-actual | live-app-request-single-account-output-diff | live-app-request-single-account-output-expected |
      | ![live-app-request-single-account-output-actual](https://i.imgur.com/1ZxknlC.png) | ![live-app-request-single-account-output-diff](https://i.imgur.com/3oQ7cOH.png) | ![live-app-request-single-account-output-expected](https://i.imgur.com/zLXTkjY.png) |
    
      | app-updater-idle-actual | app-updater-idle-diff | app-updater-idle-expected |
      | ![app-updater-idle-actual](https://i.imgur.com/mZgkb9f.png) | ![app-updater-idle-diff](https://i.imgur.com/LNcVbQD.png) | ![app-updater-idle-expected](https://i.imgur.com/ykB3Bbu.png) |

Please sign in to comment.