From 44e63f0dac260405f2bf07e9d67871acde37b12d Mon Sep 17 00:00:00 2001 From: Phuoc Nguyen Date: Sat, 16 Nov 2019 12:28:22 +0700 Subject: [PATCH] Use placeholder for centering --- client/covers/SidebarCover.jsx | 4 ++-- client/covers/StickyFooterCover.jsx | 6 +++--- client/covers/StickyHeaderCover.jsx | 4 ++-- client/layouts/Centering.jsx | 10 +++++++--- client/layouts/Sidebar.jsx | 1 + client/layouts/StickyHeader.jsx | 1 + client/placeholders/Dot.jsx | 10 ++++++++-- client/placeholders/Frame.jsx | 5 +---- 8 files changed, 25 insertions(+), 16 deletions(-) diff --git a/client/covers/SidebarCover.jsx b/client/covers/SidebarCover.jsx index dbdbf89..8137601 100644 --- a/client/covers/SidebarCover.jsx +++ b/client/covers/SidebarCover.jsx @@ -5,13 +5,13 @@ import Line from '../placeholders/Line'; const SidebarCover = () => { return ( - +
-
+
diff --git a/client/covers/StickyFooterCover.jsx b/client/covers/StickyFooterCover.jsx index abed0cb..26aeccc 100644 --- a/client/covers/StickyFooterCover.jsx +++ b/client/covers/StickyFooterCover.jsx @@ -5,7 +5,7 @@ import Line from '../placeholders/Line'; const StickyFooterCover = () => { return ( - +
@@ -13,7 +13,7 @@ const StickyFooterCover = () => {
- +
@@ -23,7 +23,7 @@ const StickyFooterCover = () => {
- +
diff --git a/client/covers/StickyHeaderCover.jsx b/client/covers/StickyHeaderCover.jsx index 7979dc3..2b05304 100644 --- a/client/covers/StickyHeaderCover.jsx +++ b/client/covers/StickyHeaderCover.jsx @@ -5,7 +5,7 @@ import Line from '../placeholders/Line'; const StickyHeaderCover = () => { return ( - +
@@ -13,7 +13,7 @@ const StickyHeaderCover = () => {
- +
diff --git a/client/layouts/Centering.jsx b/client/layouts/Centering.jsx index 17304a0..ec08944 100644 --- a/client/layouts/Centering.jsx +++ b/client/layouts/Centering.jsx @@ -2,6 +2,8 @@ import React from 'react'; import DetailsLayout from '../DetailsLayout'; import BrowserFrame from '../placeholders/BrowserFrame'; +import Dot from '../placeholders/Dot'; +import Rectangle from '../placeholders/Rectangle'; import SampleCode from '../SampleCode'; import useDocumentTitle from '../useDocumentTitle'; @@ -14,7 +16,10 @@ const Centering = () => { -
CENTER
+ +
+
+
} source={ @@ -24,10 +29,9 @@ code={`
- CENTER + ...
`} /> diff --git a/client/layouts/Sidebar.jsx b/client/layouts/Sidebar.jsx index 2adbe24..7958381 100644 --- a/client/layouts/Sidebar.jsx +++ b/client/layouts/Sidebar.jsx @@ -12,6 +12,7 @@ const Sidebar = () => { return (

Sidebar

+
Try to scroll the main content!
diff --git a/client/layouts/StickyHeader.jsx b/client/layouts/StickyHeader.jsx index 17a064e..c951a3b 100644 --- a/client/layouts/StickyHeader.jsx +++ b/client/layouts/StickyHeader.jsx @@ -13,6 +13,7 @@ const StickyHeader = () => { return (

Sticky header

+
Try to scroll the main content to see the header sticks to the top of page.
diff --git a/client/placeholders/Dot.jsx b/client/placeholders/Dot.jsx index abfb753..7267be8 100644 --- a/client/placeholders/Dot.jsx +++ b/client/placeholders/Dot.jsx @@ -1,8 +1,14 @@ import React from 'react'; -const Dot = () => { +const Dot = ({ size = 16 }) => { return ( -
+
); }; diff --git a/client/placeholders/Frame.jsx b/client/placeholders/Frame.jsx index 545fbb5..fb1d17b 100644 --- a/client/placeholders/Frame.jsx +++ b/client/placeholders/Frame.jsx @@ -1,13 +1,10 @@ import React from 'react'; -const Frame = ({ children, size }) => { - const bw = (size === 'medium' ? '2px' : '1px'); - +const Frame = ({ children }) => { return (