/
githubmirror
/
client
Обзор
Документация
Войти
/
githubmirror
/
client
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
shared/chat/chat-button.tsx
49 строк
1 KB
chrisnojima
refactor(styles): theme via hooks, no android remount (#29515)
08 авг 2026, 02:24
Не верифицирован
08 авг 2026, 02:24
a41d38e
Код
Авторство
О чём код?
import * as C from '@/constants' import * as Styles from '@/styles' import WaitingButton from '@/common-adapters/waiting-button' import Icon from '@/common-adapters/icon' import {showMain} from '@/util/storeless-actions' // pulled in from common-adapters/profile-card const Kb = { Icon, WaitingButton, } type Props = { small?: boolean style?: Styles.StylesCrossPlatform username: string afterClick?: () => void } const ChatButton = ({small, style, username, afterClick}: Props) => { const styles = useStyles() const theme = Styles.useTheme() const previewConversation = C.Router2.previewConversation const chat = () => { afterClick?.() showMain() previewConversation({participants: [username], reason: 'tracker'}) } return ( <Kb.WaitingButton key="Chat" label="Chat" waitingKey={C.waitingKeyChatCreating} onClick={chat} small={small} style={style} > <Kb.Icon type="iconfont-chat" color={theme.whiteOrWhite} style={styles.chatIcon} /> </Kb.WaitingButton> ) } export default ChatButton const useStyles = Styles.createStyleHook(() => ({ chatIcon: { marginRight: Styles.globalMargins.tiny, }, }))