// @flow import 'scss/component/_sticker-selector.scss'; import { FREE_GLOBAL_STICKERS, PAID_GLOBAL_STICKERS } from 'constants/stickers'; import * as ICONS from 'constants/icons'; import Button from 'component/button'; import CreditAmount from 'component/common/credit-amount'; import OptimizedImage from 'component/optimizedImage'; import React from 'react'; const buildStickerSideLink = (section: string, icon: string) => ({ section, icon }); const STICKER_SIDE_LINKS = [ buildStickerSideLink(__('Free'), ICONS.TAG), buildStickerSideLink(__('Tips'), ICONS.FINANCE), // Future work may include Channel, Subscriptions, ... ]; type Props = { claimIsMine: boolean, onSelect: (any) => void }; export default function StickerSelector(props: Props) { const { claimIsMine, onSelect } = props; function scrollToStickerSection(section: string) { const listBodyEl = document.querySelector('.stickerSelector__listBody'); const sectionToScroll = document.getElementById(section); if (listBodyEl && sectionToScroll) { // $FlowFixMe listBodyEl.scrollTo({ top: sectionToScroll.offsetTop - sectionToScroll.getBoundingClientRect().height * 2, behavior: 'smooth', }); } } const getListRow = (rowTitle: string, rowStickers: any) => (