Skip to content

Commit

Permalink
style: WorkoutStat color option
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-29 committed Sep 16, 2023
1 parent f300caa commit c9c0388
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/components/WorkoutStat/index.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React from 'react';
import { intComma } from 'src/utils/utils';
import { MAIN_COLOR } from 'src/utils/const';


const WorkoutStat = ({ value, description, pace, className, distance, onClick }) => (
<div className={`${className} pb2 w-100`} onClick={onClick}>
const WorkoutStat = ({ value, description, pace, className, distance, onClick, color= MAIN_COLOR }) => (
<div className={`${className} pb2 w-100`} onClick={onClick} style={{'color': color}}>
<span className={`f1 fw9 i`}>{intComma(value)}</span>
<span className="f3 fw6 i">{description}</span>
{ pace && (<span className="f1 fw9 i">{ " " +pace}</span>)}
Expand Down
3 changes: 2 additions & 1 deletion src/components/YearStat/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Stat from 'src/components/Stat';
import WorkoutStat from 'src/components/WorkoutStat';
import useActivities from 'src/hooks/useActivities';
import useHover from 'src/hooks/useHover';
import { formatPace } from 'src/utils/utils';
import { formatPace, colorFromType } from 'src/utils/utils';
import styles from './style.module.scss';

const YearStat = ({ year, onClick }) => {
Expand Down Expand Up @@ -75,6 +75,7 @@ const YearStat = ({ year, onClick }) => {
description={` ${type}`+"s"}
// pace={formatPace(count[2] / count[1])}
distance={(count[2] / 1000.0).toFixed(0)}
// color={colorFromType(type)}
/>
))}
<Stat
Expand Down

0 comments on commit c9c0388

Please sign in to comment.