style(chat): distinguish empty send button state
This commit is contained in:
@@ -60,6 +60,7 @@ export function ChatInputBar({ disabled = false }: ChatInputBarProps) {
|
|||||||
/>
|
/>
|
||||||
<ChatSendButton
|
<ChatSendButton
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
|
hasContent={hasContent}
|
||||||
onClick={handleSend}
|
onClick={handleSend}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -21,6 +21,12 @@
|
|||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.buttonEmpty {
|
||||||
|
background: #f8a8ce;
|
||||||
|
color: rgba(255, 255, 255, 0.88);
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
.button:focus-visible,
|
.button:focus-visible,
|
||||||
.buttonActive {
|
.buttonActive {
|
||||||
background: linear-gradient(
|
background: linear-gradient(
|
||||||
|
|||||||
@@ -16,17 +16,21 @@ import styles from "./chat-send-button.module.css";
|
|||||||
|
|
||||||
export interface ChatSendButtonProps {
|
export interface ChatSendButtonProps {
|
||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
|
hasContent: boolean;
|
||||||
onClick: () => void;
|
onClick: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function ChatSendButton({
|
export function ChatSendButton({
|
||||||
disabled,
|
disabled,
|
||||||
|
hasContent,
|
||||||
onClick,
|
onClick,
|
||||||
}: ChatSendButtonProps) {
|
}: ChatSendButtonProps) {
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className={`${styles.button} ${disabled ? "" : styles.buttonActive}`}
|
className={`${styles.button} ${
|
||||||
|
hasContent && !disabled ? styles.buttonActive : styles.buttonEmpty
|
||||||
|
}`}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
aria-label="Send message"
|
aria-label="Send message"
|
||||||
|
|||||||
Reference in New Issue
Block a user