Last major update: 25.08.2020
- Что такое авторизация/аутентификация
- Где хранить токены
- Как ставить куки ?
- Процесс логина
- Процесс рефреш токенов
- Кража токенов/Механизм контроля токенов
{ | |
"data": { | |
"unstable_mc_joints": [ | |
{ | |
"unit": { | |
"version": "3.0t", | |
"alt": "2", | |
"messages": [ | |
{ | |
"app": "payment", |
const my_share = inputRedeem * 10 ** reserve_asset_decimals / fund_state.shares_supply; | |
const reserve_amount = Math.floor(my_share * fund_balance?.[reserve_asset]); | |
const t1_amount = Math.floor(my_share * p1Balance); | |
const exchange = t1_amount && $get_exchange_result(obj); | |
const you_get_in_full_units = (reserve_amount - exchange.reserve_needed - (reserve_asset === "base" ? 4000 : 0)); | |
const you_get = you_get_in_full_units / 10 ** reserve_asset_decimals; | |
const fee_percent = (exchange.fee / you_get_in_full_units) * 100; |
EXTEND_ESLINT=true |
{ | |
base_aa: 'GGLDAQJOMIACSC3WSF7YI47OERBN3LYK', | |
params: { | |
oracle: 'F4KHJUCLJKY4JV7M5F754LAJX4EB7M4N', | |
overcollateralization_ratio: 1.5, | |
max_loan_value_in_underlying: 10000000, | |
decimals: 2, | |
auction_period: 3000, | |
liquidation_ratio: 1.3, | |
feed_name: 'GBYTE_USD', |
import { useState } from "react"; | |
export const useLocalStorage = (key, initialValue) => { | |
const [storedValue, setStoredValue] = useState(() => { | |
try { | |
const item = window.localStorage.getItem(key); | |
return item ? JSON.parse(item) : initialValue; | |
} catch (error) { | |
console.log(error); | |
return initialValue; |
import { useLayoutEffect, useState } from "react"; | |
export const useWindowSize = () => { | |
const [size, setSize] = useState([0, 0]); | |
useLayoutEffect(() => { | |
function updateSize() { | |
setSize([window.innerWidth, window.innerHeight]); | |
} | |
window.addEventListener("resize", updateSize); | |
updateSize(); |
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
import {graphql, QueryRenderer, createPaginationContainer} from 'react-relay'; | |
import {Button} from 'react-bootstrap'; | |
import environment from '@/environment'; | |
import PageBar from '@/components/PageBar'; | |
import Loading from '@/components/Loading'; | |
import OrderTableRelay from '@/components/OrderTableRelay'; |
.menu__item_active:after { | |
content: ""; | |
display: block; | |
width: 100%; | |
height: 2px; | |
background: url(../img/border.svg) no-repeat; | |
position: absolute; | |
background-size: cover; | |
left: 0; | |
bottom: -5px; |
##Погодное одностраничное веб-приложение
(!) Данные можно взять с сайта openweathermap.org или с любого другого сервиса.
(!) Обязательно использовать react.js и redux.
Приложение должно уметь: