Skip to content

Commit

Permalink
fix some dom warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Puyodead1 committed Sep 3, 2023
1 parent 76222c5 commit 840e9a0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
10 changes: 3 additions & 7 deletions src/components/messaging/ChatHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,8 @@ const IconButton = styled.button`
}
`;

interface CustomIconProps {
active?: boolean;
}

const CustomIcon = styled(Icon)<CustomIconProps>`
color: ${(props) => (props.active ? "#ffffff" : "var(--text-secondary)")};
const CustomIcon = styled(Icon)<{ $active?: boolean }>`
color: ${(props) => (props.$active ? "#ffffff" : "var(--text-secondary)")};
&:hover {
color: var(--text);
Expand Down Expand Up @@ -113,7 +109,7 @@ function ActionItem({ icon, active, ariaLabel, tooltip }: ActionItemProps) {
logger.debug("click");
}}
>
<CustomIcon icon={icon} size="24px" aria-label={ariaLabel} active={active} />
<CustomIcon $active={active} icon={icon} size="24px" aria-label={ariaLabel} />
</IconButton>
</IconWrapper>
</Tooltip>
Expand Down
10 changes: 5 additions & 5 deletions src/components/messaging/MessageInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ const UploadActionWrapper = styled.div`
padding: 0 12px;
`;

const StyledEditable = styled(Editable)<{ canSendMessages?: boolean; canUpload?: boolean }>`
const StyledEditable = styled(Editable)<{ $canSendMessages?: boolean; $canUpload?: boolean }>`
width: 100%;
outline: none;
word-break: break-word;
padding: 12px 16px 12px ${({ canUpload }) => (canUpload ? "0" : "16px")};
padding: 12px 16px 12px ${({ $canUpload }) => ($canUpload ? "0" : "16px")};
overflow-y: auto;
max-height: 50vh;
cursor: ${({ canSendMessages }) => (!canSendMessages ? "not-allowed" : "text")};
cursor: ${({ $canSendMessages }) => (!$canSendMessages ? "not-allowed" : "text")};
`;

const CustomIcon = styled(Icon)`
Expand Down Expand Up @@ -256,8 +256,8 @@ function MessageInput(props: Props) {
)}
<Slate editor={editor} initialValue={initialEditorValue} onChange={onChange}>
<StyledEditable
canSendMessages={canSendMessages}
canUpload={canUpload}
$canSendMessages={canSendMessages}
$canUpload={canUpload}
onKeyDown={onKeyDown}
value={content}
placeholder={
Expand Down

0 comments on commit 840e9a0

Please sign in to comment.