-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add prometheus icon with state color SH-215
- Loading branch information
v.trushin
committed
Oct 31, 2024
1 parent
80d58b2
commit 1e373e1
Showing
5 changed files
with
69 additions
and
30 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
statshouse-ui/src/components2/Plot/PlotControl/PrometheusSwitch/PrometheusSwitch.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright 2024 V Kontakte LLC | ||
// | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
import React, { memo } from 'react'; | ||
import { SwitchBox } from 'components/UI'; | ||
import cn from 'classnames'; | ||
|
||
import { ReactComponent as SVGPrometheus } from '../../../../assets/svg/Prometheus.svg'; | ||
|
||
type IPrometheusSwitchProps = { | ||
prometheusCompat: boolean; | ||
setPrometheusCompat: (arg: boolean) => void; | ||
}; | ||
|
||
function _PrometheusSwitch({ prometheusCompat, setPrometheusCompat }: IPrometheusSwitchProps) { | ||
return ( | ||
<SwitchBox | ||
className="text-nowrap my-1 mx-2 user-select-none" | ||
checked={prometheusCompat} | ||
onChange={setPrometheusCompat} | ||
title="Prometheus cumulative counters mode" | ||
> | ||
<SVGPrometheus className={cn(prometheusCompat ? 'text-primary' : 'text-body-tertiary')} width={26} height={26} /> | ||
</SwitchBox> | ||
); | ||
} | ||
|
||
export const PrometheusSwitch = memo(_PrometheusSwitch); |
7 changes: 7 additions & 0 deletions
7
statshouse-ui/src/components2/Plot/PlotControl/PrometheusSwitch/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Copyright 2024 V Kontakte LLC | ||
// | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
export * from './PrometheusSwitch'; |