MCPcopy Create free account
hub / github.com/async-labs/async / render

Method render

app/components/messages/MessageForm.tsx:91–154  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

89 }
90
91 public render() {
92 const {
93 members,
94 store,
95 readOnly,
96 message,
97 teamId,
98 chat,
99 isOnChatPage,
100 parentMessageId,
101 isMobile,
102 } = this.props;
103
104 let stylesForMainDiv;
105
106 if (isOnChatPage && !parentMessageId) {
107 stylesForMainDiv = {
108 height: isMobile
109 ? `${55 + this.state.heightOfRows + 'px'}`
110 : `${90 + this.state.heightOfRows + 'px'}`,
111 bottom: isMobile ? '25px' : '25px',
112 position: 'fixed',
113 width: isMobile ? 'calc(100% - 40px)' : 'calc(83.33% - 80px)',
114 margin: 'auto 0px',
115 display: 'flex',
116 alignItems: 'center',
117 };
118 } else if (isOnChatPage && parentMessageId) {
119 stylesForMainDiv = {
120 height: '100%',
121 margin: '-20px 0px 40px 80px',
122 width: 'calc(100% - 80px)',
123 };
124 } else {
125 stylesForMainDiv = { height: '100%', margin: '10px 20px 10px 40px' };
126 }
127
128 return (
129 <div style={stylesForMainDiv}>
130 <form style={{ width: '100%', height: '100%' }} onSubmit={this.onSubmit} autoComplete="off">
131 <MessageEditor
132 user={store.currentUser}
133 readOnly={readOnly}
134 content={this.state.content}
135 onChanged={this.onContentChanged}
136 members={members}
137 textareaHeight="100%"
138 teamId={teamId}
139 chatId={chat && chat.chatId}
140 message={message}
141 onFileUploadProp1={this.onFileUpload}
142 onLocalStorageUpdateProp1={this.onLocalStorageUpdate}
143 isOnChatPage={isOnChatPage}
144 isMobile={isMobile}
145 onEnterCtrlPress={this.onSubmit}
146 chat={chat}
147 heightForMessageEditor={this.props.heightForMessageEditor}
148 parentMessageId={parentMessageId}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected