Extract Bar component to separate file
This commit is contained in:
parent
4011026e52
commit
3c83f0a253
|
|
@ -0,0 +1,18 @@
|
|||
import styled from "styled-components";
|
||||
|
||||
export type BarProps = {
|
||||
width: string;
|
||||
height: string;
|
||||
background: string;
|
||||
};
|
||||
|
||||
export const Bar = styled.div<BarProps>`
|
||||
display: inline-block;
|
||||
border-radius: 10px;
|
||||
margin-right: 0.1%;
|
||||
vertical-align: bottom;
|
||||
height: ${(props) => props.height};
|
||||
background: ${(props) => props.background};
|
||||
width: ${(props) => props.width};
|
||||
transition: width 0.1s, height 0.1s, background-color 0.1s;
|
||||
`;
|
||||
|
|
@ -1,23 +1,7 @@
|
|||
import React from "react";
|
||||
import styled from "styled-components";
|
||||
import { Interval, Intensity, Duration, totalDuration, ZoneIndex, intensityToZoneIndex, maximumIntensity } from "make-workout";
|
||||
|
||||
type BarProps = {
|
||||
width: string;
|
||||
height: string;
|
||||
background: string;
|
||||
};
|
||||
|
||||
const Bar = styled.div<BarProps>`
|
||||
display: inline-block;
|
||||
border-radius: 10px;
|
||||
margin-right: 0.1%;
|
||||
vertical-align: bottom;
|
||||
height: ${(props) => props.height};
|
||||
background: ${(props) => props.background};
|
||||
width: ${(props) => props.width};
|
||||
transition: width 0.1s, height 0.1s, background-color 0.1s;
|
||||
`;
|
||||
import { BarProps, Bar } from "./Bar";
|
||||
|
||||
const zoneColorsMap: Record<ZoneIndex, string> = {
|
||||
0: "#7f7f7f",
|
||||
|
|
|
|||
Loading…
Reference in New Issue