- Aewol
- 아틀리에 제주명월
- O’sulloc tea museum
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import Routes from '@app/services/Routes'; | |
const AnchorComponent = React.forwardRef(({ url, className, children }, ref) => ( | |
<a ref={ref} className={className} href={url}> | |
{children} | |
</a> | |
)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Explicit types | |
export const useCreateDocumentBookmarkMutation = ( | |
options: UseMutationOptions<UserAlertOld, unknown, CreateDocumentBookmarkArgs> | |
): UseMutationResult<UserAlertOld, unknown, CreateDocumentBookmarkArgs> => | |
useMutation({ | |
mutationFn: params => addDocumentBookmark(params), | |
onSuccess: () => { | |
queryClient.invalidateQueries([queryKeys.documentBookmarks]) | |
}, | |
...options |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return new Promise((resolve, reject) => { | |
superagent | |
.post(params.url) | |
.auth(params.auth.username, params.auth.password) | |
.send(params.payload) | |
.set('Accept', 'application/json') | |
.end((error, res) => { | |
error ? reject(error) : resolve(res); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const userNotificationSettings = userId => { | |
const targetUser = Meteor.users.findOne({ _id: userId }); | |
return notificationType => channel => { | |
if (typeof userId !== 'string' || | |
typeof notificationType !== 'string' || | |
typeof channel !== 'string') { | |
throw new Meteor.Error('All args must be of type string'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ActivityView.js | |
notificationSender(notificationTypes.USER_UNJOINED_ACTIVITY_USER, { | |
payload: { activity }, | |
sender: userId | |
}); | |
notificationSender(notificationTypes.USER_UNJOINED_ACTIVITY_COACH, { | |
payload: { activityId: activity._id }, | |
sender: userId, | |
reciever: activity.coachId |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Object assign | |
const someObject = { | |
prop1: '123', | |
prop2: '1234, | |
}; | |
const newObj = Object.assign({}, someObject, { prop1: '1337' }); | |
const newObj2 = { ...someObject, prop1: '1337' }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ReactDOM from 'react-dom'; | |
someMethod() { | |
const elementHeight = ReactDOM.findDOMNode(this.refs.refName).offsetHeight; | |
} | |
render() { | |
return ( | |
<div ref="refName">Some element</div> | |
) |