Custom Emoji: Adjust sizes (again) (#2142)
This commit is contained in:
parent
a82fd2dde7
commit
05a9c9993b
@ -8,10 +8,11 @@ import type { ActiveEmojiInteraction } from '../../../global/types';
|
|||||||
import safePlay from '../../../util/safePlay';
|
import safePlay from '../../../util/safePlay';
|
||||||
import { selectLocalAnimatedEmojiEffectByName } from '../../../global/selectors';
|
import { selectLocalAnimatedEmojiEffectByName } from '../../../global/selectors';
|
||||||
import buildStyle from '../../../util/buildStyle';
|
import buildStyle from '../../../util/buildStyle';
|
||||||
|
import { REM } from '../helpers/mediaDimensions';
|
||||||
|
|
||||||
import useMedia from '../../../hooks/useMedia';
|
import useMedia from '../../../hooks/useMedia';
|
||||||
|
|
||||||
const SIZE = 104;
|
const SIZE = 7 * REM;
|
||||||
const INTERACTION_BUNCH_TIME = 1000;
|
const INTERACTION_BUNCH_TIME = 1000;
|
||||||
const MS_DIVIDER = 1000;
|
const MS_DIVIDER = 1000;
|
||||||
const TIME_DEFAULT = 0;
|
const TIME_DEFAULT = 0;
|
||||||
|
|||||||
@ -39,6 +39,7 @@ export function getCustomEmojiSize(maxEmojisInLine?: number): number | undefined
|
|||||||
if (!maxEmojisInLine) return undefined;
|
if (!maxEmojisInLine) return undefined;
|
||||||
|
|
||||||
// Should be the same as in _message-content.scss
|
// Should be the same as in _message-content.scss
|
||||||
if (maxEmojisInLine > EMOJI_SIZES) return REM * 2.25;
|
if (maxEmojisInLine > EMOJI_SIZES) return 2.25 * REM;
|
||||||
return (6 - (maxEmojisInLine * 0.5)) * REM;
|
if (maxEmojisInLine === 1) return 7 * REM;
|
||||||
|
return Math.min(7.5 - (maxEmojisInLine * 0.75), 4) * REM;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,7 +23,6 @@ type OwnProps = {
|
|||||||
customEmojiId: string;
|
customEmojiId: string;
|
||||||
withEffects: boolean;
|
withEffects: boolean;
|
||||||
isOwn?: boolean;
|
isOwn?: boolean;
|
||||||
size?: 'large' | 'medium' | 'small';
|
|
||||||
lastSyncTime?: number;
|
lastSyncTime?: number;
|
||||||
forceLoadPreview?: boolean;
|
forceLoadPreview?: boolean;
|
||||||
messageId?: number;
|
messageId?: number;
|
||||||
|
|||||||
@ -29,7 +29,6 @@ type OwnProps = {
|
|||||||
withEffects: boolean;
|
withEffects: boolean;
|
||||||
isOwn?: boolean;
|
isOwn?: boolean;
|
||||||
observeIntersection?: ObserveFn;
|
observeIntersection?: ObserveFn;
|
||||||
size?: 'large' | 'medium' | 'small';
|
|
||||||
lastSyncTime?: number;
|
lastSyncTime?: number;
|
||||||
forceLoadPreview?: boolean;
|
forceLoadPreview?: boolean;
|
||||||
messageId?: number;
|
messageId?: number;
|
||||||
|
|||||||
@ -738,12 +738,16 @@
|
|||||||
|
|
||||||
@for $i from 1 through 7 {
|
@for $i from 1 through 7 {
|
||||||
&.emoji-only-#{$i} {
|
&.emoji-only-#{$i} {
|
||||||
$size: 6 - ($i * 0.5) + rem;
|
$size: min(7.5 - ($i * 0.75), 4) + rem;
|
||||||
|
|
||||||
--emoji-only-size: #{$size};
|
--emoji-only-size: #{$size};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.emoji-only-1 {
|
||||||
|
--emoji-only-size: 7rem;
|
||||||
|
}
|
||||||
|
|
||||||
.Message:not(.own) & {
|
.Message:not(.own) & {
|
||||||
--hover-color: var(--color-reply-hover);
|
--hover-color: var(--color-reply-hover);
|
||||||
--active-color: var(--color-reply-active);
|
--active-color: var(--color-reply-active);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user