Skip to content

Commit 55eced2

Browse files
committed
added types
1 parent 6e04514 commit 55eced2

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

packages/react-core/src/demos/examples/Banner/BannerTopBottom.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const BannerTopBottom: React.FunctionComponent = () => (
4444
<h1 id="main-title">Main title</h1>
4545
<p>
4646
Body text should be Red Hat Text at 1rem(16px). It should have leading of 1.5rem(24px) because <br />
47-
of its relative line height of 1.5.
47+
of it's relative line height of 1.5.
4848
</p>
4949
</Content>
5050
</PageSection>

packages/react-core/src/demos/examples/DateTimePicker/DateTimeRangePicker.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ import {
1111
} from '@patternfly/react-core';
1212

1313
export const DateTimeRangePicker: React.FunctionComponent = () => {
14-
const [from, setFrom] = useState();
15-
const [to, setTo] = useState();
14+
const [from, setFrom] = useState<Date | undefined>(undefined);
15+
const [to, setTo] = useState<Date | undefined>(undefined);
1616

17-
const toValidator = (date) =>
17+
const toValidator = (date: Date) =>
1818
isValidDate(from) && yyyyMMddFormat(date) >= yyyyMMddFormat(from)
1919
? ''
2020
: 'The "to" date must be after the "from" date';
2121

22-
const onFromDateChange = (_event, inputDate, newFromDate) => {
22+
const onFromDateChange = (_event: React.FormEvent<HTMLInputElement>, inputDate: string, newFromDate: Date) => {
2323
if (isValidDate(from) && isValidDate(newFromDate) && inputDate === yyyyMMddFormat(newFromDate)) {
2424
newFromDate.setHours(from.getHours());
2525
newFromDate.setMinutes(from.getMinutes());
@@ -29,7 +29,7 @@ export const DateTimeRangePicker: React.FunctionComponent = () => {
2929
}
3030
};
3131

32-
const onFromTimeChange = (_event, time, hour, minute) => {
32+
const onFromTimeChange = (_event: React.FormEvent<HTMLInputElement>, _time: string, hour: number, minute: number) => {
3333
if (isValidDate(from)) {
3434
const updatedFromDate = new Date(from);
3535
updatedFromDate.setHours(hour);
@@ -38,7 +38,7 @@ export const DateTimeRangePicker: React.FunctionComponent = () => {
3838
}
3939
};
4040

41-
const onToDateChange = (_event, inputDate, newToDate) => {
41+
const onToDateChange = (_event: React.FormEvent<HTMLInputElement>, inputDate: string, newToDate: Date) => {
4242
if (isValidDate(to) && isValidDate(newToDate) && inputDate === yyyyMMddFormat(newToDate)) {
4343
newToDate.setHours(to.getHours());
4444
newToDate.setMinutes(to.getMinutes());
@@ -48,7 +48,7 @@ export const DateTimeRangePicker: React.FunctionComponent = () => {
4848
}
4949
};
5050

51-
const onToTimeChange = (_event, time, hour, minute) => {
51+
const onToTimeChange = (_event: React.FormEvent<HTMLInputElement>, _time: string, hour: number, minute: number) => {
5252
if (isValidDate(to)) {
5353
const updatedToDate = new Date(to);
5454
updatedToDate.setHours(hour);

0 commit comments

Comments
 (0)