This file contains hidden or 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
| [@bs.deriving abstract] | |
| type context = { | |
| mutable font: string, | |
| mutable fillStyle: string, | |
| }; | |
| [@bs.deriving abstract] | |
| type measurement = {width: float}; | |
| [@bs.send] |
This file contains hidden or 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
| let continue = left +. context->measureText(matching)->widthGet; | |
| context->fillStyleSet(matchColor); | |
| context->fillText(matching, left, bottom); | |
| context->fillStyleSet(color); | |
| context->fillText(rest, continue, bottom); |
This file contains hidden or 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
| let (captured, falling) = | |
| List.partition(w => w.text == ui.input(), state.words); | |
| let (crashed, remaining) = List.partition(w => w.y > ui.height, falling); | |
| let newWords = | |
| remaining |> List.map(word => {...word, y: word.y +. word.velocity}); |
This file contains hidden or 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
| sam@sam-ThinkPad-T480s:~/till-react-electron$ manifold alias till-macabre-light-brown-cylinder | |
| ✔ Resource: till-macabre-light-brown-cylinder (till-macabre-light-brown-cylinder) | |
| Choose from one of Till's credentials | |
| ✔ API_KEY | |
| Creating alias for `API_KEY` | |
| ✔ Alias Name: REACT_APP_TILL_API_KEY | |
| You have aliased till-macabre-light-brown-cylinder's config key `API_KEY` to `REACT_APP_TILL_API_KEY`. | |
| sam@sam-ThinkPad-T480s:~/till-react-electron$ manifold alias till-macabre-light-brown-cylinder | |
| ✔ Resource: till-macabre-light-brown-cylinder (till-macabre-light-brown-cylinder) |
This file contains hidden or 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, { Component } from "react"; | |
| import phone from "phone"; | |
| import { sendMessage } from "./api"; | |
| function isValidPhone(str) { | |
| return phone(str).length > 0; | |
| } | |
| export default class Send extends Component { | |
| state = { |
This file contains hidden or 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 apiUrl(endpoint) { | |
| const url = new URL(`https://platform.tillmobile.com/api/${endpoint}`); | |
| url.searchParams.set("username", process.env.REACT_APP_TILL_USERNAME); | |
| url.searchParams.set("api_key", process.env.REACT_APP_TILL_API_KEY); | |
| return url; | |
| } | |
| function postData(url, data) { | |
| return fetch(url, { |
This file contains hidden or 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
| export function apiUrl(endpoint) { | |
| const url = new URL(`https://platform.tillmobile.com/api/${endpoint}`); | |
| url.searchParams.set("username", process.env.REACT_APP_TILL_USERNAME); | |
| url.searchParams.set("api_key", process.env.REACT_APP_TILL_API_KEY); | |
| return url; | |
| } |
This file contains hidden or 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 postData(url, data) { | |
| return fetch(url, { | |
| method: "POST", | |
| headers: { | |
| "Content-Type": "application/json; charset=utf-8" | |
| }, | |
| body: JSON.stringify(data) | |
| }); | |
| } |
This file contains hidden or 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 { IdentityConsumer } from "./identity"; | |
| import Login from "./login"; | |
| export default function Home() { | |
| return ( | |
| <IdentityConsumer> | |
| {ctx => { | |
| if (ctx.user) { |
This file contains hidden or 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
| describe("Greeting", () => { | |
| describe("When logged in", () => { | |
| before(() => { | |
| cy.login(process.env.TEST_SINGLE_EMAIL, process.env.TEST_SINGLE_PASSWORD); | |
| }); | |
| it("displays the greeting", () => { | |
| cy.visit("/"); | |
| cy | |
| .get('h1[data-cy="user"]') |