Skip to content

Commit 46a5559

Browse files
committed
fix types
1 parent a445958 commit 46a5559

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

components/TextWidget/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { CSSProperties } from 'react';
2+
13
const TextWidget = ({ text }) => {
24
const edge_color = 'black';
35
const ew = 1;
@@ -12,7 +14,7 @@ const TextWidget = ({ text }) => {
1214
`${ew}px 0 0 ${edge_color}`
1315
].join(', ');
1416

15-
const style = {
17+
const style: CSSProperties = {
1618
boxSizing: 'border-box',
1719
position: 'absolute',
1820
right: 0,

components/TimeWidget/index.tsx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
1-
import React from 'react'
1+
import React, { CSSProperties } from 'react'
22

3-
class TimeWidget extends React.Component {
4-
constructor(props) {
3+
interface TimeWidgetProps {
4+
size: number;
5+
};
6+
7+
interface TimeWidgetState {
8+
time: Date;
9+
};
10+
11+
class TimeWidget extends React.Component<TimeWidgetProps, TimeWidgetState> {
12+
interval: NodeJS.Timer | null;
13+
14+
constructor(props: TimeWidgetProps) {
515
super(props)
616
this.state = {
717
time: new Date()
@@ -11,7 +21,7 @@ class TimeWidget extends React.Component {
1121
render() {
1222
const { size } = this.props
1323

14-
const style = {
24+
const style: CSSProperties = {
1525
display: 'flex',
1626
justifyContent: 'center',
1727
alignItems: 'center',

0 commit comments

Comments
 (0)