mirror of
https://github.com/zhigang1992/devhub.git
synced 2026-06-18 03:58:44 +08:00
Using prop-types package
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
"lodash": "^4.17.3",
|
||||
"moment": "^2.18.1",
|
||||
"normalizr": "^3.2.3",
|
||||
"prop-types": "^15.5.10",
|
||||
"qs": "^6.4.0",
|
||||
"react": "^16.0.0-alpha.12",
|
||||
"react-native": "^0.45.0-rc.2",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// @flow
|
||||
|
||||
import PropTypes from 'prop-types'
|
||||
import React from 'react'
|
||||
import { Dimensions } from 'react-native'
|
||||
import { List, Set } from 'immutable'
|
||||
@@ -21,9 +22,7 @@ import { FullView } from '../cards/__CardComponents'
|
||||
import { getRequestTypeIcon, requestTypes } from '../../api/github'
|
||||
|
||||
import { getDateWithHourAndMinuteText } from '../../utils/helpers'
|
||||
import {
|
||||
getEventIdsFromEventsIncludingMerged,
|
||||
} from '../../utils/helpers/github/events'
|
||||
import { getEventIdsFromEventsIncludingMerged } from '../../utils/helpers/github/events'
|
||||
|
||||
import type {
|
||||
ActionCreators,
|
||||
@@ -36,7 +35,7 @@ const isWebWithBigHeight =
|
||||
|
||||
export default class EventColumn extends React.PureComponent {
|
||||
static contextTypes = {
|
||||
store: React.PropTypes.object.isRequired,
|
||||
store: PropTypes.object.isRequired,
|
||||
}
|
||||
|
||||
onRefresh = () => {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// @flow
|
||||
|
||||
import PropTypes from 'prop-types'
|
||||
import React from 'react'
|
||||
import { Dimensions } from 'react-native'
|
||||
import { Iterable, List, Set } from 'immutable'
|
||||
@@ -12,10 +13,8 @@ import ColumnWithList, {
|
||||
HeaderButtonsContainer,
|
||||
} from './_ColumnWithList'
|
||||
import { defaultIcon as summaryIcon } from './NotificationsFilterColumn'
|
||||
import NotificationsFilterColumnContainer
|
||||
from '../../containers/NotificationsFilterColumnContainer'
|
||||
import NotificationCardContainer
|
||||
from '../../containers/NotificationCardContainer'
|
||||
import NotificationsFilterColumnContainer from '../../containers/NotificationsFilterColumnContainer'
|
||||
import NotificationCardContainer from '../../containers/NotificationCardContainer'
|
||||
import Platform from '../../libs/platform'
|
||||
import { FullAbsoluteView, FullView } from '../cards/__CardComponents'
|
||||
import { getOwnerAndRepo } from '../../utils/helpers/github/shared'
|
||||
@@ -30,7 +29,7 @@ export const defaultIcon = 'bell'
|
||||
export const defaultTitle = 'notifications'
|
||||
|
||||
export default class NotificationColumn extends React.PureComponent {
|
||||
static contextTypes = { store: React.PropTypes.object.isRequired }
|
||||
static contextTypes = { store: PropTypes.object.isRequired }
|
||||
|
||||
static defaultProps = {
|
||||
icon: undefined,
|
||||
@@ -74,7 +73,7 @@ export default class NotificationColumn extends React.PureComponent {
|
||||
return Set(notificationIds).subtract(readNotificationIds).toList()
|
||||
}
|
||||
|
||||
getRightHeader = isSummary => (
|
||||
getRightHeader = isSummary =>
|
||||
<HeaderButtonsContainer>
|
||||
<HeaderButton onPress={this.toggleSummary}>
|
||||
<HeaderButtonIcon name={summaryIcon} active={isSummary} />
|
||||
@@ -84,7 +83,6 @@ export default class NotificationColumn extends React.PureComponent {
|
||||
<HeaderButtonIcon name="chevron-down" muted={isSummary} />
|
||||
</HeaderButton>
|
||||
</HeaderButtonsContainer>
|
||||
)
|
||||
|
||||
toggleSummary = () => {
|
||||
this.setState(({ summary }) => ({ summary: !summary }))
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/* eslint-disable react-native/no-color-literals */
|
||||
// Source code from https://github.com/necolas/react-native-web/pull/411
|
||||
|
||||
import React, { PureComponent, PropTypes } from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import React, { PureComponent } from 'react'
|
||||
import { Animated, Dimensions, StyleSheet } from 'react-native'
|
||||
|
||||
const shortAnimTime = 200
|
||||
|
||||
Reference in New Issue
Block a user