Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web/packages/teleport/src/Discover/Discover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { Box } from 'design';
import { FeatureBox } from 'teleport/components/Layout';

import { Navigation } from 'teleport/Discover/Navigation/Navigation';
import { SelectResource } from 'teleport/Discover/SelectResource';
import { SelectResource } from 'teleport/Discover/SelectResource/SelectResource';
import cfg from 'teleport/config';

import { findViewAtIndex } from './flow';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@ limitations under the License.
import React from 'react';
import { isAfter, endOfDay, startOfDay, isSameDay, subMonths } from 'date-fns';
import styled from 'styled-components';
import DayPicker, { DateUtils } from 'react-day-picker';
import dayPicker from 'react-day-picker/DayPicker';
import 'react-day-picker/lib/style.css';
import { Flex } from 'design';
import { Close as CloseIcon } from 'design/Icon';

// There is a vite issue with react-day-picker in production builds
// https://github.com/vitejs/vite/issues/2139
// TODO(ryan): After node v18 upgrade, swap to the Vite config approach instead of this one
// also, we should look into upgrading react-day-picker
const DayPicker = dayPicker.default || dayPicker;

export default class CustomRange extends React.Component {
constructor(props) {
super();
Expand Down Expand Up @@ -51,7 +57,7 @@ export default class CustomRange extends React.Component {
this.startSelecting = true;
}

const range = DateUtils.addDayToRange(day, { from, end });
const range = dayPicker.DateUtils.addDayToRange(day, { from, end });

if (range.from) {
range.from = startOfDay(range.from);
Expand Down