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 Uploady from "@rpldy/uploady"; | |
| import UploadWithProgressPreview from "./UploadWithProgressPreview"; | |
| const App = > () { | |
| return ( | |
| <Uploady | |
| destination={{ url: "[upload-url]" }} | |
| > | |
| <div className="App"> | |
| <h1>Hello React Uploady</h1> |
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 Uploady from "@rpldy/uploady"; | |
| const App = > () { | |
| return ( | |
| <Uploady | |
| destination={{ url: "[upload-url]" }} | |
| > | |
| <div className="App"> | |
| <h1>Hello React Uploady</h1> | |
| <UploadWithProgressPreview /> |
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 Uploady from "@rpldy/uploady"; | |
| import UploadButton from "@rpldy/upload-button"; | |
| const MyApp = () => ( | |
| <Uploady destination={{url: "https://my-server.com/upload"}}> | |
| <UploadButton/> | |
| </Uploady> | |
| ); |
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 { isFunction } from "lodash"; | |
| import { mount } from "enzyme"; | |
| export default (hook, props) => { | |
| let wrapper, hookResult, hookParams, error; | |
| if (isFunction(props)) { | |
| hookParams = props; | |
| props = {}; |
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 {getResponsiveAttributes} from "../getResponsiveAttributes"; | |
| const Image = ({publidId}) => { | |
| const transformation = [{ | |
| quality: "auto", | |
| fetchFormat: "auto", | |
| dpr: 2, | |
| },]; | |
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 NetlifyCmsWidgetMarkdown from "netlify-cms-widget-markdown"; | |
| const name = "rtlmarkdown"; | |
| const PreviewComponent = NetlifyCmsWidgetMarkdown.previewComponent; | |
| const OrgControlComponent = NetlifyCmsWidgetMarkdown.controlComponent; | |
| const ControlComponent = React.forwardRef((props, ref) => { | |
| return <div dir="rtl"> |
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, { useRef, useLayoutEffect } from "react"; | |
| import { StyleSheetManager } from "styled-components"; | |
| import PreviewContext from "./PreviewContext"; | |
| const WithPreviewContext = ({ children }) => | |
| <PreviewContext.Provider value={true}> | |
| <main> | |
| {children} | |
| </main> | |
| </PreviewContext.Provider>; |
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, { useContext, useState, } from "react"; | |
| import { navigate } from "gatsby"; | |
| import styled from "styled-components"; | |
| import { Box, Button } from "grommet"; | |
| import ReCaptcha from "react-google-recaptcha"; | |
| import { NotificationContext } from "../Notifications/NotificationProvider"; | |
| const isDev = process.env.NODE_ENV === "development"; | |
| const onRegisterSuccess = (navUrl) => { |
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
| onItemsRendered = (gridData: Object) => { | |
| const {useOverscanForLoading} = this.props; //default is true | |
| const { | |
| visibleRowStartIndex, | |
| visibleRowStopIndex, | |
| visibleColumnStopIndex, | |
| overscanRowStartIndex, | |
| overscanRowStopIndex, | |
| overscanColumnStopIndex |
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 addFrameConsciousEvent = (obj, event, handler) => { //adapted from: https://developer.mozilla.org/en-US/docs/Web/Events/resize#Example | |
| let isRunning = false; | |
| const handlerWrapper = (e)=> { | |
| if (!isRunning){ | |
| isRunning = true; | |
| requestAnimationFrame(()=>{ //throttling so only execute when the browser is ready to re-render | |
| isRunning = false; | |
| handler(e); | |
| }) |