Apply prettier formatting
This commit is contained in:
parent
1cac306093
commit
526645c791
1576 changed files with 65385 additions and 62478 deletions
|
@ -17,7 +17,7 @@ limitations under the License.
|
|||
import * as React from "react";
|
||||
import { useContext, useState } from "react";
|
||||
|
||||
import AutoHideScrollbar from './AutoHideScrollbar';
|
||||
import AutoHideScrollbar from "./AutoHideScrollbar";
|
||||
import { getHomePageUrl } from "../../utils/pages";
|
||||
import { _tDom } from "../../languageHandler";
|
||||
import SdkConfig from "../../SdkConfig";
|
||||
|
@ -35,7 +35,7 @@ import EmbeddedPage from "./EmbeddedPage";
|
|||
|
||||
const onClickSendDm = (ev: ButtonEvent) => {
|
||||
PosthogTrackers.trackInteraction("WebHomeCreateChatButton", ev);
|
||||
dis.dispatch({ action: 'view_create_chat' });
|
||||
dis.dispatch({ action: "view_create_chat" });
|
||||
};
|
||||
|
||||
const onClickExplore = (ev: ButtonEvent) => {
|
||||
|
@ -45,7 +45,7 @@ const onClickExplore = (ev: ButtonEvent) => {
|
|||
|
||||
const onClickNewRoom = (ev: ButtonEvent) => {
|
||||
PosthogTrackers.trackInteraction("WebHomeCreateRoomButton", ev);
|
||||
dis.dispatch({ action: 'view_create_room' });
|
||||
dis.dispatch({ action: "view_create_room" });
|
||||
};
|
||||
|
||||
interface IProps {
|
||||
|
@ -65,28 +65,30 @@ const UserWelcomeTop = () => {
|
|||
setOwnProfile(getOwnProfile(userId));
|
||||
});
|
||||
|
||||
return <div>
|
||||
<MiniAvatarUploader
|
||||
hasAvatar={!!ownProfile.avatarUrl}
|
||||
hasAvatarLabel={_tDom("Great, that'll help people know it's you")}
|
||||
noAvatarLabel={_tDom("Add a photo so people know it's you.")}
|
||||
setAvatarUrl={url => cli.setAvatarUrl(url)}
|
||||
isUserAvatar
|
||||
onClick={ev => PosthogTrackers.trackInteraction("WebHomeMiniAvatarUploadButton", ev)}
|
||||
>
|
||||
<BaseAvatar
|
||||
idName={userId}
|
||||
name={ownProfile.displayName}
|
||||
url={ownProfile.avatarUrl}
|
||||
width={AVATAR_SIZE}
|
||||
height={AVATAR_SIZE}
|
||||
resizeMethod="crop"
|
||||
/>
|
||||
</MiniAvatarUploader>
|
||||
return (
|
||||
<div>
|
||||
<MiniAvatarUploader
|
||||
hasAvatar={!!ownProfile.avatarUrl}
|
||||
hasAvatarLabel={_tDom("Great, that'll help people know it's you")}
|
||||
noAvatarLabel={_tDom("Add a photo so people know it's you.")}
|
||||
setAvatarUrl={(url) => cli.setAvatarUrl(url)}
|
||||
isUserAvatar
|
||||
onClick={(ev) => PosthogTrackers.trackInteraction("WebHomeMiniAvatarUploadButton", ev)}
|
||||
>
|
||||
<BaseAvatar
|
||||
idName={userId}
|
||||
name={ownProfile.displayName}
|
||||
url={ownProfile.avatarUrl}
|
||||
width={AVATAR_SIZE}
|
||||
height={AVATAR_SIZE}
|
||||
resizeMethod="crop"
|
||||
/>
|
||||
</MiniAvatarUploader>
|
||||
|
||||
<h1>{ _tDom("Welcome %(name)s", { name: ownProfile.displayName }) }</h1>
|
||||
<h2>{ _tDom("Now, let's help you get started") }</h2>
|
||||
</div>;
|
||||
<h1>{_tDom("Welcome %(name)s", { name: ownProfile.displayName })}</h1>
|
||||
<h2>{_tDom("Now, let's help you get started")}</h2>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const HomePage: React.FC<IProps> = ({ justRegistered = false }) => {
|
||||
|
@ -104,29 +106,33 @@ const HomePage: React.FC<IProps> = ({ justRegistered = false }) => {
|
|||
const brandingConfig = SdkConfig.getObject("branding");
|
||||
const logoUrl = brandingConfig?.get("auth_header_logo_url") ?? "themes/element/img/logos/element-logo.svg";
|
||||
|
||||
introSection = <React.Fragment>
|
||||
<img src={logoUrl} alt={config.brand} />
|
||||
<h1>{ _tDom("Welcome to %(appName)s", { appName: config.brand }) }</h1>
|
||||
<h2>{ _tDom("Own your conversations.") }</h2>
|
||||
</React.Fragment>;
|
||||
introSection = (
|
||||
<React.Fragment>
|
||||
<img src={logoUrl} alt={config.brand} />
|
||||
<h1>{_tDom("Welcome to %(appName)s", { appName: config.brand })}</h1>
|
||||
<h2>{_tDom("Own your conversations.")}</h2>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
|
||||
return <AutoHideScrollbar className="mx_HomePage mx_HomePage_default" element="main">
|
||||
<div className="mx_HomePage_default_wrapper">
|
||||
{ introSection }
|
||||
<div className="mx_HomePage_default_buttons">
|
||||
<AccessibleButton onClick={onClickSendDm} className="mx_HomePage_button_sendDm">
|
||||
{ _tDom("Send a Direct Message") }
|
||||
</AccessibleButton>
|
||||
<AccessibleButton onClick={onClickExplore} className="mx_HomePage_button_explore">
|
||||
{ _tDom("Explore Public Rooms") }
|
||||
</AccessibleButton>
|
||||
<AccessibleButton onClick={onClickNewRoom} className="mx_HomePage_button_createGroup">
|
||||
{ _tDom("Create a Group Chat") }
|
||||
</AccessibleButton>
|
||||
return (
|
||||
<AutoHideScrollbar className="mx_HomePage mx_HomePage_default" element="main">
|
||||
<div className="mx_HomePage_default_wrapper">
|
||||
{introSection}
|
||||
<div className="mx_HomePage_default_buttons">
|
||||
<AccessibleButton onClick={onClickSendDm} className="mx_HomePage_button_sendDm">
|
||||
{_tDom("Send a Direct Message")}
|
||||
</AccessibleButton>
|
||||
<AccessibleButton onClick={onClickExplore} className="mx_HomePage_button_explore">
|
||||
{_tDom("Explore Public Rooms")}
|
||||
</AccessibleButton>
|
||||
<AccessibleButton onClick={onClickNewRoom} className="mx_HomePage_button_createGroup">
|
||||
{_tDom("Create a Group Chat")}
|
||||
</AccessibleButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</AutoHideScrollbar>;
|
||||
</AutoHideScrollbar>
|
||||
);
|
||||
};
|
||||
|
||||
export default HomePage;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue