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
<button onClick={() => { | |
window.ethereum.request({ | |
method: 'wallet_addEthereumChain', | |
params: [ | |
{ | |
chainId: '0x1a4', | |
chainName: 'SanR L2 Chain', | |
nativeCurrency: {name: 'SAN', symbol: 'SAN', decimals: 18}, | |
rpcUrls: ['https://l2.144.76.93.41.nip.io/'], | |
blockExplorerUrls: ['http://144.76.93.41:4001/'], |
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 getRandoms() { | |
const examples = 100; | |
for (var i = 0; i < examples; i++) { | |
const arr = Array(getRandomInt(1, 6)).fill(null); | |
for (var j = 0; j < arr.length; j++) { | |
arr[j] = getRandomInt(-50, 150); | |
} | |
console.log(`[${arr.map(a => a + '%').join(', ')}] => `, perf(arr).toFixed(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
.map((u, idx) => `${idx + 1}. ${u.address} (${u.username})`).join('\n') |
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 StakedModal() { | |
const {modal} = ModalContext.useContext(['modal']); | |
const [{ | |
modals, | |
}, ss] = useStateReducer({ | |
modals: [], | |
}); | |
const create = () => { |
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
This post links my 3Box profile to my Github account! Web3 social profiles by 3Box. | |
✅ did:muport:QmcVVXoRrkYnYtMAwPLgGWSQgWqFVYkGcxsJco3yfBj56u ✅ | |
Create your profile today to start building social connection and trust online at https://3Box.io/ |
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 MAX_WIDTH = 1200; | |
const MIN_WIDTH = 320; | |
export default function getSize(windowInnerWidth, ...values) { | |
if (values.some(({x1: x11, x2: x12}, idx1) => { | |
return values.some(({x1: x21, x2: x22}, idx2) => { | |
if (idx1 === idx2) { | |
return false; | |
} | |
const max1 = Math.max(x11, x12); |
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, { | |
useEffect, | |
} from 'react'; | |
import styled, {css} from 'styled-components'; | |
import {forbidExtraProps} from 'airbnb-prop-types'; | |
import {ButtonContainer, SelectAssetModal} from 'App/dumb'; | |
import {func, string, object} from 'prop-types'; | |
import {withContext} from 'withContext'; | |
import Values from './Values'; | |
import payFeeAssetsRaw from './payFeeAssetsRaw'; |
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, {memo, useContext} from 'react'; | |
const Context = React.createContext(); | |
export function withContext(Component, keys) { | |
Component = memo(Component); | |
return memo(function(props) { | |
let state = useContext(Context); | |
if (process.env.NODE_ENV !== 'production') { | |
keys.forEach(key => { | |
if (props.hasOwnProperty(key) && state.hasOwnProperty(key)) { |
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 styled, {css} from 'styled-components'; | |
import {forbidExtraProps, explicitNull, or} from 'airbnb-prop-types'; | |
import getContext from 'getContext'; | |
import {onlyUpdateForKeys} from 'recompose'; | |
import {string, object, number, func, array} from 'prop-types'; | |
import {Link, ButtonContainer, BounceSpinner, ReconnectOverlay} from 'App/dumb'; | |
import SelectAssetModal from './SelectAssetModal'; | |
import {t, formatToTwoNonZeroDecimals, webConnector, convertToEth} from 'App/utils'; | |
import trustedAssetsRaw from './trustedAssetsRaw'; |
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 styled from 'styled-components'; | |
import {forbidExtraProps} from 'airbnb-prop-types'; | |
const Wr = styled.div` | |
`; | |
const Container = styled.div` | |
max-width: 1200px; | |
padding: 0 15px; |