Telegram Web K with changes to work inside I2P
https://web.telegram.i2p/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
1.1 KiB
31 lines
1.1 KiB
/* |
|
* https://github.com/morethanwords/tweb |
|
* Copyright (C) 2019-2021 Eduard Kuzmenko |
|
* https://github.com/morethanwords/tweb/blob/master/LICENSE |
|
*/ |
|
|
|
import {hexToRgb} from '../../helpers/color'; |
|
import {Message} from '../../layer'; |
|
import getPeerColorById from '../../lib/appManagers/utils/peers/getPeerColorById'; |
|
import ReplyContainer from '../chat/replyContainer'; |
|
|
|
export default function wrapReply( |
|
title: Parameters<ReplyContainer['fill']>[0], |
|
subtitle: Parameters<ReplyContainer['fill']>[1], |
|
message?: Message.message | Message.messageService, |
|
setColorPeerId?: PeerId |
|
) { |
|
const replyContainer = new ReplyContainer('reply'); |
|
const fillPromise = replyContainer.fill(title, subtitle, message); |
|
|
|
if(setColorPeerId) { |
|
const hex = getPeerColorById(setColorPeerId, false); |
|
const [r, g, b] = hexToRgb(hex); |
|
replyContainer.container.style.setProperty('--override-color', `${r}, ${g}, ${b}`); |
|
replyContainer.container.classList.add('is-overriding-color'); |
|
// replyContainer.border.style.backgroundColor = hex; |
|
// replyContainer.title.style.color = hex; |
|
} |
|
|
|
return {container: replyContainer.container, fillPromise}; |
|
}
|
|
|