Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ERROR_CODE_EMAIL_TAKEN,
ERROR_CODE_EMAIL_NOT_FOUND,
ERROR_CODE_TOO_MANY_VERIFICATION_REQUESTS,
ERROR_CODE_UPLOAD_OVER_LIMIT,
ERROR_CODE_VALIDATION_INVALID_PARAMS,
ERROR_CODE_VALIDATION_INVALID_VALUE,
ERROR_CODE_NOT_FOUND,
ERROR_CODE_FORBIDDEN,
ERROR_CODE_MISSING_STRIPE_ACCOUNT,
];
// API error
// TODO this is likely to change soonish
propTypes.apiError = shape({
id: propTypes.uuid.isRequired,
status: number.isRequired,
code: oneOf(ERROR_CODES).isRequired,
title: string.isRequired,
meta: object,
});
// Storable error prop type. (Error object should not be stored as it is.)
propTypes.error = shape({
type: propTypes.value('error').isRequired,
name: string.isRequired,
message: string,
status: number,
statusText: string,
apiErrors: arrayOf(propTypes.apiError),
});
// Options for showing just date or date and time on BookingTimeInfo and BookingBreakdown
let untagUser = async e => {
e.preventDefault()
await post('/api/untag', { user, post: post_id })
dispatch(untag(user))
decrementTags()
Notify({ value: 'Untagged!!' })
}
let btnLabel = `Untag ${isAdmin() ? 'as admin' : ''}`
return
}
Untag.propTypes = {
post_id: number.isRequired,
user: number.isRequired,
decrementTags: func.isRequired,
}
export default connect()(Untag)
export { Untag as PureUntag }
export default class TopEntities extends Component {
static widgetTitle() {
return 'Top Entities';
}
static widgetDescription() {
return 'Discovery can easily extract frequently mentioned entities - such as people, topics and companies - from the set of articles.';
}
static propTypes = {
entities: shape({
topics: arrayOf(
shape({
key: string.isRequired,
matching_results: number.isRequired,
})
).isRequired,
companies: arrayOf(
shape({
key: string.isRequired,
matching_results: number.isRequired,
})
).isRequired,
people: arrayOf(
shape({
key: string.isRequired,
matching_results: number.isRequired,
})
).isRequired,
}).isRequired,
query: shape({
{svg.group}
)}
);
const brandProps = {
product: string.isRequired,
serviceLocalisedName: string,
maxWidth: number.isRequired,
minWidth: number.isRequired,
svgHeight: number.isRequired,
svg: shape({
group: node.isRequired,
ratio: number.isRequired,
viewbox: shape({
height: number.isRequired,
width: number.isRequired,
}).isRequired,
}).isRequired,
backgroundColour: string.isRequired,
logoColour: string.isRequired,
};
StyledBrand.propTypes = brandProps;
StyledBrand.defaultProps = {
status: oneOf(Object.values(facilityListItemStatusChoicesEnum)).isRequired,
processing_started_at: string,
processing_completed_at: string,
name: string.isRequired,
address: string.isRequired,
country_code: string.isRequired,
country_name: string.isRequired,
geocoded_point: string,
geocoded_address: string,
facility_list: number.isRequired,
processing_errors: arrayOf(string.isRequired),
matched_facility: shape({
oar_id: string.isRequired,
address: string.isRequired,
name: string.isRequired,
created_from_id: number.isRequired,
location: shape({
lng: number.isRequired,
lat: number.isRequired,
}).isRequired,
}),
matches: arrayOf(shape({
id: number.isRequired,
oar_id: string.isRequired,
address: string.isRequired,
name: string.isRequired,
location: shape({
lng: number.isRequired,
lat: number.isRequired,
}).isRequired,
}).isRequired),
});
{details}
{source}
);
}
}
LayerBox.propTypes = {
dispatch: func.isRequired,
layerName: string.isRequired,
layerUrl: string.isRequired,
i: number.isRequired,
viewDetail: bool.isRequired,
layerTileJSON: shape({}).isRequired,
removeLayer: func.isRequired,
opacity: number.isRequired,
changeOpacity: func.isRequired,
visible: bool.isRequired,
toggleVisibility: func.isRequired,
};
function mapStateToProps(state) {
return state.main;
}
export default connect(mapStateToProps)(LayerBox);
document.removeEventListener('keydown', this.handleKeyDown);
this.addedGlobalListener = false;
}
};
private refContainer = (element: HTMLSpanElement | null) => {
this.container = element;
};
}
Paging.propTypes = {
/**
* Current active page
*/
activePage: number.isRequired,
/**
* React component that would be used for rendering items
*
* Usefull for router integration
*/
component: func,
/**
* Total page count
*/
pagesCount: number.isRequired,
/**
* Calls when page has been changed
*/
onChange={() =>
toggleNotification(notification.id, errorTurnedOn, 'error')
}
aria-label={i18n._(t`Toggle notification failure`)}
/>
,
]}
/>
);
}
NotificationListItem.propTypes = {
notification: shape({
id: number.isRequired,
name: string.isRequired,
notification_type: string.isRequired,
}).isRequired,
canToggleNotifications: bool.isRequired,
detailUrl: string.isRequired,
errorTurnedOn: bool,
startedTurnedOn: bool,
successTurnedOn: bool,
toggleNotification: func.isRequired,
typeLabels: shape().isRequired,
};
NotificationListItem.defaultProps = {
errorTurnedOn: false,
startedTurnedOn: false,
successTurnedOn: false,
return (
<div>
{accountBalanceBlock}
{accountAddressBlock}
{contractBalanceBlock}
{contractAddressBlock}
</div>
);
}
ContractInfo.propTypes = {
accountAddress: string,
accountBalance: number.isRequired,
contractAddress: string.isRequired,
contractBalance: number.isRequired,
network: number.isRequired,
};
ContractInfo.defaultProps = {
accountAddress: null,
};
export default ContractInfo;
const { theme } = useContext(ThemeContext);
const { muted } = getTheme(theme);
return (
<div muted="">
<small>
{date} • {timeToRead} min read
</small>
{Array.from({ length: timeToRead / 7 + 1 }).map((item, index) => (
))}
</div>
);
};
BlogInfo.propTypes = {
timeToRead: number.isRequired,
date: string.isRequired,
};
export default BlogInfo;