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
function getRecipeSchema(schema) { | |
if(!schema) { | |
const nodes = document.querySelectorAll('script[type="application/ld+json"]'); | |
let returnData; | |
nodes.forEach(n => { | |
const childSchema = JSON.parse(n.innerText); | |
const data = getRecipeSchema(childSchema); | |
if(data) returnData = data; | |
}); | |
return returnData; |
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 { Modal } from "src/components"; | |
const CrudPanel = ({ key, data, tableFields, entryFields, operations }) => { | |
const [isModalVisible, setIsModalVisible] = React.useState(false); | |
const openModal = () => setIsModalVisible(true); | |
const closeModal = () => setIsModalVisible(false); | |
return ( |
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 firebase, { auth } from "src/firebase"; | |
const App = () => { | |
const [phoneNumber, setPhoneNumber] = React.useState(""); | |
const [code, setCode] = React.useState(""); | |
const [user, setUser] = React.useState(null); | |
React.useEffect(() => { | |
// ======= |
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
// App.js | |
const App = () => | |
<Context.Provider value={this.state.context}> | |
<AppBar onPressLogoutButton={this.logout} /> | |
<View style={{paddingTop: 64}}> | |
<Router> | |
<Route exact path="/" exact component={Home} /> | |
</Router> | |
</View> |
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 globals from '../../globals'; | |
import axios from 'axios'; | |
import Loading from '../Loading/Loading'; | |
import VMasker from 'vanilla-masker'; | |
class Form extends React.Component { | |
constructor(props) { | |
super(props); | |
this.handleSubmit = this.handleSubmit.bind(this); |
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
// Some random page example | |
import Pixel from '../components/Pixel' | |
export default () => | |
<div> | |
<Pixel name='FACEBOOK_PIXEL_1' /> | |
</div> |
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' | |
export default () => | |
<React.Fragment> | |
<script dangerouslySetInnerHTML={{ __html: `!function(f,b,e,v,n,t,s) | |
{if(f.fbq)return;n=f.fbq=function(){n.callMethod? | |
n.callMethod.apply(n,arguments):n.queue.push(arguments)}; | |
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; | |
n.queue=[];t=b.createElement(e);t.async=!0; | |
t.src=v;s=b.getElementsByTagName(e)[0]; |
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
<!-- Facebook Pixel Code --> | |
<script> | |
!function(f,b,e,v,n,t,s) | |
{if(f.fbq)return;n=f.fbq=function(){n.callMethod? | |
n.callMethod.apply(n,arguments):n.queue.push(arguments)}; | |
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; | |
n.queue=[];t=b.createElement(e);t.async=!0; | |
t.src=v;s=b.getElementsByTagName(e)[0]; | |
s.parentNode.insertBefore(t,s)}(window, document,'script', | |
'https://connect.facebook.net/en_US/fbevents.js'); |
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 Head from 'next/head' | |
import FACEBOOK_PIXEL_1 from './facebook/pixel-1' | |
export default ({name}) => { | |
return( | |
<Head> | |
{name === 'FACEBOOK_PIXEL_1' && <FACEBOOK_PIXEL_1 />} |
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
<View style={{display: this.state.visible?'flex':'none', backgroundColor: 'rgba(0,0,0,0.5)', position: 'absolute', top: 0, left: 0, height, width}}> | |
<Modal animationType={'slide'} transparent={true} visible={this.state.visible}> | |
<TouchableWithoutFeedback onPress={() => this.toggleActionSheet()}> | |
<View> | |
<TouchableWithoutFeedback> | |
<View style={{backgroundColor: '#fff', padding: 16, marginTop: '100%', height: '50%'}}> | |
<Text style={{height: 20}}>Title</Text> | |
// Content goes here... | |
</View> | |
</TouchableWithoutFeedback> |
NewerOlder