Skip to content

Commit e8904b3

Browse files
committed
refactor(ofHome): port remaining modules to ts
1 parent 335e1fa commit e8904b3

File tree

3 files changed

+29
-17
lines changed

3 files changed

+29
-17
lines changed
File renamed without changes.

lib/ui/templates/ofHome/Services.js renamed to lib/ui/templates/ofHome/Services.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { array, string } from "prop-types";
21
import React from "react";
32
import styled from "styled-components";
43

@@ -41,8 +40,18 @@ const ItemTitle = styled.h3`
4140
font-weight: 800;
4241
`;
4342

44-
function Services(props) {
43+
interface ServicesProps {
44+
services: {
45+
title: string;
46+
text: string;
47+
}[];
48+
subtitle?: string;
49+
title?: string;
50+
}
51+
52+
function Services(props: ServicesProps) {
4553
const { services, title, subtitle } = props;
54+
4655
return (
4756
<Element as="section">
4857
<div className="el">
@@ -65,10 +74,4 @@ function Services(props) {
6574
);
6675
}
6776

68-
Services.propTypes = {
69-
services: array.isRequired,
70-
subtitle: string.isRequired,
71-
title: string.isRequired
72-
};
73-
7477
export default Services;

lib/ui/templates/ofHome/Testimonials.js renamed to lib/ui/templates/ofHome/Testimonials.tsx

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { array, string } from "prop-types";
21
import React from "react";
32
import styled from "styled-components";
43

@@ -25,7 +24,12 @@ const Items = styled.ul`
2524
}
2625
}
2726
`;
28-
const Item = styled.li`
27+
28+
interface ItemProp {
29+
readonly $span: boolean
30+
}
31+
32+
const Item = styled.li<ItemProp>`
2933
height: 100%;
3034
.quote {
3135
${setSpace("mbs")};
@@ -67,8 +71,19 @@ const Item = styled.li`
6771
: ``};
6872
`;
6973

70-
function Testimonials(props) {
74+
interface TestimonialsProps {
75+
testimonials: {
76+
source: string;
77+
text: string;
78+
span: boolean;
79+
}[];
80+
subtitle?: string;
81+
title?: string;
82+
}
83+
84+
function Testimonials(props: TestimonialsProps) {
7185
const { testimonials, title, subtitle } = props;
86+
7287
return (
7388
<Element as="section">
7489
<div className="el">
@@ -93,10 +108,4 @@ function Testimonials(props) {
93108
);
94109
}
95110

96-
Testimonials.propTypes = {
97-
testimonials: array.isRequired,
98-
subtitle: string.isRequired,
99-
title: string.isRequired
100-
};
101-
102111
export default Testimonials;

0 commit comments

Comments
 (0)