Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.

Commit e9626ce

Browse files
author
Srinaath Ravichandran
committed
Updated download attachment style updated
Signed-off-by: Srinaath Ravichandran <[email protected]>
1 parent 822ffe3 commit e9626ce

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

packages/app/client/src/ui/editor/emulator/parts/chat/chat.spec.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,13 @@ describe('<ChatContainer />', () => {
168168
},
169169
};
170170

171+
const mutatedDownloadAttachment = {
172+
...styleSet.downloadAttachment,
173+
};
174+
mutatedDownloadAttachment['& > a']['& > .details']['& > .name'].color = '#fff';
175+
mutatedDownloadAttachment['& > a']['& > .icon'].fill = '#fff';
176+
styleSet.downloadAttachment = mutatedDownloadAttachment;
177+
171178
expect(webChat.exists()).toBe(true);
172179
const wcProps = webChat.props();
173180
expect(wcProps.bot).toEqual({ id: defaultDocument.botId, name: 'Bot' });

packages/app/client/src/ui/editor/emulator/parts/chat/chat.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,19 @@ interface ChatState {
6565
highlightedActivities?: Activity[];
6666
}
6767

68+
const updateDownloadAttachmentStyle = downloadAttachment => {
69+
try {
70+
const mutatedDownloadAttachment = {
71+
...downloadAttachment,
72+
};
73+
mutatedDownloadAttachment['& > a']['& > .details']['& > .name'].color = styles.bubbleContentColor;
74+
mutatedDownloadAttachment['& > a']['& > .icon'].fill = styles.bubbleContentColor;
75+
return mutatedDownloadAttachment;
76+
} catch {
77+
return downloadAttachment;
78+
}
79+
};
80+
6881
export class Chat extends PureComponent<ChatProps, ChatState> {
6982
public state = { waitForSpeechToken: false } as ChatState;
7083
private activityMap: { [activityId: string]: Activity } = {};
@@ -87,17 +100,18 @@ export class Chat extends PureComponent<ChatProps, ChatState> {
87100

88101
const styleSet = createStyleSet({ ...webChatStyleOptions, hideSendBox: isDisabled });
89102

103+
// Overriding default styles of webchat as these properties are not exposed directly
90104
styleSet.uploadButton = {
91105
...styleSet.uploadButton,
92106
padding: '1px',
93107
};
94-
95108
styleSet.uploadAttachment = {
96109
...styleSet.uploadAttachment,
97110
'& > .name, & > .size': {
98111
color: styles.bubbleContentColor,
99112
},
100113
};
114+
styleSet.downloadAttachment = updateDownloadAttachmentStyle(styleSet.downloadAttachment);
101115

102116
if (directLine) {
103117
const bot = {

0 commit comments

Comments
 (0)