add footer for web

This commit is contained in:
Sean Yesmunt 2020-05-08 12:48:58 -04:00
parent e063363c5f
commit 22a4255320
7 changed files with 119 additions and 4 deletions

View file

@ -0,0 +1,86 @@
// @flow
import React from 'react';
import Button from 'component/button';
const sections = [
{
name: 'Talk To Us',
links: [
{
label: 'Twitter',
link: 'https://twitter.com/lbryio',
},
{
label: 'Reddit',
link: 'https://reddit.com/lbry',
},
{
label: 'Discord',
link: 'https://chat.lbry.com/',
},
{
label: 'Telegram',
link: 'https://t.me/lbryofficial',
},
{
label: 'Facebook',
link: 'https://www.facebook.com/lbryio',
},
],
},
{
name: 'Learn More',
links: [
{
label: 'FAQ',
link: 'https://lbry.com/faq',
},
{
label: 'lbry.tech',
link: 'https://lbry.tech',
},
{
label: 'Github',
link: 'https://github.com/lbryio/lbry-desktop',
},
],
},
{
name: 'Other',
links: [
{
label: 'Support',
link: 'https://lbry.com/faq/support',
},
{
label: 'Terms of Service',
link: 'https://www.lbry.com/termsofservice',
},
{
label: '2257',
link: '',
},
],
},
];
export default function Footer() {
return (
<footer className="footer">
{sections.map(({ name, links }) => {
return (
<div key={name}>
<div className="footer__section-title">{name}</div>
<ul className="ul--no-style">
{links.map(({ label, link }) => (
<li key={label}>
<Button className="footer__link" href={link} label={label} />
</li>
))}
</ul>
</div>
);
})}
</footer>
);
}

View file

@ -4,6 +4,7 @@ import React, { Fragment } from 'react';
import classnames from 'classnames'; import classnames from 'classnames';
import SideNavigation from 'component/sideNavigation'; import SideNavigation from 'component/sideNavigation';
import Header from 'component/header'; import Header from 'component/header';
import Footer from 'lbrytv/component/footer';
export const MAIN_CLASS = 'main'; export const MAIN_CLASS = 'main';
type Props = { type Props = {
@ -13,10 +14,11 @@ type Props = {
isUpgradeAvailable: boolean, isUpgradeAvailable: boolean,
authPage: boolean, authPage: boolean,
noHeader: boolean, noHeader: boolean,
noFooter: boolean,
}; };
function Page(props: Props) { function Page(props: Props) {
const { children, className, authPage = false, noHeader } = props; const { children, className, authPage = false, noHeader, noFooter } = props;
return ( return (
<Fragment> <Fragment>
@ -25,6 +27,9 @@ function Page(props: Props) {
<main className={classnames(MAIN_CLASS, className, { 'main--full-width': authPage })}>{children}</main> <main className={classnames(MAIN_CLASS, className, { 'main--full-width': authPage })}>{children}</main>
{!authPage && !noHeader && <SideNavigation />} {!authPage && !noHeader && <SideNavigation />}
</div> </div>
{/* @if TARGET='web' */}
{!noFooter && <Footer />}
{/* @endif */}
</Fragment> </Fragment>
); );
} }

View file

@ -20,7 +20,7 @@ function ChannelsFollowingPage(props: Props) {
return !hasSubsribedChannels ? ( return !hasSubsribedChannels ? (
<ChannelsFollowingDiscoverPage /> <ChannelsFollowingDiscoverPage />
) : ( ) : (
<Page> <Page noFooter>
<ClaimListDiscover <ClaimListDiscover
headerLabel={ headerLabel={
<span> <span>

View file

@ -85,7 +85,7 @@ function DiscoverPage(props: Props) {
} }
return ( return (
<Page> <Page noFooter>
<ClaimListDiscover <ClaimListDiscover
claimType={claimType ? [claimType] : undefined} claimType={claimType ? [claimType] : undefined}
headerLabel={headerLabel} headerLabel={headerLabel}

View file

@ -10,7 +10,7 @@ import * as CS from 'constants/claim_search';
function DiscoverPage() { function DiscoverPage() {
return ( return (
<Page> <Page noFooter>
<ClaimListDiscover <ClaimListDiscover
headerLabel={ headerLabel={
<span> <span>

View file

@ -20,6 +20,7 @@
@import 'component/expanding-details'; @import 'component/expanding-details';
@import 'component/file-properties'; @import 'component/file-properties';
@import 'component/file-render'; @import 'component/file-render';
@import 'component/footer';
@import 'component/form-field'; @import 'component/form-field';
@import 'component/header'; @import 'component/header';
@import 'component/icon'; @import 'component/icon';

View file

@ -0,0 +1,23 @@
.footer {
display: flex;
justify-content: center;
max-width: 80%;
margin: auto;
padding: var(--spacing-xlarge);
font-size: var(--font-small);
> * {
margin-right: calc(var(--spacing-xlarge) * 1.5);
}
}
.footer__section-title {
@extend .help;
font-weight: 300;
margin-bottom: var(--spacing-medium);
}
.footer__link {
@extend .button--link;
@extend .help;
}