mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-01 04:11:59 +08:00
fix: styling changes
This commit is contained in:
parent
c9e02a8b25
commit
76fccbbba4
@ -2,7 +2,12 @@ import { Col, Row, Select } from 'antd';
|
|||||||
import { find } from 'lodash-es';
|
import { find } from 'lodash-es';
|
||||||
import React, { useEffect, useRef, useState } from 'react';
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
|
|
||||||
import { Input, RetentionContainer, Typography } from './styles';
|
import {
|
||||||
|
Input,
|
||||||
|
RetentionContainer,
|
||||||
|
RetentionFieldInputContainer,
|
||||||
|
RetentionFieldLabel,
|
||||||
|
} from './styles';
|
||||||
import {
|
import {
|
||||||
convertHoursValueToRelevantUnit,
|
convertHoursValueToRelevantUnit,
|
||||||
SettingPeriod,
|
SettingPeriod,
|
||||||
@ -22,7 +27,9 @@ function Retention({
|
|||||||
timeUnitValue: initialTimeUnitValue,
|
timeUnitValue: initialTimeUnitValue,
|
||||||
} = convertHoursValueToRelevantUnit(Number(retentionValue));
|
} = convertHoursValueToRelevantUnit(Number(retentionValue));
|
||||||
const [selectedTimeUnit, setSelectTimeUnit] = useState(initialTimeUnitValue);
|
const [selectedTimeUnit, setSelectTimeUnit] = useState(initialTimeUnitValue);
|
||||||
const [selectedValue, setSelectedValue] = useState<number | null>(null);
|
const [selectedValue, setSelectedValue] = useState<number | null>(
|
||||||
|
initialValue,
|
||||||
|
);
|
||||||
const interacted = useRef(false);
|
const interacted = useRef(false);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!interacted.current) setSelectedValue(initialValue);
|
if (!interacted.current) setSelectedValue(initialValue);
|
||||||
@ -78,17 +85,10 @@ function Retention({
|
|||||||
<RetentionContainer>
|
<RetentionContainer>
|
||||||
<Row justify="space-between">
|
<Row justify="space-between">
|
||||||
<Col flex={1} style={{ display: 'flex' }}>
|
<Col flex={1} style={{ display: 'flex' }}>
|
||||||
<Typography
|
<RetentionFieldLabel>{text}</RetentionFieldLabel>
|
||||||
style={{
|
|
||||||
verticalAlign: 'middle',
|
|
||||||
whiteSpace: 'pre-wrap',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{text}
|
|
||||||
</Typography>
|
|
||||||
</Col>
|
</Col>
|
||||||
<Col flex="150px">
|
<Col flex="150px">
|
||||||
<div style={{ display: 'inline-flex' }}>
|
<RetentionFieldInputContainer>
|
||||||
<Input
|
<Input
|
||||||
value={selectedValue && selectedValue >= 0 ? selectedValue : ''}
|
value={selectedValue && selectedValue >= 0 ? selectedValue : ''}
|
||||||
onChange={(e): void => onChangeHandler(e, setSelectedValue)}
|
onChange={(e): void => onChangeHandler(e, setSelectedValue)}
|
||||||
@ -101,7 +101,7 @@ function Retention({
|
|||||||
>
|
>
|
||||||
{menuItems}
|
{menuItems}
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</RetentionFieldInputContainer>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</RetentionContainer>
|
</RetentionContainer>
|
||||||
|
@ -80,3 +80,12 @@ export const ErrorText = styled(TypographyComponent)`
|
|||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
export const RetentionFieldLabel = styled(TypographyComponent)`
|
||||||
|
vertical-align: middle;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
`;
|
||||||
|
|
||||||
|
export const RetentionFieldInputContainer = styled.div`
|
||||||
|
display: inline-flex;
|
||||||
|
`;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user