- React is the V in MVP (Model-View-Controller)
- It's architecture is similar to the Web Components standard
- Simple said: You can create your "own html tags" like
- React then reassembles your components into the DOM and manages the expensive DOM updates (throught diffing a shadow DOM)
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
license: gpl-3.0 |
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 { gql, useQuery } from '@apollo/client'; | |
import { useWeb3React } from '@web3-react/core'; | |
import { useEffect, useState } from 'react'; | |
import { useAppContext } from '../components/AppContextWrapper'; | |
const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); | |
export const useLastMints = () => { | |
const [eventHandlerBound, setEventHandlerBound] = useState(false); | |
const { library } = useWeb3React(); |
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
function makeJSON() public view virtual returns (string memory) { | |
return | |
string( | |
abi.encodePacked( | |
"data:application/json;base64,", | |
Base64.encode( | |
abi.encodePacked( | |
'{"name": "Bla #', | |
tokenId.toString(), |
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
let timeout; | |
const refresh = () => { | |
window.clearTimeout(timeout); | |
// do query | |
timeout = window.setTimeout(() => { | |
refresh(); | |
}, 10 * 1000); | |
}; |
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 { Address, log } from "@graphprotocol/graph-ts"; | |
import { | |
ImplementationAdded, | |
} from "../generated/CallProxy/CallProxy"; | |
import { | |
ProxyEvent, | |
} from "../generated/schema"; |
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
0x546457bbDdf5e09929399768AB5a9D588Cb0334d |
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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.7.3; | |
import '@openzeppelin/contracts/access/Ownable.sol'; | |
import '@openzeppelin/contracts/math/SafeMath.sol'; | |
import '@openzeppelin/contracts/utils/Context.sol'; | |
import '@openzeppelin/contracts/token/ERC721/ERC721.sol'; | |
import 'hardhat/console.sol'; |
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 React, { useEffect, useContext } from 'react'; | |
import Router from 'next/router'; | |
export const ScrollPositionContext = React.createContext({ | |
triggerScroll: () => null, | |
}); | |
export const useScrollPosition = () => useContext(ScrollPositionContext); | |
let routerBound = false; |
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
// React imports | |
import React from 'react'; | |
const Clock = (props) => { | |
const center = { | |
x: 15, | |
y: 15, | |
}; | |
const lengths = { |
NewerOlder