More minor tooltip improvements
This commit is contained in:
parent
1ae01a3226
commit
d64e8ab39e
|
@ -1,5 +1,5 @@
|
|||
import React, { Component } from 'react';
|
||||
import { Typography, AppBar, Toolbar, IconButton, InputBase, Avatar, ListItemText, Divider, List, ListItemIcon, Hidden, Drawer, ListSubheader, ListItemAvatar, withStyles, Menu, MenuItem, ClickAwayListener, Badge, Dialog, DialogTitle, DialogContent, DialogContentText, DialogActions, Button, ListItem } from '@material-ui/core';
|
||||
import { Typography, AppBar, Toolbar, IconButton, InputBase, Avatar, ListItemText, Divider, List, ListItemIcon, Hidden, Drawer, ListSubheader, ListItemAvatar, withStyles, Menu, MenuItem, ClickAwayListener, Badge, Dialog, DialogTitle, DialogContent, DialogContentText, DialogActions, Button, ListItem, Tooltip } from '@material-ui/core';
|
||||
import MenuIcon from '@material-ui/icons/Menu';
|
||||
import SearchIcon from '@material-ui/icons/Search';
|
||||
import NotificationsIcon from '@material-ui/icons/Notifications';
|
||||
|
@ -280,17 +280,24 @@ export class AppLayout extends Component<any, IAppLayoutState> {
|
|||
</div>
|
||||
<div className={classes.appBarFlexGrow}/>
|
||||
<div className={classes.appBarActionButtons}>
|
||||
<LinkableIconButton color="inherit" to="/notifications" onClick={() => this.setState({ notificationCount: 0 })}>
|
||||
<Badge badgeContent={this.state.notificationCount > 0? this.state.notificationCount: ""} color="secondary">
|
||||
<NotificationsIcon />
|
||||
</Badge>
|
||||
</LinkableIconButton>
|
||||
<LinkableIconButton color="inherit" to="/messages">
|
||||
<MailIcon/>
|
||||
</LinkableIconButton>
|
||||
<IconButton id="acctMenuBtn" onClick={this.toggleAcctMenu}>
|
||||
<Avatar className={classes.appBarAcctMenuIcon} alt="You" src={this.state.currentUser? this.state.currentUser.avatar_static: ""}/>
|
||||
</IconButton>
|
||||
<Tooltip title="Notifications">
|
||||
<LinkableIconButton color="inherit" to="/notifications" onClick={() => this.setState({ notificationCount: 0 })}>
|
||||
<Badge badgeContent={this.state.notificationCount > 0? this.state.notificationCount: ""} color="secondary">
|
||||
<NotificationsIcon />
|
||||
</Badge>
|
||||
</LinkableIconButton>
|
||||
</Tooltip>
|
||||
<Tooltip title="Direct messages">
|
||||
<LinkableIconButton color="inherit" to="/messages">
|
||||
<MailIcon/>
|
||||
</LinkableIconButton>
|
||||
</Tooltip>
|
||||
<Tooltip title="Your account">
|
||||
<IconButton id="acctMenuBtn" onClick={this.toggleAcctMenu}>
|
||||
<Avatar className={classes.appBarAcctMenuIcon} alt="You" src={this.state.currentUser? this.state.currentUser.avatar_static: ""}/>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
|
||||
<Menu
|
||||
id="acct-menu"
|
||||
anchorEl={document.getElementById("acctMenuBtn")}
|
||||
|
@ -364,9 +371,11 @@ export class AppLayout extends Component<any, IAppLayoutState> {
|
|||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
<LinkableFab to="/compose" className={classes.composeButton} color="secondary" aria-label="Compose">
|
||||
<EditIcon/>
|
||||
</LinkableFab>
|
||||
<Tooltip title="Create a new post">
|
||||
<LinkableFab to="/compose" className={classes.composeButton} color="secondary" aria-label="Compose">
|
||||
<EditIcon/>
|
||||
</LinkableFab>
|
||||
</Tooltip>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -449,9 +449,12 @@ export class Post extends React.Component<any, IPostState> {
|
|||
post.reblog? post.reblog.account.avatar_static: post.account.avatar_static
|
||||
} />
|
||||
} action={
|
||||
<IconButton key={`${post.id}_submenu`} id={`${post.id}_submenu`} onClick={() => this.togglePostMenu()}>
|
||||
<MoreVertIcon />
|
||||
</IconButton>}
|
||||
<Tooltip title="More">
|
||||
<IconButton key={`${post.id}_submenu`} id={`${post.id}_submenu`} onClick={() => this.togglePostMenu()}>
|
||||
<MoreVertIcon />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
}
|
||||
title={
|
||||
<Typography dangerouslySetInnerHTML={{__html: this.getReblogAuthors(post)}}></Typography>
|
||||
}
|
||||
|
|
|
@ -133,7 +133,12 @@ class NotificationsPage extends Component<any, INotificationsPageState> {
|
|||
secondary = this.removeHTMLContent(notif.status? notif.status.content: "");
|
||||
break;
|
||||
default:
|
||||
primary = "A magical thing happened!";
|
||||
if (notif.status && notif.status.poll) {
|
||||
primary = "A poll you voted in or created has ended.";
|
||||
secondary = this.removeHTMLContent(notif.status? notif.status.content: "");
|
||||
} else {
|
||||
primary = "A magical thing happened!";
|
||||
}
|
||||
break;
|
||||
}
|
||||
return (
|
||||
|
|
Loading…
Reference in New Issue