Skip to content

Commit 0d69c1f

Browse files
committed
add missing icon and update classes in css modules
Signed-off-by: Leonardo Rossi <[email protected]>
1 parent 58f2846 commit 0d69c1f

File tree

8 files changed

+96
-6
lines changed

8 files changed

+96
-6
lines changed

src/components/ArcMetric.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ export function SemiCircleProgress ({
112112
/>
113113
</svg>
114114
{showPercentValue && (
115-
<div className='flex items-center justify-center gap-2 absolute bottom-0 left-0 right-0 text-white text-[2.3rem] font-bold'>
115+
<div className={styles.percentContainer}>
116116
<span>{value}</span>
117-
<span className='text-white/70 text-[1.2rem] font-normal'>{unit}</span>
117+
<span className={styles.percentUnit}>{unit}</span>
118118
</div>
119119

120120
)}

src/components/ArcMetric.module.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,12 @@
2828
font-weight: 400;
2929
min-width: 120px;
3030
text-align: left;
31-
}
31+
}
32+
33+
.percentContainer {
34+
@apply flex items-center justify-center gap-2 absolute bottom-0 left-0 right-0 text-white text-[2.3rem] font-bold;
35+
}
36+
37+
.percentUnit {
38+
@apply text-white/70 text-[1.2rem] font-normal;
39+
}

src/components/TrendLine.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { useRef, useEffect, useState } from 'react'
22
import * as d3 from 'd3'
3+
import styles from './TrendLine.module.css'
34

45
/**
56
* TrendLine component
@@ -132,7 +133,7 @@ function TrendLine ({ yValues }) {
132133
}, [yValues, dimensions])
133134

134135
return (
135-
<div className='w-full h-full' ref={typedContainerRef} style={{ position: 'relative' }}>
136+
<div className={styles.line} ref={typedContainerRef} style={{ position: 'relative' }}>
136137
<svg
137138
ref={ref}
138139
width='100%'
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.line {
2+
@apply w-full h-full;
3+
}

src/components/TrendMetric.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
}
1919

2020
.contentGraph {
21-
@apply w-[210px] h-[60px];
21+
@apply w-[210px] h-[25px];
2222
}
2323
.container {
2424
@apply flex items-center justify-center gap-4;
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import * as React from 'react'
2+
import styles from './Icons.module.css'
3+
import { SMALL, MEDIUM, LARGE, MAIN_DARK_BLUE } from '../constants'
4+
5+
const PodSignalsIcon = ({
6+
color = MAIN_DARK_BLUE,
7+
size = MEDIUM,
8+
disabled = false,
9+
inactive = false
10+
}) => {
11+
let className = `${styles.svgClassName} ` + styles[`${color}`]
12+
if (disabled) {
13+
className += ` ${styles.iconDisabled}`
14+
}
15+
if (inactive) {
16+
className += ` ${styles.iconInactive}`
17+
}
18+
let icon = <></>
19+
20+
switch (size) {
21+
case SMALL:
22+
icon = (
23+
<svg
24+
width={16}
25+
height={16}
26+
viewBox='0 0 16 16'
27+
fill='none'
28+
xmlns='http://www.w3.org/2000/svg'
29+
className={className}
30+
>
31+
<path d='M8.01795 6.35413L6.2859 7.35413V9.35413L8.01795 10.3541L9.75 9.35413V7.35413L8.01795 6.35413Z' stroke='none' strokeLinejoin='round' />
32+
<path d='M12.1169 4.11709C13.2763 5.11966 14 6.54093 14 8.11709C14 9.69326 13.2763 11.1145 12.1169 12.1171M3.88308 12.1171C2.72365 11.1145 2 9.69326 2 8.11709C2 6.47853 2.78208 5.00736 4.02282 4' stroke='none' strokeLinecap='round' strokeLinejoin='round' />
33+
<path d='M10.3519 5.15155C11.3508 5.81802 12 6.89802 12 8.11699C12 9.33596 11.3508 10.416 10.3519 11.0824M5.6481 11.0824C4.64924 10.416 4 9.33596 4 8.11699C4 6.86433 4.68563 5.75841 5.73174 5.09723' stroke='none' strokeLinecap='round' strokeLinejoin='round' />
34+
</svg>
35+
)
36+
break
37+
case MEDIUM:
38+
icon = (
39+
<svg
40+
width={24}
41+
height={24}
42+
viewBox='0 0 24 24'
43+
fill='none'
44+
xmlns='http://www.w3.org/2000/svg'
45+
className={className}
46+
>
47+
<path d='M12.0269 9.35413L9.42885 10.8541V13.8541L12.0269 15.3541L14.625 13.8541V10.8541L12.0269 9.35413Z' stroke='none' strokeWidth={1.5} strokeLinejoin='round' />
48+
<path d='M18.1754 6.17564C19.9145 7.67949 21 9.8114 21 12.1756C21 14.5399 19.9145 16.6718 18.1754 18.1756M5.82463 18.1756C4.08548 16.6718 3 14.5399 3 12.1756C3 9.71779 4.17313 7.51105 6.03424 6' stroke='none' strokeWidth={1.5} strokeLinecap='round' strokeLinejoin='round' />
49+
<path d='M15.5278 7.72735C17.0261 8.72706 18 10.3471 18 12.1755C18 14.004 17.0261 15.624 15.5278 16.6237M8.47216 16.6237C6.97385 15.624 6 14.004 6 12.1755C6 10.2965 7.02844 8.63765 8.59761 7.64587' stroke='none' strokeWidth={1.5} strokeLinecap='round' strokeLinejoin='round' />
50+
</svg>
51+
)
52+
break
53+
case LARGE:
54+
icon = (
55+
<svg
56+
width={40}
57+
height={40}
58+
viewBox='0 0 40 40'
59+
fill='none'
60+
xmlns='http://www.w3.org/2000/svg'
61+
className={className}
62+
>
63+
<path d='M20.0449 15.3541L15.7147 17.8541V22.8541L20.0449 25.3541L24.375 22.8541V17.8541L20.0449 15.3541Z' stroke='none' strokeWidth={2} strokeLinejoin='round' />
64+
<path d='M30.2923 10.2927C33.1909 12.7992 35 16.3523 35 20.2927C35 24.2331 33.1909 27.7863 30.2923 30.2927M9.70771 30.2927C6.80913 27.7863 5 24.2331 5 20.2927C5 16.1963 6.95521 12.5184 10.0571 10' stroke='none' strokeWidth={2} strokeLinecap='round' strokeLinejoin='round' />
65+
<path d='M25.8797 12.8788C28.3769 14.545 30 17.245 30 20.2925C30 23.3399 28.3769 26.0399 25.8797 27.7061M14.1203 27.7061C11.6231 26.0399 10 23.3399 10 20.2925C10 17.1608 11.7141 14.396 14.3293 12.743' stroke='none' strokeWidth={2} strokeLinecap='round' strokeLinejoin='round' />
66+
</svg>
67+
)
68+
break
69+
70+
default:
71+
break
72+
}
73+
return icon
74+
}
75+
76+
export default PodSignalsIcon

src/components/icons/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ import PodMetricsIcon from './PodMetricsIcon'
162162
import PodPerformanceIcon from './PodPerformanceIcon'
163163
import PodSettingsIcon from './PodSettingsIcon'
164164
import PodServicesIcon from './PodServicesIcon'
165+
import PodSignalsIcon from './PodSignalsIcon'
165166
import PreviewPRIcon from './PreviewPRIcon'
166167
import PullRequestIcon from './PullRequestIcon'
167168
import PullRequestLoadingIcon from './PullRequestLoadingIcon'
@@ -398,6 +399,7 @@ export default {
398399
PodPerformanceIcon,
399400
PodSettingsIcon,
400401
PodServicesIcon,
402+
PodSignalsIcon,
401403
PreviewPRIcon,
402404
PullRequestIcon,
403405
PullRequestLoadingIcon,

src/stories/TrendLine.stories.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react'
22
import TrendLine from '../components/TrendLine'
33

44
export default {
5-
title: 'Components/TrendLine',
5+
title: 'Platformatic/Metrics/TrendLine',
66
component: TrendLine
77
}
88

0 commit comments

Comments
 (0)