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
| // Select the file input and add an onchange handler | |
| const fileInput = document.querySelector("input[type='file']"); | |
| imageUpload.onchange = async e => { | |
| const files = e.target.files; | |
| const fileToUpload = files[0]; | |
| let data = new FormData(); | |
| data.append("file", fileToUpload); | |
| // Send as multipart/form-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 { StoreHandler } from "../StoreHandler"; | |
| import { SubscriberHandler } from "../SubscriberHandler"; | |
| import { GiveDotChurchApi } from "../GiveDotChurchApi"; | |
| const createJsonApiStore = () => { | |
| const ApiStoreContext = React.createContext({ | |
| change: 0, | |
| data: () => {}, | |
| methods: () => {}, |
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
| const { loadPath } = require("./loadPath"); | |
| const { setupPage } = require("./setupPage"); | |
| const { | |
| waitForText, | |
| getByText, | |
| getComputedStyles, | |
| } = require("./helpers"); | |
| test("successfully login as org admin", async () => { | |
| const page = await setupPage(global.browser); |
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 throttle from "lodash/throttle"; | |
| class DottedUnderline extends Component { | |
| constructor(...args) { | |
| super(...args); | |
| this.state = { width: null }; | |
| this.attach = this.attach.bind(this); |
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 isEqualWith from "lodash/isEqualWith"; | |
| const shallowEqual = (value, other) => | |
| isEqualWith(value, other, (v, o) => { | |
| for (let key1 in v) { | |
| if (!(key1 in o) || v[key1] !== o[key1]) { | |
| return false; | |
| } | |
| } | |
| for (let key2 in o) { |
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 isEqual from "lodash/isEqual"; | |
| const deepEqual = (a, b) => isEqual(a, b); | |
| exports { deepEqual }; |
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
| // Programmatically loads external scripts: | |
| // | |
| // await loadScript( | |
| // window.document, | |
| // "https://unpkg.com/react@16/umd/react.development.js", | |
| // { onlyLoadOnce: true } | |
| // ); | |
| const defaultOptions = { | |
| timeout: null, |
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
| // Color blending modes: | |
| // | |
| // import { blend } from "blend"; | |
| // | |
| // const blended = blend.overlay("#aaa", "#f00"); | |
| // | |
| // blended === "rgba(187, 8, 8, 1.0)"; | |
| const matchesToRgba = ([a = 1.0, r, g, b], base = 10) => { | |
| return { |
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
| // Watch media queries: | |
| // | |
| // createMediaQueryWatcher({ big: "(min-width: 400px)" }, { | |
| // window, | |
| // onUpdate: (matches) => { | |
| // if (matches.big) { | |
| // console.log("Big matches"); | |
| // } | |
| // } | |
| // }); |
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 getAllSearchParamsFromSearch(search) { | |
| let massagedSearch = search; | |
| if (massagedSearch.charAt(0) === "?") { | |
| massagedSearch = massagedSearch.substring(1); | |
| } | |
| // Filter out the search parameters that have been passed in | |
| return massagedSearch.split("&").map(part => { | |
| return part.split("="); |
OlderNewer