Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit bdd490b

Browse files
committed
Improve the styling of search initialization errors.
Signed-off-by: Kalle Struik <[email protected]>
1 parent 9f26c1c commit bdd490b

File tree

5 files changed

+24
-21
lines changed

5 files changed

+24
-21
lines changed

res/css/_components.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
@import "./views/elements/_AccessibleButton.scss";
127127
@import "./views/elements/_AddressSelector.scss";
128128
@import "./views/elements/_AddressTile.scss";
129-
@import "./views/elements/_DesktopBuildsNotice.scss";
129+
@import "./views/elements/_SearchWarning.scss";
130130
@import "./views/elements/_DesktopCapturerSourcePicker.scss";
131131
@import "./views/elements/_DialPadBackspaceButton.scss";
132132
@import "./views/elements/_DirectorySearchBox.scss";

res/css/views/elements/_DesktopBuildsNotice.scss renamed to res/css/views/elements/_SearchWarning.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
.mx_DesktopBuildsNotice {
17+
.mx_SearchWarning {
1818
text-align: center;
1919
padding: 0 16px;
2020

src/components/structures/FilePanel.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import EventIndexPeg from "../../indexing/EventIndexPeg";
2929
import { _t } from '../../languageHandler';
3030
import BaseCard from "../views/right_panel/BaseCard";
3131
import { RightPanelPhases } from "../../stores/RightPanelStorePhases";
32-
import DesktopBuildsNotice, { WarningKind } from "../views/elements/DesktopBuildsNotice";
32+
import SearchWarning, { WarningKind } from "../views/elements/SearchWarning";
3333
import { replaceableComponent } from "../../utils/replaceableComponent";
3434

3535
import ResizeNotifier from '../../utils/ResizeNotifier';
@@ -258,7 +258,7 @@ class FilePanel extends React.Component<IProps, IState> {
258258
previousPhase={RightPanelPhases.RoomSummary}
259259
withoutScrollContainer
260260
>
261-
<DesktopBuildsNotice isRoomEncrypted={isRoomEncrypted} kind={WarningKind.Files} />
261+
<SearchWarning isRoomEncrypted={isRoomEncrypted} kind={WarningKind.Files} />
262262
<TimelinePanel
263263
manageReadReceipts={false}
264264
manageReadMarkers={false}

src/components/views/elements/DesktopBuildsNotice.tsx renamed to src/components/views/elements/SearchWarning.tsx

+18-15
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,27 @@ interface IProps {
3232
kind: WarningKind;
3333
}
3434

35-
export default function DesktopBuildsNotice({ isRoomEncrypted, kind }: IProps) {
35+
export default function SearchWarning({ isRoomEncrypted, kind }: IProps) {
3636
if (!isRoomEncrypted) return null;
3737
if (EventIndexPeg.get()) return null;
3838

3939
if (EventIndexPeg.error) {
40-
return <>
41-
{ _t("Message search initialisation failed, check <a>your settings</a> for more information", {}, {
42-
a: sub => (<a onClick={(evt) => {
43-
evt.preventDefault();
44-
dis.dispatch({
45-
action: Action.ViewUserSettings,
46-
initialTabId: UserTab.Security,
47-
});
48-
}}>
49-
{ sub }
50-
</a>),
51-
}) }
52-
</>;
40+
return (
41+
<div className="mx_SearchWarning">
42+
{ _t("Message search initialisation failed, check <a>your settings</a> for more information", {}, {
43+
a: sub => (<a className="mx_linkButton"
44+
onClick={(evt) => {
45+
evt.preventDefault();
46+
dis.dispatch({
47+
action: Action.ViewUserSettings,
48+
initialTabId: UserTab.Security,
49+
});
50+
}}>
51+
{ sub }
52+
</a>),
53+
}) }
54+
</div>
55+
);
5356
}
5457

5558
const { desktopBuilds, brand } = SdkConfig.get();
@@ -88,7 +91,7 @@ export default function DesktopBuildsNotice({ isRoomEncrypted, kind }: IProps) {
8891
}
8992

9093
return (
91-
<div className="mx_DesktopBuildsNotice">
94+
<div className="mx_SearchWarning">
9295
{ logo }
9396
<span>{ text }</span>
9497
</div>

src/components/views/rooms/SearchBar.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import AccessibleButton from "../elements/AccessibleButton";
2020
import classNames from "classnames";
2121
import { _t } from '../../../languageHandler';
2222
import { Key } from "../../../Keyboard";
23-
import DesktopBuildsNotice, { WarningKind } from "../elements/DesktopBuildsNotice";
23+
import SearchWarning, { WarningKind } from "../elements/SearchWarning";
2424
import { replaceableComponent } from "../../../utils/replaceableComponent";
2525

2626
interface IProps {
@@ -123,7 +123,7 @@ export default class SearchBar extends React.Component<IProps, IState> {
123123
</div>
124124
<AccessibleButton className="mx_SearchBar_cancel" onClick={this.props.onCancelClick} />
125125
</div>
126-
<DesktopBuildsNotice isRoomEncrypted={this.props.isRoomEncrypted} kind={WarningKind.Search} />
126+
<SearchWarning isRoomEncrypted={this.props.isRoomEncrypted} kind={WarningKind.Search} />
127127
</>
128128
);
129129
}

0 commit comments

Comments
 (0)