From 258345628b3eda820346e2ea11f9a6c552e5b3d1 Mon Sep 17 00:00:00 2001 From: Allan Eagle Date: Mon, 22 Jul 2019 22:20:05 +0100 Subject: [PATCH] Added CenteredVertically component --- react-spaces/src/components/Centered.scss | 8 ++++++-- react-spaces/src/components/Centered.tsx | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/react-spaces/src/components/Centered.scss b/react-spaces/src/components/Centered.scss index c658bf2..da5f2de 100644 --- a/react-spaces/src/components/Centered.scss +++ b/react-spaces/src/components/Centered.scss @@ -1,6 +1,10 @@ -.spaces-centered { - text-align: center; +.spaces-centered-vertically { position: relative; top: 50%; transform: translateY(-50%); +} + +.spaces-centered { + @extend .spaces-centered-vertically; + text-align: center; } \ No newline at end of file diff --git a/react-spaces/src/components/Centered.tsx b/react-spaces/src/components/Centered.tsx index 1e9af86..932166d 100644 --- a/react-spaces/src/components/Centered.tsx +++ b/react-spaces/src/components/Centered.tsx @@ -5,4 +5,10 @@ export const Centered : React.FC = (props) => (
{props.children}
+) + +export const CenteredVertically : React.FC = (props) => ( +
+ {props.children} +
) \ No newline at end of file