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
<form> | |
<input type="radio" id="answer-1" value="answer-1"> | |
<label for="answer-1">My answer 1</label> | |
<input type="radio" id="answer-2" value="answer-2"> | |
<label for="answer-2">My answer 2</label> | |
</form> |
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 leftText = "Hello" | |
// using props.chilren | |
const Button = (props) => ( | |
<div> | |
{props.children} | |
</div> | |
) | |
<Button> |
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
// Gets all design components exported from the canvas | |
export default function useDesignComponents() { | |
let canvas = require('../canvas.tsx') | |
let components = [] | |
for (const key in canvas) { | |
if (!key.endsWith('__')) { | |
components = [...components, { | |
key: key, |
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
/** | |
* @public | |
* Returns all design components | |
* */ | |
export default function useCanvas() { | |
let components = null | |
let canvas = null | |
try { | |
// @ts-ignore |
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 * as React from "react" | |
import { useState } from "react" | |
function CodeComponent(props) { | |
const [color, setColor] = useState("blue") | |
return ( | |
<Frame | |
background={color} | |
onTap={() = > { |
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 { Data, Override } from "framer" | |
const state = Data({ | |
doubleTapIndex: 0, | |
doubleTapTimer: setTimeout(null, null), | |
longPress: false, | |
longPressTimer: setTimeout(null, null), | |
}) | |
export function doubleTap(): Override { |
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
/** | |
* VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units | |
* | |
* To overcome this, create media queries that target the width, height, and orientation of iOS devices. | |
* It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing | |
* the height of element `.foo` —which is a full width and height cover image. | |
* | |
* iOS Resolution Quick Reference: http://www.iosres.com/ | |
*/ | |
OlderNewer