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
const TELEGRAM_BOT_TOKEN = '110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw'; // https://core.telegram.org/bots#creating-a-new-bot | |
export const verifyTelegramWebAppData = async (telegramInitData: string): boolean => { | |
// The data is a query string, which is composed of a series of field-value pairs. | |
const encoded = decodeURIComponent(telegramInitData); | |
// HMAC-SHA-256 signature of the bot's token with the constant string WebAppData used as a key. | |
const secret = crypto |
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
export class UserActionsClass { | |
public async requestProfile(): void { | |
const result = await api.send('profile', 'user', {}); | |
this.updateProfile(); | |
} | |
private updateProfile(data) { | |
// convert data to userStore acceptable view | |
newProfile = ... | |
// |
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
{"lastUpload":"2019-02-25T16:00:03.584Z","extensionVersion":"v3.2.5"} |
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
// @flow | |
import React, { PureComponent } from 'react'; | |
// Helpers | |
import classNameBind from 'classnames/bind'; | |
import { upperFirst } from 'utils'; | |
import s from './TextField.pcss'; | |
const cn = classNameBind.bind(s); |
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 from 'react'; | |
import PropTypes from 'prop-types'; | |
import { connect } from 'react-redux'; | |
import { withRouter } from 'react-router-dom'; | |
import * as routes from 'config/routes'; | |
import { ACTIONS as authActions } from 'redux/modules/auth'; | |
import { ACTIONS as sitesActions, TYPES as SITES_TYPES } from 'redux/modules/sites'; | |
import { Dropdown, Menu, Avatar, Select, Tooltip } from 'antd'; |
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 AppPropTypes from 'common/types/AppPropTypes'; | |
import styled, { css } from 'styled-components'; | |
import { applyIfNotNull } from 'styles/utils'; | |
const sizeMap = ['Zero', 'Xs', 'Sm', 'Md', 'Bg', 'Lg']; | |
const applySize = (size, inverse, theme) => { | |
return applyIfNotNull(size, () => (`${inverse ? '-' : ''}${theme[`margin${sizeMap[size]}`]}`)); | |
}; |
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
/** | |
* Array must containt at least nessesary values | |
* @param {Number} [count=1] nessesary values in array | |
* @param {String} [message='You must select at least one of the options'] error message | |
* @return {?String} | |
*/ | |
const atLeast = ( | |
count = 1, | |
message = 'You must select at least one of the options') => | |
(value) => { |
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
/** | |
* Middleware for syncing actions between tabs | |
*/ | |
export default () => (next) => (action) => { | |
if (action.sync) { | |
delete action.sync; | |
localStorage.setItem(`${__PROJECT_NAME__}.storeSync`, JSON.stringify({ | |
action, | |
_hash: Date.now(), | |
})); |
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 TYPES from './types'; | |
// Fetch hypothesis | |
export const fetchStart = ({ id, segment }) => ({ | |
type: TYPES.fetching, | |
payload: { | |
id, | |
segment, | |
}, | |
}); |
NewerOlder