Add user's avatar to the top left of the screen
parent
8f3e3b7aaf
commit
a8e12d0771
@ -0,0 +1,11 @@
|
|||||||
|
#### With image
|
||||||
|
|
||||||
|
```jsx
|
||||||
|
<MainHeader avatarPath={util.gifObjectUrl} i18n={util.i18n} />
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Just name
|
||||||
|
|
||||||
|
```jsx
|
||||||
|
<MainHeader name="John Smith" color="purple" i18n={util.i18n} />
|
||||||
|
```
|
@ -0,0 +1,46 @@
|
|||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
import { Avatar } from './Avatar';
|
||||||
|
|
||||||
|
import { Localizer } from '../types/Util';
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
phoneNumber: string;
|
||||||
|
isMe?: boolean;
|
||||||
|
name?: string;
|
||||||
|
color?: string;
|
||||||
|
verified: boolean;
|
||||||
|
profileName?: string;
|
||||||
|
avatarPath?: string;
|
||||||
|
i18n: Localizer;
|
||||||
|
onClick?: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class MainHeader extends React.Component<Props> {
|
||||||
|
public render() {
|
||||||
|
const {
|
||||||
|
avatarPath,
|
||||||
|
i18n,
|
||||||
|
color,
|
||||||
|
name,
|
||||||
|
phoneNumber,
|
||||||
|
profileName,
|
||||||
|
} = this.props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="module-main-header">
|
||||||
|
<Avatar
|
||||||
|
avatarPath={avatarPath}
|
||||||
|
color={color}
|
||||||
|
conversationType="direct"
|
||||||
|
i18n={i18n}
|
||||||
|
name={name}
|
||||||
|
phoneNumber={phoneNumber}
|
||||||
|
profileName={profileName}
|
||||||
|
size={28}
|
||||||
|
/>
|
||||||
|
<div className="module-main-header__app-name">Signal</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue