fix: custom time width and refresh text visibility issues (#4428)

This commit is contained in:
Yunus M 2024-01-24 16:09:32 +05:30 committed by GitHub
parent 9e05cb48fe
commit 5b0e3d375a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 18 additions and 10 deletions

View File

@ -37,6 +37,12 @@
padding: 4px 8px;
padding-left: 0px !important;
&.custom-time {
input:not(:focus) {
min-width: 240px;
}
}
input::placeholder {
color: white;
}

View File

@ -178,7 +178,10 @@ function CustomTimePicker({
return (
<div className="custom-time-picker">
<Popover
className="timeSelection-input-container"
className={cx(
'timeSelection-input-container',
selectedTime === 'custom' && inputValue === '' ? 'custom-time' : '',
)}
placement="bottomRight"
getPopupContainer={popupContainer}
content={content}
@ -193,12 +196,7 @@ function CustomTimePicker({
<Input
className="timeSelection-input"
type="text"
style={{
minWidth: '120px',
width: '100%',
}}
status={inputValue && inputStatus === 'error' ? 'error' : ''}
allowClear={!isInputFocused && selectedTime === 'custom'}
placeholder={
isInputFocused
? 'Time Format (1m or 2h or 3d or 4w)'

View File

@ -0,0 +1,3 @@
.date-time-selection-container {
margin-bottom: 16px;
}

View File

@ -1,3 +1,5 @@
import './DateTimeSelection.styles.scss';
import { SyncOutlined } from '@ant-design/icons';
import { Button } from 'antd';
import getLocalStorageKey from 'api/browser/localstorage/get';
@ -294,7 +296,7 @@ function DateTimeSelection({
}, [location.pathname, updateTimeInterval, globalTimeLoading]);
return (
<>
<div className="date-time-selection-container">
<Form
form={formSelector}
layout="inline"
@ -335,7 +337,7 @@ function DateTimeSelection({
</FormContainer>
</Form>
{!hasSelectedTimeError && (
{!hasSelectedTimeError && selectedTime !== 'custom' && (
<RefreshText
{...{
onLastRefreshHandler,
@ -351,7 +353,7 @@ function DateTimeSelection({
setCustomDTPickerVisible(false);
}}
/>
</>
</div>
);
}

View File

@ -24,7 +24,6 @@ interface Props {
}
export const RefreshTextContainer = styled.div<Props>`
min-height: 2rem;
visibility: ${({ refreshButtonHidden }): string =>
refreshButtonHidden ? 'hidden' : 'visible'};
`;