refactor: branding

This commit is contained in:
cha0s 2020-12-14 06:37:14 -06:00
parent b38b4e7d70
commit 617f433b19
3 changed files with 14 additions and 10 deletions

View File

@ -4,18 +4,13 @@
.branding { .branding {
align-items: center; align-items: center;
color: $color-muted; color: $color-muted;
display: none;
font-family: var(--thick-title-font-family); font-family: var(--thick-title-font-family);
font-size: 0.95em; font-size: 0.75em;
justify-content: space-around; justify-content: space-around;
left: 3em; padding: 1.5em 1em;
padding: 1em;
position: absolute; position: absolute;
text-decoration: none; text-decoration: none;
user-select: none; user-select: none;
@include breakpoint(tablet) {
display: inline-block;
}
.closed & { .closed & {
flex-direction: column; flex-direction: column;
font-size: 0.9em; font-size: 0.9em;
@ -28,5 +23,8 @@
div { div {
display: inline-block; display: inline-block;
} }
button + & {
left: 3em;
}
} }

View File

@ -42,8 +42,10 @@ export default function Channel(props) {
> >
<div className="channel"> <div className="channel">
{React.cloneElement( {React.cloneElement(
href ? <Link to={href} /> : <div />, href
{className: 'channel__link dismiss-side', title: name}, ? <Link className="channel__link dismiss-side" to={href} />
: <div className="channel__link" />,
{title: name},
[React.cloneElement(content, {key: name})], [React.cloneElement(content, {key: name})],
)} )}
<Actions actions={actions} /> <Actions actions={actions} />

View File

@ -13,12 +13,14 @@ import {
unreadUserSelector, unreadUserSelector,
} from '@reddichat/user/client'; } from '@reddichat/user/client';
import useBreakpoints from 'hooks/useBreakpoints';
import useChannel from 'hooks/useChannel'; import useChannel from 'hooks/useChannel';
import Branding from 'components/branding'; import Branding from 'components/branding';
export default function Header(props) { export default function Header(props) {
const {onButton} = props; const {onButton} = props;
const {tablet} = useBreakpoints();
const channel = useChannel(); const channel = useChannel();
const id = useSelector(idSelector); const id = useSelector(idSelector);
const isUserAnonymous = 0 === id; const isUserAnonymous = 0 === id;
@ -45,7 +47,9 @@ export default function Header(props) {
{unread ? <span className="unread">{unread}</span> : null} {unread ? <span className="unread">{unread}</span> : null}
</button> </button>
)} )}
<Branding /> {(isUserAnonymous || tablet) && (
<Branding />
)}
<div className="header__channel"> <div className="header__channel">
<Switch> <Switch>
<Route <Route