This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 829
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5847 from matrix-org/jryans/reason-message-tweaks
Tweak appearance of invite reason
- Loading branch information
Showing
11 changed files
with
123 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
Copyright 2021 The Matrix.org Foundation C.I.C. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
.mx_InviteReason { | ||
position: relative; | ||
margin-bottom: 1em; | ||
|
||
.mx_InviteReason_reason { | ||
visibility: visible; | ||
} | ||
|
||
.mx_InviteReason_view { | ||
display: none; | ||
position: absolute; | ||
inset: 0; | ||
justify-content: center; | ||
align-items: center; | ||
cursor: pointer; | ||
color: $secondary-fg-color; | ||
|
||
&::before { | ||
content: ""; | ||
margin-right: 8px; | ||
background-color: $secondary-fg-color; | ||
mask-image: url('$(res)/img/feather-customised/eye.svg'); | ||
display: inline-block; | ||
width: 18px; | ||
height: 14px; | ||
} | ||
} | ||
} | ||
|
||
.mx_InviteReason_hidden { | ||
.mx_InviteReason_reason { | ||
visibility: hidden; | ||
} | ||
|
||
.mx_InviteReason_view { | ||
display: flex; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
Copyright 2021 The Matrix.org Foundation C.I.C. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
import classNames from "classnames"; | ||
import React from "react"; | ||
import { _t } from "../../../languageHandler"; | ||
import { replaceableComponent } from "../../../utils/replaceableComponent"; | ||
|
||
interface IProps { | ||
reason: string; | ||
} | ||
|
||
interface IState { | ||
hidden: boolean; | ||
} | ||
|
||
@replaceableComponent("views.elements.InviteReason") | ||
export default class InviteReason extends React.PureComponent<IProps, IState> { | ||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
// We hide the reason for invitation by default, since it can be a | ||
// vector for spam/harassment. | ||
hidden: true, | ||
}; | ||
} | ||
|
||
onViewClick = () => { | ||
this.setState({ | ||
hidden: false, | ||
}); | ||
} | ||
|
||
render() { | ||
const classes = classNames({ | ||
"mx_InviteReason": true, | ||
"mx_InviteReason_hidden": this.state.hidden, | ||
}); | ||
|
||
return <div className={classes}> | ||
<div className="mx_InviteReason_reason">{this.props.reason}</div> | ||
<div className="mx_InviteReason_view" | ||
onClick={this.onViewClick} | ||
> | ||
{_t("View message")} | ||
</div> | ||
</div>; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters