Symbol Menu: Show scrollbar on non-touch devices

This commit is contained in:
Alexander Zinchuk 2021-07-09 20:01:44 +03:00
parent dd4ef5202d
commit 251aa22151
3 changed files with 15 additions and 4 deletions

View File

@ -6,8 +6,8 @@ import { withGlobal } from '../../../lib/teact/teactn';
import { GlobalState } from '../../../global/types';
import { MENU_TRANSITION_DURATION } from '../../../config';
import { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../../util/environment';
import { MEMO_EMPTY_ARRAY } from '../../../util/memo';
import { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment';
import {
EmojiModule,
EmojiRawData,
@ -197,7 +197,10 @@ const EmojiPicker: FC<OwnProps & StateProps> = ({
<div ref={headerRef} className="EmojiPicker-header" dir={lang.isRtl ? 'rtl' : ''}>
{allCategories.map(renderCategoryButton)}
</div>
<div ref={containerRef} className="EmojiPicker-main no-selection no-scrollbar">
<div
ref={containerRef}
className={buildClassName('EmojiPicker-main no-selection', IS_TOUCH_ENV ? 'no-scrollbar' : 'custom-scroll')}
>
{allCategories.map((category, i) => (
<EmojiCategory
category={category}

View File

@ -7,6 +7,7 @@ import { GlobalActions } from '../../../global/types';
import { ApiVideo } from '../../../api/types';
import { SLIDE_TRANSITION_DURATION } from '../../../config';
import { IS_TOUCH_ENV } from '../../../util/environment';
import buildClassName from '../../../util/buildClassName';
import { pick } from '../../../util/iteratees';
import { useIntersectionObserver } from '../../../hooks/useIntersectionObserver';
@ -56,7 +57,10 @@ const GifPicker: FC<OwnProps & StateProps & DispatchProps> = ({
const canRenderContents = useAsyncRendering([], SLIDE_TRANSITION_DURATION);
return (
<div ref={containerRef} className={buildClassName('GifPicker no-scrollbar', className)}>
<div
ref={containerRef}
className={buildClassName('GifPicker', className, IS_TOUCH_ENV ? 'no-scrollbar' : 'custom-scroll')}
>
{!canSendGifs ? (
<div className="picker-disabled">Sending GIFs is not allowed in this chat.</div>
) : canRenderContents && savedGifs && savedGifs.length ? (

View File

@ -8,6 +8,7 @@ import { ApiStickerSet, ApiSticker } from '../../../api/types';
import { StickerSetOrRecent } from '../../../types';
import { SLIDE_TRANSITION_DURATION, STICKER_SIZE_PICKER_HEADER } from '../../../config';
import { IS_TOUCH_ENV } from '../../../util/environment';
import { MEMO_EMPTY_ARRAY } from '../../../util/memo';
import fastSmoothScroll from '../../../util/fastSmoothScroll';
import buildClassName from '../../../util/buildClassName';
@ -257,7 +258,10 @@ const StickerPicker: FC<OwnProps & StateProps & DispatchProps> = ({
>
{allSets.map(renderCover)}
</div>
<div ref={containerRef} className="StickerPicker-main no-scrollbar">
<div
ref={containerRef}
className={buildClassName('StickerPicker-main no-selection', IS_TOUCH_ENV ? 'no-scrollbar' : 'custom-scroll')}
>
{allSets.map((stickerSet, i) => (
<StickerSet
key={stickerSet.id}