Skip to content

Commit f625543

Browse files
committed
add types to sidebar props
1 parent 68e3a97 commit f625543

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

packages/gatsby-theme/src/components/TutorialSidebar.tsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
import React from 'react';
2-
import { Card, Image, Heading, Flex, Text } from './shared/base';
2+
import { Card, Image, Heading, Flex } from './shared/base';
33
import { authors } from '../utils/sampleData';
44
import AuthorList from './AuthorList';
55
import CustomButton from './CustomButton';
66

7-
export const Sidebar = ({ tutorialTitle, chapters }) => {
7+
type SidebarProps = {
8+
tutorialTitle: string;
9+
chapters: string[];
10+
};
11+
12+
export const Sidebar: React.FunctionComponent<SidebarProps> = ({
13+
tutorialTitle,
14+
chapters,
15+
}) => {
816
return (
917
<div>
1018
<Card p={3} m={2}>
@@ -23,7 +31,10 @@ export const Sidebar = ({ tutorialTitle, chapters }) => {
2331
);
2432
};
2533

26-
export const TabletSidebar = ({ tutorialTitle, chapters }) => {
34+
export const TabletSidebar: React.FunctionComponent<SidebarProps> = ({
35+
tutorialTitle,
36+
chapters,
37+
}) => {
2738
console.log(tutorialTitle);
2839
console.log(chapters);
2940
return (

packages/gatsby-theme/src/pages/signup.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { CenteredLoader } from '../components/Loader';
77
import { Flex, Text, Box } from '../components/shared/base';
88
import CustomButton from '../components/CustomButton';
99
import { loginUser } from '../utils/auth';
10-
import { CURRENT_USER } from '../components/queries/UserQueries';
10+
import { CURRENT_USER } from '../components/queries/userQueries';
1111
import { optionalChaining } from '../utils/helpers';
1212

1313
const Signup = () => (

0 commit comments

Comments
 (0)