@@ -4,31 +4,32 @@ import React from 'react';
44import BookmarkStar from 'app/components/projects/bookmarkStar' ;
55import Link from 'app/components/links/link' ;
66import ProjectLabel from 'app/components/projectLabel' ;
7- import SentryTypes from 'app/sentryTypes' ;
87import space from 'app/styles/space' ;
8+ import { Project , Organization } from 'app/types' ;
99
10- class ProjectItem extends React . Component {
11- static propTypes = {
12- project : SentryTypes . Project ,
13- organization : SentryTypes . Organization ,
14- } ;
10+ type Props = {
11+ project : Project ;
12+ organization : Organization ;
13+ } ;
1514
16- constructor ( props ) {
17- super ( props ) ;
18- this . state = {
19- isBookmarked : this . props . project . isBookmarked ,
20- } ;
21- }
15+ type State = {
16+ isBookmarked : boolean ;
17+ } ;
18+
19+ class ProjectItem extends React . Component < Props , State > {
20+ state = {
21+ isBookmarked : this . props . project . isBookmarked ,
22+ } ;
2223
23- handleToggleBookmark = isBookmarked => {
24+ handleToggleBookmark = ( isBookmarked : State [ 'isBookmarked' ] ) => {
2425 this . setState ( { isBookmarked} ) ;
2526 } ;
2627
2728 render ( ) {
2829 const { project, organization} = this . props ;
2930
3031 return (
31- < Container key = { project . id } >
32+ < Wrapper >
3233 < BookmarkLink
3334 organization = { organization }
3435 project = { project }
@@ -38,12 +39,12 @@ class ProjectItem extends React.Component {
3839 < Link to = { `/settings/${ organization . slug } /projects/${ project . slug } /` } >
3940 < ProjectLabel project = { project } />
4041 </ Link >
41- </ Container >
42+ </ Wrapper >
4243 ) ;
4344 }
4445}
4546
46- const Container = styled ( 'div' ) `
47+ const Wrapper = styled ( 'div' ) `
4748 display: flex;
4849 align-items: center;
4950` ;
0 commit comments