componentDidMount() { const self = this; self.getClaim(); self.getPersonality(); // @TODO i18n message.info("Clique em uma frase para iniciar uma revisão"); }
addToFavorites() { if (!this.props.auth.authenticated) { return message.info('You need to login to add to favorites'); } this.props.addToFavorites(this.props.match.params.tutorial); message.success('Tutorial added to favorites'); this.props.getUserProfile(); setTimeout(() => this.props.clearMessage(), 3000); }
Axios.post(`/api/update/article/${query.aid || aid}`, params) .then(res => { this.isPosting = false; hide(); let resData = res.data; message.info(resData.message); }) .catch(err => { hide(); message.warning(resData.message); this.isPosting = false; })
addReview() { if (!this.props.auth.authenticated) { return message.info('You need to login to add a review'); } if (this.refs.review.textAreaRef.value.trim() === '') { return message.info('Enter a review'); } const newReview = { review: this.refs.review.textAreaRef.value }; this.props.addReview(this.props.match.params.tutorial, newReview); this.refs.review.textAreaRef.value = ''; }
const Home = () => { const goGithub = useCallback(() => { message.info("Thank you!"); location.href = "https://github.com/lijinke666/dawdler.git"; }, []); return ( <> <h2> Hey ! Thank you for using <strong className="name">dawdler</strong> </h2> <div className="logo"> <img src={require("../../logo.png")} alt="" /> </div> <Button icon="github" type="primary" onClick={goGithub}> Github </Button> <Divider> {name} By:{" "} <a href="https://github.com/lijinke666/dawdler.git" target="_blank"> dawdler </a> </Divider> </> ); }
const handleBatchModify = (records, field, value) => { const setPropertyValues = () => { const curProperties = thisRef.current.properties for (const record of records) { const existIndex = curProperties.findIndex(v => v.name === record.name) if (existIndex > -1) { const newRecord = {...curProperties[existIndex]} newRecord[field] = value curProperties[existIndex] = newRecord // console.log(`handleBatchModify, ${record.name} => ${value}`) } } actionRef.current.reload() message.info('设置完毕') } records.length > 10 ? Modal.confirm({ content: `确认批量设置 ${records.length} 个属性?`, onOk: () => { setPropertyValues() } }) : setPropertyValues() }
addUpvote() { if (!this.props.auth.authenticated) { return message.info('You need to login to upvote'); } this.props.addUpvote(this.props.tutorial._id); message.success('Upvote Added'); this.props.getUserProfile(); window.location.reload(); setTimeout(() => this.props.clearUpvoteMessage(), 3000); }
const result = await UserService.updateUser(userInfo.user_id, userInfo) if (result) { message.info('个人信息已修改') this.props.dispatch({ type: 'user/updateCurrent',
addUpvote() { if (!this.props.auth.authenticated) { return message.info('You need to login to upvote'); } this.props.addUpvote(this.props.match.params.tutorial); message.success('Upvote Added'); this.props.getUserProfile(); this.props.getTutorial(this.props.match.params.tutorial); setTimeout(() => this.props.clearUpvoteMessage(), 3000); }
addToFavorites() { if (!this.props.auth.authenticated) { return message.info('You need to login to add to favorites'); } this.props.addToFavorites(this.props.tutorial._id); message.success('Tutorial added to favorites'); this.props.getUserProfile(); setTimeout(() => this.props.clearMessage(), 3000); }
addUpvote() { if (!this.props.auth.authenticated) { return message.info('You need to login to upvote'); } this.props.addUpvote(this.props.match.params.tutorial); message.success('Upvote Added'); this.props.getUserProfile(); this.props.getTutorial(this.props.match.params.tutorial); setTimeout(() => this.props.clearUpvoteMessage(), 3000); }
addToFavorites() { if (!this.props.auth.authenticated) { return message.info('You need to login to add to favorites'); } this.props.addToFavorites(this.props.tutorial._id); message.success('Tutorial added to favorites'); this.props.getUserProfile(); setTimeout(() => this.props.clearMessage(), 3000); }
addToFavorites() { if (!this.props.auth.authenticated) { return message.info('You need to login to add to favorites'); } this.props.addToFavorites(this.props.match.params.tutorial); message.success('Tutorial added to favorites'); this.props.getUserProfile(); setTimeout(() => this.props.clearMessage(), 3000); }
addUpvote() { if (!this.props.auth.authenticated) { return message.info('You need to login to upvote'); } this.props.addUpvote(this.props.tutorial._id); message.success('Upvote Added'); this.props.getUserProfile(); window.location.reload(); setTimeout(() => this.props.clearUpvoteMessage(), 3000); }
addReview() { if (!this.props.auth.authenticated) { return message.info('You need to login to add a review'); } if (this.refs.review.textAreaRef.value.trim() === '') { return message.info('Enter a review'); } const newReview = { review: this.refs.review.textAreaRef.value }; this.props.addReview(this.props.match.params.tutorial, newReview); this.refs.review.textAreaRef.value = ''; }