Skip to content

Commit

Permalink
removed download icon
Browse files Browse the repository at this point in the history
  • Loading branch information
akanshaaa19 committed Jan 20, 2025
1 parent eede142 commit 5393f24
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -298,3 +298,8 @@
padding-bottom: 8px;
font-weight: bold;
}

.NoIcon {
margin: 0 1rem;
/* background-color: red !important; */
}
86 changes: 45 additions & 41 deletions src/containers/Chat/ChatMessages/ChatMessage/ChatMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export interface ChatMessageProps {
groups?: boolean;
status?: string;
contact?: any;
showIcon?: boolean;
}

export const ChatMessage = ({
Expand All @@ -81,6 +82,7 @@ export const ChatMessage = ({
groups,
status,
contact,
showIcon = true,
}: ChatMessageProps) => {
const [showSaveMessageDialog, setShowSaveMessageDialog] = useState(false);
const Ref = useRef(null);
Expand Down Expand Up @@ -335,8 +337,8 @@ export const ChatMessage = ({
</Tooltip>
) : null}

<div className={styles.Inline}>
{iconLeft && icon}
<div className={`${styles.Inline} ${!showIcon && styles.NoIcon}`}>
{showIcon && iconLeft && icon}
{ErrorIcon}
<div className={chatMessageClasses.join(' ')}>
<Tooltip title={tooltipTitle} placement={isSender ? 'right' : 'left'}>
Expand All @@ -361,47 +363,49 @@ export const ChatMessage = ({
</div>
</Tooltip>

<Popper
id={popperId}
open={open}
modifiers={[
{
name: 'preventOverflow',
options: {
altBoundary: true,
{showIcon && (
<Popper
id={popperId}
open={open}
modifiers={[
{
name: 'preventOverflow',
options: {
altBoundary: true,
},
},
},
]}
anchorEl={anchorEl}
placement={placement}
transition
data-testid="popup"
>
{({ TransitionProps }) => (
<Fade {...TransitionProps} timeout={350}>
<Paper elevation={3}>
<Button className={styles.Popper} color="primary" onClick={() => setShowSaveMessageDialog(true)}>
{t('Add to speed sends')}
</Button>
{type !== 'TEXT' && (
<span>
<br />
<Button
className={styles.Popper}
color="primary"
onClick={() => downloadMedia()}
data-testid="downloadMedia"
>
{t('Download media')}
</Button>
</span>
)}
</Paper>
</Fade>
)}
</Popper>
]}
anchorEl={anchorEl}
placement={placement}
transition
data-testid="popup"
>
{({ TransitionProps }) => (
<Fade {...TransitionProps} timeout={350}>
<Paper elevation={3}>
<Button className={styles.Popper} color="primary" onClick={() => setShowSaveMessageDialog(true)}>
{t('Add to speed sends')}
</Button>
{type !== 'TEXT' && (
<span>
<br />
<Button
className={styles.Popper}
color="primary"
onClick={() => downloadMedia()}
data-testid="downloadMedia"
>
{t('Download media')}
</Button>
</span>
)}
</Paper>
</Fade>
)}
</Popper>
)}
</div>
{iconLeft ? null : icon}
{iconLeft ? null : showIcon && icon}
</div>
<div className={styles.SendBy}>{sendBy}</div>

Expand Down
1 change: 1 addition & 0 deletions src/containers/Chat/ChatMessages/ChatMessages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ export const ChatMessages = ({ entityId, collectionId, phoneId }: ChatMessagesPr
onClick={() => showEditDialog(message.id)}
focus={index === 0}
jumpToMessage={jumpToMessage}
showIcon={!groups}
daySeparator={showDaySeparator(
reverseConversation[index].insertedAt,
reverseConversation[index + 1] ? reverseConversation[index + 1].insertedAt : null
Expand Down

0 comments on commit 5393f24

Please sign in to comment.