diff --git a/frontend/src/components/CustomTimePicker/CustomTimePicker.styles.scss b/frontend/src/components/CustomTimePicker/CustomTimePicker.styles.scss index 38d8456467..adf6e98269 100644 --- a/frontend/src/components/CustomTimePicker/CustomTimePicker.styles.scss +++ b/frontend/src/components/CustomTimePicker/CustomTimePicker.styles.scss @@ -1,31 +1,6 @@ .custom-time-picker { display: flex; - flex-direction: row; - align-items: center; - gap: 4px; - - .zoom-out-btn { - display: flex; - align-items: center; - justify-content: center; - flex-shrink: 0; - color: var(--foreground); - border: 1px solid var(--border); - border-radius: 2px; - box-shadow: none; - padding: 10px; - height: 33px; - - &:hover:not(:disabled) { - color: var(--bg-vanilla-100); - background: var(--primary); - } - - &:disabled { - opacity: 0.5; - cursor: not-allowed; - } - } + flex-direction: column; .timeSelection-input { &:hover { diff --git a/frontend/src/components/CustomTimePicker/CustomTimePicker.test.tsx b/frontend/src/components/CustomTimePicker/CustomTimePicker.test.tsx index 78387187ac..a752f49361 100644 --- a/frontend/src/components/CustomTimePicker/CustomTimePicker.test.tsx +++ b/frontend/src/components/CustomTimePicker/CustomTimePicker.test.tsx @@ -16,15 +16,6 @@ jest.mock('react-router-dom', () => { }; }); -jest.mock('react-redux', () => ({ - ...jest.requireActual('react-redux'), - useDispatch: jest.fn(() => jest.fn()), - useSelector: jest.fn(() => ({ - minTime: 0, - maxTime: Date.now(), - })), -})); - jest.mock('providers/Timezone', () => { const actual = jest.requireActual('providers/Timezone'); diff --git a/frontend/src/components/CustomTimePicker/CustomTimePicker.tsx b/frontend/src/components/CustomTimePicker/CustomTimePicker.tsx index 008f63357f..a1b2c582ec 100644 --- a/frontend/src/components/CustomTimePicker/CustomTimePicker.tsx +++ b/frontend/src/components/CustomTimePicker/CustomTimePicker.tsx @@ -7,11 +7,9 @@ import { useState, } from 'react'; import { useLocation } from 'react-router-dom'; -import { Button } from '@signozhq/button'; import { Input, InputRef, Popover, Tooltip } from 'antd'; import cx from 'classnames'; import { DATE_TIME_FORMATS } from 'constants/dateTimeFormats'; -import { QueryParams } from 'constants/query'; import { DateTimeRangeType } from 'container/TopNav/CustomDateTimeModal'; import { FixedDurationSuggestionOptions, @@ -19,11 +17,9 @@ import { RelativeDurationSuggestionOptions, } from 'container/TopNav/DateTimeSelectionV2/constants'; import dayjs from 'dayjs'; -import { useZoomOut } from 'hooks/useZoomOut'; import { isValidShortHandDateTimeFormat } from 'lib/getMinMax'; -import { isZoomOutDisabled } from 'lib/zoomOutUtils'; import { defaultTo, isFunction, noop } from 'lodash-es'; -import { ChevronDown, ChevronUp, ZoomOut } from 'lucide-react'; +import { ChevronDown, ChevronUp } from 'lucide-react'; import { useTimezone } from 'providers/Timezone'; import { getTimeDifference, validateEpochRange } from 'utils/epochUtils'; import { popupContainer } from 'utils/selectPopupContainer'; @@ -70,8 +66,6 @@ interface CustomTimePickerProps { showRecentlyUsed?: boolean; minTime: number; maxTime: number; - /** When true, zoom-out button is hidden (e.g. in drawer/modal time selection) */ - isModalTimeSelection?: boolean; } function CustomTimePicker({ @@ -94,7 +88,6 @@ function CustomTimePicker({ showRecentlyUsed = true, minTime, maxTime, - isModalTimeSelection = false, }: CustomTimePickerProps): JSX.Element { const [ selectedTimePlaceholderValue, @@ -123,14 +116,6 @@ function CustomTimePicker({ const [isOpenedFromFooter, setIsOpenedFromFooter] = useState(false); - const durationMs = (maxTime - minTime) / 1e6; - const zoomOutDisabled = showLiveLogs || isZoomOutDisabled(durationMs); - - const handleZoomOut = useZoomOut({ - isDisabled: zoomOutDisabled, - urlParamsToDelete: [QueryParams.activeLogId], - }); - // function to get selected time in Last 1m, Last 2h, Last 3d, Last 4w format // 1m, 2h, 3d, 4w -> Last 1 minute, Last 2 hours, Last 3 days, Last 4 weeks const getSelectedTimeRangeLabelInRelativeFormat = ( @@ -646,23 +631,6 @@ function CustomTimePicker({ /> - {!showLiveLogs && !isModalTimeSelection && ( - - -