From 2bc54a80fcf82d89891255397ccd71c3bf5a03fe Mon Sep 17 00:00:00 2001 From: Fanny Date: Tue, 21 Apr 2020 08:54:12 -0300 Subject: [PATCH] feat(v2): bootstrap layout footer (#2635) * feat(v2): add minor adjustements and footer component * fix(v2): margin and spacing of footer * fix(v2): spacings * fix(v2): remove unrelated links of the bootstrap template * fix(v2): remove unrelated links of the bootstrap template --- .../src/theme/BlogListPage/index.js | 4 +- .../src/theme/BlogPostItem/index.js | 2 +- .../src/theme/BlogTagsListPage/index.js | 4 +- .../src/theme/Footer/index.js | 75 +++++++++++++++++++ 4 files changed, 81 insertions(+), 4 deletions(-) create mode 100644 packages/docusaurus-theme-bootstrap/src/theme/Footer/index.js diff --git a/packages/docusaurus-theme-bootstrap/src/theme/BlogListPage/index.js b/packages/docusaurus-theme-bootstrap/src/theme/BlogListPage/index.js index 04490b8bf3..71c7286404 100644 --- a/packages/docusaurus-theme-bootstrap/src/theme/BlogListPage/index.js +++ b/packages/docusaurus-theme-bootstrap/src/theme/BlogListPage/index.js @@ -7,12 +7,13 @@ import React from 'react'; import BlogPostCard from '@theme/BlogPostItem'; +import Footer from '@theme/Footer'; function BlogListPage(props) { const {items} = props; return ( -
+
{items.map(({content: BlogPostContent}) => (
))} +
); diff --git a/packages/docusaurus-theme-bootstrap/src/theme/BlogPostItem/index.js b/packages/docusaurus-theme-bootstrap/src/theme/BlogPostItem/index.js index 535a62dea3..a7f81cdba8 100644 --- a/packages/docusaurus-theme-bootstrap/src/theme/BlogPostItem/index.js +++ b/packages/docusaurus-theme-bootstrap/src/theme/BlogPostItem/index.js @@ -49,7 +49,7 @@ function BlogPostItem(props) { const day = parseInt(match[2], 10); return ( -
+
{authorImageURL && ( diff --git a/packages/docusaurus-theme-bootstrap/src/theme/BlogTagsListPage/index.js b/packages/docusaurus-theme-bootstrap/src/theme/BlogTagsListPage/index.js index a196ddbd20..689a6bb47a 100644 --- a/packages/docusaurus-theme-bootstrap/src/theme/BlogTagsListPage/index.js +++ b/packages/docusaurus-theme-bootstrap/src/theme/BlogTagsListPage/index.js @@ -15,7 +15,7 @@ function BlogTagsListPage(props) { + className="btn btn-primary list-inline-item my-2"> {tags[tag].name}{' '} {tags[tag].count} @@ -26,7 +26,7 @@ function BlogTagsListPage(props) { return (

Tags

-
    {renderAllTags()}
+
    {renderAllTags()}
); } diff --git a/packages/docusaurus-theme-bootstrap/src/theme/Footer/index.js b/packages/docusaurus-theme-bootstrap/src/theme/Footer/index.js new file mode 100644 index 0000000000..41d9f0db8f --- /dev/null +++ b/packages/docusaurus-theme-bootstrap/src/theme/Footer/index.js @@ -0,0 +1,75 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import React from 'react'; +import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; +import Link from '@docusaurus/Link'; +import useBaseUrl from '@docusaurus/useBaseUrl'; + +function FooterLink({to, href, label, ...props}) { + const toUrl = useBaseUrl(to); + + return ( + + {label} + + ); +} + +function Footer() { + const context = useDocusaurusContext(); + const {siteConfig = {}} = context; + const {themeConfig = {}} = siteConfig; + const {footer} = themeConfig; + + const {links} = footer || {}; + + return ( + + ); +} + +export default Footer;