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

LIVE-886 (Market): add sparkline variation #4738

Merged
merged 1 commit into from
Feb 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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