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
/** | |
* prefix method reduced from StyleFix 1.0.2 | |
* @author Lea Verou | |
* MIT license | |
*/ | |
var prefix = (function() { | |
if (!window.getComputedStyle) return ''; | |
var prefixes = {}, | |
properties = [], |
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
// Backfill deprecated MarkerImage | |
function MarkerImage(url, size, origin, anchor, scaledSize) | |
{ | |
if (console && console.warn) | |
console.warn("google.maps.MarkerImage is deprecated. Use a vanilla JS Object."); | |
this.anchor = anchor; | |
this.origin = origin; | |
this.scaledSize = scaledSize; | |
this.size = size; | |
this.url = url; |
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
/*---------------/ | |
/ simple reset / | |
/---------------*/ | |
html, body, ul, ol, li, form, fieldset, legend { | |
margin: 0; | |
padding: 0; | |
} | |
li { list-style: none; } | |
body { |
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
@font-face { | |
font-family: 'Avenir Variable'; | |
src: url('/anv/anv-roman-var.woff2') format('woff2-variations'); | |
src: url('/anv/anv-roman-var.woff2') format('woff2' supports variations); | |
font-weight: 1 999; | |
} | |
@font-face { | |
font-family: 'Avenir Static'; | |
src: url('/anv/anv-medium.woff') format('woff'); |
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
// Hook, basic use, everything in one component | |
const MyAccount = () => { | |
const { user, isLoggedIn } = useTracker(() => { | |
const user = Meteor.user() | |
const userId = Meteor.userId() | |
return { | |
user, | |
userId, | |
isLoggedIn: !!userId | |
} |
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 { useTracker } from 'meteor/react-meteor-data' | |
// We can easily make old style HOCs out of the hooks | |
const withUser = (Component) => (props) => { | |
const accountProps = useAccount() | |
return <Component {...props} {...accountProps} /> | |
} | |
const withPage = (Component) => (props) => ( | |
const pageProps = usePage(props.pageId) | |
return <Component {...props} {...pageProps} /> |
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 { useTracker } from 'meteor/react-meteor-data' | |
// Create a reusable hook | |
const usePage = (pageId) => useTracker(() => { | |
// The publication must also be secure | |
const subscription = Meteor.subscribe('page', pageId) | |
const page = Pages.findOne({ _id: pageId }) | |
return { | |
page, | |
isLoading: !subscription.ready() |
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 { withTracker } from 'meteor/react-meteor-data' | |
// Create a reusable hook | |
const withAccount = withTracker((props) => { | |
const user = Meteor.user() | |
const userId = Meteor.userId() | |
return { | |
user, | |
userId, | |
isLoggedIn: !!userId |
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 { useTracker } from 'meteor/react-meteor-data' | |
// Create a reusable hook | |
const useAccount = () => useTracker(() => { | |
const user = Meteor.user() | |
const userId = Meteor.userId() | |
return { | |
user, | |
userId, | |
isLoggedIn: !!userId |
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 { useTracker } from 'meteor/react-meteor-data' | |
// Hook, basic use, everything in one component | |
const MyProtectedPage = (pageId) => { | |
const { user, isLoggedIn, page } = useTracker(() => { | |
// The publication must also be secure | |
const subscription = Meteor.subscribe('page', pageId) | |
const page = Pages.findOne({ _id: pageId }) | |
const user = Meteor.user() | |
const userId = Meteor.userId() |
OlderNewer