Skip to content

Commit 339395d

Browse files
committed
(UI) improve file display
1 parent 718f061 commit 339395d

File tree

6 files changed

+46
-12
lines changed

6 files changed

+46
-12
lines changed
Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,32 @@
11
.vac-image-container {
22
.vac-file-message {
3-
display: flex;
43
height: 60px;
54
width: 60px;
65
display: flex;
7-
align-items: center;
6+
align-content: center;
87
justify-content: center;
9-
text-align: center;
108
flex-wrap: wrap;
9+
text-align: center;
1110
background: var(--chat-bg-color-input);
1211
border: var(--chat-border-style-input);
1312
border-radius: 4px;
1413
margin: 3px 0 5px;
1514
padding: 10px;
1615
cursor: pointer;
16+
transition: all 0.2s;
17+
18+
&:hover {
19+
transform: scale(1.03);
20+
}
1721

1822
svg {
1923
height: 30px;
2024
width: 30px;
2125
}
26+
27+
.vac-text-extension {
28+
font-size: 12px;
29+
color: var(--chat-message-color-file-extension);
30+
}
2231
}
2332
}

src/lib/Message/MessageFiles/MessageFiles.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
<div class="vac-text-ellipsis">
2626
{{ file.name }}
2727
</div>
28+
<div class="vac-text-ellipsis vac-text-extension">
29+
{{ file.extension }}
30+
</div>
2831
</div>
2932
</div>
3033

src/lib/Room/RoomFiles/RoomFiles.scss

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,27 @@
3434
}
3535

3636
.vac-file-container {
37-
height: 100px;
38-
width: 100px;
37+
height: 80px;
38+
width: 80px;
3939
display: flex;
40-
align-items: center;
40+
align-content: center;
4141
justify-content: center;
42+
flex-wrap: wrap;
43+
text-align: center;
4244
background: var(--chat-bg-color-input);
4345
border: var(--chat-border-style-input);
4446
border-radius: 4px;
47+
padding: 10px;
48+
49+
svg {
50+
height: 28px;
51+
width: 28px;
52+
}
53+
54+
.vac-text-extension {
55+
font-size: 14px;
56+
color: var(--chat-message-color-file-extension);
57+
}
4558
}
4659

4760
.vac-icon-remove {

src/lib/Room/RoomFiles/RoomFiles.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@
3535
<svg-icon name="file" />
3636
</slot>
3737
</div>
38+
<div class="vac-text-ellipsis">
39+
{{ file.name }}
40+
</div>
41+
<div class="vac-text-ellipsis vac-text-extension">
42+
{{ file.extension }}
43+
</div>
3844
</div>
3945
</div>
4046
</div>

src/styles/helper.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@
3939
display: flex;
4040
cursor: pointer;
4141
transition: all 0.2s;
42-
}
4342

44-
.vac-svg-button:hover {
45-
transform: scale(1.1);
46-
opacity: 0.7;
43+
&:hover {
44+
transform: scale(1.1);
45+
opacity: 0.7;
46+
}
4747
}
4848

4949
.vac-avatar {

src/themes/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ export const defaultThemeStyles = {
8383
backgroundAudioRecord: '#eb4034',
8484
backgroundAudioLine: 'rgba(0, 0, 0, 0.15)',
8585
backgroundAudioProgress: '#455247',
86-
backgroundAudioProgressSelector: '#455247'
86+
backgroundAudioProgressSelector: '#455247',
87+
colorFileExtension: '#757e85'
8788
},
8889

8990
markdown: {
@@ -221,7 +222,8 @@ export const defaultThemeStyles = {
221222
backgroundAudioRecord: '#eb4034',
222223
backgroundAudioLine: 'rgba(255, 255, 255, 0.15)',
223224
backgroundAudioProgress: '#b7d4d3',
224-
backgroundAudioProgressSelector: '#b7d4d3'
225+
backgroundAudioProgressSelector: '#b7d4d3',
226+
colorFileExtension: '#a2a5a8'
225227
},
226228

227229
markdown: {
@@ -372,6 +374,7 @@ export const cssThemeVars = ({
372374
'--chat-message-bg-color-audio-progress': message.backgroundAudioProgress,
373375
'--chat-message-bg-color-audio-progress-selector':
374376
message.backgroundAudioProgressSelector,
377+
'--chat-message-color-file-extension': message.colorFileExtension,
375378

376379
// markdown
377380
'--chat-markdown-bg': markdown.background,

0 commit comments

Comments
 (0)