From 7d935751262ae83b04e2e4bde1785824cccb22c6 Mon Sep 17 00:00:00 2001 From: Phuoc Nguyen Date: Fri, 15 Nov 2019 17:38:15 +0700 Subject: [PATCH] Add sticky footer layout --- client/App.jsx | 2 ++ client/Home.jsx | 2 +- client/layouts/StickyFooter.jsx | 57 +++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 client/layouts/StickyFooter.jsx diff --git a/client/App.jsx b/client/App.jsx index 53134a2..a2cb1f1 100644 --- a/client/App.jsx +++ b/client/App.jsx @@ -3,6 +3,7 @@ import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'; import Home from './Home'; import Centering from './layouts/Centering'; +import StickyFooter from './layouts/StickyFooter'; const App = () => { return ( @@ -10,6 +11,7 @@ const App = () => { + ); diff --git a/client/Home.jsx b/client/Home.jsx index 3213f84..7de1170 100644 --- a/client/Home.jsx +++ b/client/Home.jsx @@ -15,7 +15,7 @@ const Home = () => {
- +

Sticky footer

diff --git a/client/layouts/StickyFooter.jsx b/client/layouts/StickyFooter.jsx new file mode 100644 index 0000000..c26ed41 --- /dev/null +++ b/client/layouts/StickyFooter.jsx @@ -0,0 +1,57 @@ +import React from 'react'; + +import DetailsLayout from '../DetailsLayout'; +import BrowserFrame from '../placeholders/BrowserFrame'; +import SampleCode from '../SampleCode'; +import useDocumentTitle from '../useDocumentTitle'; + +const StickyFooter = () => { + useDocumentTitle('CSS Layout ∙ Sticky footer'); + + return ( + +
+ The footer is always sticky at the bottom if the main content is short. +
+ +
+ Header +
+
+ Content +
+
+ Footer +
+
+ } + source={ + +
+ ... +
+
+ ... +
+ +
+`} +/> + } + /> + + ); +}; + +export default StickyFooter;