{ if (ref.current.state.value === '' || !ref.current.state.value) { setReplyButton(false) }; }} className={`${replyButton ? `${styles.CommentInput} ${styles.Collapse}` : `${styles.CommentInput}`}`}>
19 |
{ input.onChange && input.onChange(e) }} value={input?.value || undefined} onFocus={() => { setReplyButton(true) }} placeholder={input?.placeholder}/>
20 |
{ onSubmit && onSubmit() }} className={`${replyButton ? `${styles.SubReplySubmitButton}` : `${styles.SubReplySubmitButton} ${styles.Collapse}`}`}>{buttonText}
21 |
22 | >
23 | )
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/src/components/custom/input/withPrefix/index.module.less:
--------------------------------------------------------------------------------
1 | @import '../../../../styles/common.module.less';
2 |
3 | .prefix{
4 | color: @font-light-blue-color;
5 | flex-shrink: 0;
6 | display: flex;
7 | align-items: center;
8 | justify-content: center;
9 | }
10 | .input{
11 | outline: none;
12 | width: 100%;
13 | min-width: 0;
14 | border-radius: 6px;
15 | transition: @default-transition;
16 | height: 100%;
17 | border: @default-border;
18 | &:hover {
19 | border-color: @default-link-color !important;
20 | box-shadow: 0 0 0 2px rgba(138, 87, 235, 0.2) !important;
21 | }
22 | &:focus {
23 | border-color: @default-link-color !important;
24 | box-shadow: 0 0 0 2px rgba(138, 87, 235, 0.2) !important;
25 | }
26 | }
--------------------------------------------------------------------------------
/src/components/custom/input/withPrefix/index.tsx:
--------------------------------------------------------------------------------
1 | import { Input } from 'antd'
2 | import { FC } from 'react'
3 | import styles from './index.module.less'
4 | interface WithPrefixInputProps{
5 | prefix: string
6 | enableTextArea?: boolean
7 | onChange?: (e: string) => void
8 | className?: string
9 | style?: React.CSSProperties
10 | }
11 | export const WithPrefixInput: FC