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
let productsListsMasonries = []; | |
const initProductsListsMasonries = () => { | |
const masonryOptions = { | |
itemSelector: '.products-list__product-card', | |
columnWidth: '.products-list__grid-sizer', | |
percentPosition: true, | |
gutter: getWindowOuterWidth() >= 768 ? 80 : 40, | |
}; |
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 Markup = require('telegraf/markup'); | |
const { ACTION_NAMES } = require('../constants'); | |
const generatePostKeyboard = (id, removeCaption) => Markup.inlineKeyboard([ | |
[ | |
removeCaption ? | |
Markup.callbackButton('🖍 Remove caption', `${ACTION_NAMES.remove_post_caption.string}_${id}`) | |
: | |
Markup.callbackButton('✏️ Return caption', `${ACTION_NAMES.return_post_caption.string}_${id}`), |
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 { Post } = require('../models'); | |
const { generatePostKeyboard } = require('../keyboards'); | |
const { bot } = require('../bot'); | |
const { CHANNELS_INFO, ACTION_NAMES, IS_PRODUCTION, DEVELOPMENT_GROUP_ID } = require('../constants'); | |
const setUpRemovePostCaptionAction = () => { | |
bot.action(ACTION_NAMES.remove_post_caption.regexp, (context) => { | |
const id = context.match[1]; | |
const callbackQueryId = context.update.callback_query.id; |
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 ACTION_NAMES = { | |
approve_post: { | |
regexp: /a_p_(.+)/, | |
string: 'a_p' | |
}, | |
dismiss_post: { | |
regexp: /d_p_(.+)/, | |
string: 'd_p' | |
}, | |
approve_post_confirmation: { |
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
bot.telegram.sendVideo('', '', { | |
reply_markup: { | |
inline_keyboard: [ | |
[ | |
{ | |
text: 'Remove caption', | |
callback_data: `remove_post_caption_${id}`, | |
}, | |
], | |
[ |
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 path = require('path'); | |
const UglifyJsPlugin = require('uglify-js-plugin'); | |
module.exports = { | |
target: 'node', | |
mode: 'production', | |
entry: { |
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
telegram.getUserProfilePhotos(user.id, 0, 1).then((response) => { | |
const photos = response.photos; | |
const photo = photos[0]; | |
const largePhoto = photo[2]; | |
telegram.getFileLink(largePhoto.file_id).then((avatarLink) => { | |
axios.get(avatarLink).then((avatar) => { | |
const form = new FormData(); | |
form.append('data', new Buffer.from(avatar.data), { | |
filename: 'example.jpg', |
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
// post options | |
const options = { | |
reply_markup: { | |
inline_keyboard: [ | |
[ | |
{ | |
text: 'Remove caption', | |
callback_data: 'remove_post_caption', | |
}, | |
], |
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 * as React from "react"; | |
import { PropertyControls, ControlType } from "framer"; | |
import Button from "@material-ui/core/Button"; | |
import Icon from "@material-ui/core/Icon"; | |
type Props = { | |
text: string; | |
height: number; | |
width: number; | |
color: any; |
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
module.exports = { | |
outputDir: 'wwwroot', | |
devServer: { | |
proxy: 'http://localhost:5000', | |
}, | |
lintOnSave: false, | |
chainWebpack: (config) => { | |
const svgRule = config.module.rule('svg'); | |
svgRule.uses.clear(); |