mirror of
https://github.com/quay/quay.git
synced 2026-01-26 06:21:37 +03:00
chore: remove prop-types dependency usage in favor of TypeScript types (#4510)
Converted all remaining prop-types usage to TypeScript interfaces: - SystemStatusBanner: Added BannerContentProps interface - DateTimePicker: Added DateTimePickerProps interface prop-types remains as transitive dependency but is no longer directly imported or used in the codebase. Signed-off-by: Brady Pratt <bpratt@redhat.com> Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,15 @@
|
||||
import React, {useState} from 'react';
|
||||
import {DatePicker, TimePicker} from '@patternfly/react-core';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
export default function DateTimePicker(props) {
|
||||
interface DateTimePickerProps {
|
||||
id?: string;
|
||||
value: Date | null;
|
||||
setValue: React.Dispatch<React.SetStateAction<Date | null>>;
|
||||
futureDatesOnly?: boolean;
|
||||
initialDate?: Date;
|
||||
}
|
||||
|
||||
export default function DateTimePicker(props: DateTimePickerProps) {
|
||||
const {id, value, setValue, futureDatesOnly, initialDate} = props;
|
||||
const userLocale = navigator.language;
|
||||
const date = value ?? initialDate;
|
||||
@@ -65,11 +72,3 @@ export default function DateTimePicker(props) {
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
DateTimePicker.propTypes = {
|
||||
id: PropTypes.string,
|
||||
value: PropTypes.instanceOf(Date),
|
||||
setValue: PropTypes.func.isRequired,
|
||||
futureDatesOnly: PropTypes.bool,
|
||||
initialDate: PropTypes.instanceOf(Date),
|
||||
};
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
import React from 'react';
|
||||
import {Banner, Flex, FlexItem} from '@patternfly/react-core';
|
||||
import {ExclamationTriangleIcon} from '@patternfly/react-icons';
|
||||
import {useQuayState} from 'src/hooks/UseQuayState';
|
||||
import {useQuayConfig} from 'src/hooks/UseQuayConfig';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
const BannerContent = ({icon, children}) => (
|
||||
interface BannerContentProps {
|
||||
icon: React.ReactNode;
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
const BannerContent: React.FC<BannerContentProps> = ({icon, children}) => (
|
||||
<Flex
|
||||
spaceItems={{default: 'spaceItemsSm'}}
|
||||
justifyContent={{default: 'justifyContentCenter'}}
|
||||
@@ -15,11 +20,6 @@ const BannerContent = ({icon, children}) => (
|
||||
</Flex>
|
||||
);
|
||||
|
||||
BannerContent.propTypes = {
|
||||
icon: PropTypes.node.isRequired,
|
||||
children: PropTypes.node.isRequired,
|
||||
};
|
||||
|
||||
export default function SystemStatusBanner() {
|
||||
const {inReadOnlyMode, inAccountRecoveryMode} = useQuayState();
|
||||
const config = useQuayConfig();
|
||||
|
||||
Reference in New Issue
Block a user