Skip to content
Snippets Groups Projects
Unverified Commit 993e0ba4 authored by Bruno Windels's avatar Bruno Windels Committed by GitHub
Browse files

Merge pull request #171 from matrix-org/bwindels/addnewversion

Merge new version
parents 685950ba b18123d0
Branches
Tags
No related merge requests found
Showing
with 74 additions and 838 deletions
/*
Copyright 2020 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 React from 'react';
import { Room } from '../matrix-cypher';
import { RoomAvatar } from './Avatar';
import './RoomPreview.scss';
interface IProps {
room: Room;
}
const RoomPreview: React.FC<IProps> = ({ room }: IProps) => {
const roomAlias = room.canonical_alias
? room.canonical_alias
: room.aliases
? room.aliases[0]
: room.room_id;
const members =
room.num_joined_members > 0 ? (
<p>{room.num_joined_members.toLocaleString()} members</p>
) : null;
return (
<div className="roomPreview">
<RoomAvatar room={room} />
<h1 className="matrixIdentifier">
{room.name ? room.name : roomAlias}
</h1>
{members}
<p className="matrixIdentifier">{roomAlias}</p>
</div>
);
};
export const RoomPreviewWithTopic: React.FC<IProps> = ({ room }: IProps) => {
const topic = room.topic ? <p className="roomTopic">{room.topic}</p> : null;
return (
<>
<RoomPreview room={room} />
{topic}
</>
);
};
export default RoomPreview;
/*
Copyright 2020 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.
*/
/*
* Stolen from the matrix-react-sdk
*/
import React from 'react';
import tick from '../imgs/tick.svg';
import './StyledCheckbox.scss';
interface IProps extends React.InputHTMLAttributes<HTMLInputElement> {}
const StyledCheckbox: React.FC<IProps> = ({
children,
className,
...otherProps
}: IProps) => (
<label className="styledCheckbox">
<input {...otherProps} type="checkbox" />
{/* Using the div to center the image */}
<div className="styledCheckboxWrapper">
<img src={tick} alt="" />
</div>
{children}
</label>
);
export default StyledCheckbox;
/*
Copyright 2020 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 '../color-scheme';
.textButton {
background: none;
border: none;
color: $link;
font-style: normal;
font-weight: normal;
font-size: 14px;
line-height: 24px;
&:hover {
cursor: pointer;
}
}
This diff is collapsed.
/*
Copyright 2020 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 React from 'react';
import classnames from 'classnames';
import './TextButton.scss';
const TextButton: React.FC<React.ButtonHTMLAttributes<Element>> = ({
className,
...props
}) => {
return (
<button className={classnames('textButton', className)} {...props} />
);
};
export default TextButton;
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment