chat: style fix -- collapse ternary operators

This commit is contained in:
Matilde Park 2020-01-29 19:34:37 -05:00
parent 9eca995eeb
commit 15bc1da3ba
5 changed files with 13 additions and 24 deletions

File diff suppressed because one or more lines are too long

View File

@ -23,14 +23,11 @@ export class ChatTabBar extends Component {
setColor = 'gray3';
}
(props.location.pathname.includes('/popout'))
? popout = "popout/"
: popout = "";
popout = props.location.pathname.includes("/popout")
? "popout/" : "";
let hidePopoutIcon = (this.props.popout)
? "dn-m dn-l dn-xl"
: "dib-m dib-l dib-xl";
? "dn-m dn-l dn-xl" : "dib-m dib-l dib-xl";
return (
<div className="dib pt2 flex-shrink-0 flex-grow-1">

View File

@ -14,8 +14,7 @@ export class HeaderBar extends Component {
// : null;
let popout = window.location.href.includes("popout/")
? "dn"
: "dn db-m db-l db-xl";
? "dn" : "dn db-m db-l db-xl";
let title = document.title === "Home" ? "" : document.title;

View File

@ -82,8 +82,7 @@ export class Message extends Component {
contents = (
<div className={'embed-container mb2 w-100 w-75-l w-50-xl ' +
((this.state.unfold === true)
? "db"
: "dn")}>
? "db" : "dn")}>
<iframe
ref="iframe"
width="560"
@ -175,8 +174,7 @@ export class Message extends Component {
size={24}
color={((props.msg.author === window.ship)
|| (props.msg.author.substr(1) === window.ship))
? "#4330FC"
: "#000000"}
? "#4330FC" : "#000000"}
/>
</div>
<div

View File

@ -7,16 +7,13 @@ export class Skeleton extends Component {
// sidebar and chat panel conditional classes
let sidebarHide = (!this.props.sidebarShown || this.props.popout)
? "dn"
: "";
? "dn" : "";
let sidebarHideOnMobile = this.props.sidebarHideOnMobile
? "dn-s"
: "";
? "dn-s" : "";
let chatHideOnMobile = this.props.chatHideonMobile
? "dn-s"
: "";
? "dn-s" : "";
// mobile-specific navigation classes
let mobileNavClasses = classnames({
@ -27,12 +24,10 @@ export class Skeleton extends Component {
// popout switches out window chrome and borders
let popoutWindow = this.props.popout
? ""
: "ph4-m ph4-l ph4-xl pb4-m pb4-l pb4-xl";
? "" : "ph4-m ph4-l ph4-xl pb4-m pb4-l pb4-xl";
let popoutBorder = this.props.popout
? ""
: "ba-m ba-l ba-xl b--gray2 br1 ";
let popoutBorder = this.props.popout
? "" : "ba-m ba-l ba-xl b--gray2 br1 ";
return (
// app outer skeleton