+
{previews}
);
diff --git a/webapp/channels/src/components/file_preview/index.ts b/webapp/channels/src/components/file_preview/index.ts
index 58c441b7f8d..d08fe27b7b0 100644
--- a/webapp/channels/src/components/file_preview/index.ts
+++ b/webapp/channels/src/components/file_preview/index.ts
@@ -5,15 +5,19 @@ import {connect} from 'react-redux';
import {getConfig} from 'mattermost-redux/selectors/entities/general';
+import {isCompactMode} from 'selectors/preferences';
+
import type {GlobalState} from 'types/store';
import FilePreview from './file_preview';
function mapStateToProps(state: GlobalState) {
const config = getConfig(state);
+ const compactMode = isCompactMode(state);
return {
enableSVGs: config.EnableSVGs === 'true',
+ compactMode,
};
}
diff --git a/webapp/channels/src/sass/components/_files.scss b/webapp/channels/src/sass/components/_files.scss
index 3bac076ceb7..5e81cac0fc2 100644
--- a/webapp/channels/src/sass/components/_files.scss
+++ b/webapp/channels/src/sass/components/_files.scss
@@ -15,6 +15,10 @@
overflow-x: auto;
overflow-y: hidden;
white-space: nowrap;
+
+ &.compact {
+ height: unset;
+ }
}
.file-preview {
@@ -38,11 +42,20 @@
margin-top: -16px;
margin-left: -16px;
}
+
+ &.compact {
+ overflow: hidden !important;
+ }
}
.app__body {
.file-preview__remove {
position: absolute;
+
+ &.compact {
+ position: unset;
+ }
+
top: 4px;
right: 4px;
display: flex;
@@ -494,6 +507,12 @@
font-size: 12px;
text-align: left;
+ &.compact {
+ .post-image__name {
+ font-size: 12px;
+ }
+ }
+
.post-image__archived-name {
align-items: center;
justify-content: start;
@@ -537,6 +556,14 @@
line-height: normal;
text-overflow: ellipsis;
+ &.compact {
+ height: unset;
+
+ .post-image__name {
+ font-size: 12px;
+ }
+ }
+
.post-image__name {
display: block;
overflow: hidden;
diff --git a/webapp/channels/src/sass/components/_post.scss b/webapp/channels/src/sass/components/_post.scss
index f366d92066f..08fe147268f 100644
--- a/webapp/channels/src/sass/components/_post.scss
+++ b/webapp/channels/src/sass/components/_post.scss
@@ -949,6 +949,7 @@
display: flex;
width: 100%;
+ max-width: 100%;
align-items: center;
justify-content: flex-start;
padding: 0 5px;
@@ -961,6 +962,12 @@
font-size: 0.9em;
opacity: 0.5;
}
+
+ .post-image__filename {
+ display: inline;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ }
}
a {
@@ -1673,11 +1680,11 @@
}
}
- .post__translation-icon-processing {
+ .post__translation-icon-processing {
color: rgba(var(--center-channel-color-rgb), 0.73);
font-size: 10px;
line-height: 16px;
-
+
.LoadingSpinner.with-text .spinner {
margin-right: 3px;
}
diff --git a/webapp/channels/src/selectors/preferences.ts b/webapp/channels/src/selectors/preferences.ts
index 6749d88687f..7a254cbcd82 100644
--- a/webapp/channels/src/selectors/preferences.ts
+++ b/webapp/channels/src/selectors/preferences.ts
@@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
-import {getBool as getBoolPreference} from 'mattermost-redux/selectors/entities/preferences';
+import {get, getBool as getBoolPreference} from 'mattermost-redux/selectors/entities/preferences';
import {Preferences} from 'utils/constants';
@@ -33,3 +33,12 @@ export const isUseMilitaryTime = (state: GlobalState) => {
false,
);
};
+
+export const isCompactMode = (state: GlobalState) => {
+ return get(
+ state,
+ Preferences.CATEGORY_DISPLAY_SETTINGS,
+ Preferences.MESSAGE_DISPLAY,
+ Preferences.MESSAGE_DISPLAY_DEFAULT,
+ ) === Preferences.MESSAGE_DISPLAY_COMPACT;
+};