Skip to content

Instantly share code, notes, and snippets.

View rjerue's full-sized avatar

Ryan Jerue rjerue

View GitHub Profile
@rjerue
rjerue / Popover.js
Last active January 27, 2021 02:07
React Native Web Popovers
// web
import P, { ArrowContainer } from 'react-tiny-popover'
import React from 'react'
export default ({
visible = false,
position,
onClose,
children,
content = null,
@rjerue
rjerue / iframe.tsx
Created April 16, 2020 22:36
Detect if iframe is clicked
import React from 'react';
interface IFrameProps {
url: string;
onClick?: () => void;
}
const IFrameComponent: React.FC<IFrameProps> = ({ url, onClick }) => {
const ref = React.useRef<HTMLIFrameElement | null>(null);
React.useEffect(() => {
function decode(input) {
return input && typeof input === 'object'
? Object.entries(input).reduce(async (accum, [key, value]) => {
const [resolvedAccum, resolvedValue] = await Promise.all([accum, value])
let decodedValue = resolvedValue
if (Array.isArray(resolvedValue)) {
decodedValue = await Promise.all(resolvedValue.map(decode))
}
if (resolvedValue && typeof resolvedValue === 'object') {
@rjerue
rjerue / App.js
Created November 24, 2018 23:48
leaflet-div-icon
import React, { Component } from 'react';
import { Map, TileLayer, Marker, Popup } from 'react-leaflet';
import DivIcon from './div-icon';
export default class UserLocationExample extends Component {
constructor(props) {
super(props);
this.mapRef = React.createRef()
this.state = {
hasLocation: true,
latlng: {

Keybase proof

I hereby claim:

  • I am rjerue on github.
  • I am rjerue (https://keybase.io/rjerue) on keybase.
  • I have a public key whose fingerprint is 7660 6140 925D C768 861D 266B 75CA 4841 43FB 6220

To claim this, I am signing this object: