From 473788d20924df44f65b85751c74ca47820eb247 Mon Sep 17 00:00:00 2001 From: rutik wankhade Date: Wed, 19 Aug 2020 12:06:47 +0530 Subject: [PATCH] feat: added author name feature --- src/components/ConfigCover.js | 8 ++++++++ src/components/CoverImage.css | 14 ++++++++++++-- src/components/CoverImage.js | 14 +++++++++----- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/components/ConfigCover.js b/src/components/ConfigCover.js index f689359..752becb 100644 --- a/src/components/ConfigCover.js +++ b/src/components/ConfigCover.js @@ -14,6 +14,7 @@ const defaultSettings = { foregroundColor: "#ffffff", textColor: "#676683", opacity: 1, + author: 'Rutik Wankhade' }; class ConfigCover extends React.Component { @@ -36,6 +37,13 @@ class ConfigCover extends React.Component { onChange={(e) => this.setState({ title: e.target.value })} > + this.setState({ author: e.target.value })} + > +
this.setState({ bgColor: e.target.value })} /> diff --git a/src/components/CoverImage.css b/src/components/CoverImage.css index e486ee0..fdc32fc 100644 --- a/src/components/CoverImage.css +++ b/src/components/CoverImage.css @@ -4,10 +4,9 @@ text-align: center; justify-content: center; align-items: center; - height:420px; + height:380px; width:800px; padding:90px; - margin:00px 0px 15px 0px; } .title-card{ @@ -33,6 +32,17 @@ border:4px solid #676683; } +.author{ + float:bottom; + background-color: #676683; + color:#ffffff; + height:40px; + margin-bottom:20px; + padding :4px; + text-align:center; + font-weight: 500; +} + h1{height:auto;} button{ diff --git a/src/components/CoverImage.js b/src/components/CoverImage.js index 5411990..b2130e3 100644 --- a/src/components/CoverImage.js +++ b/src/components/CoverImage.js @@ -17,19 +17,23 @@ class CoverImage extends React.Component { } render() { - const { title, bgColor, borderColor, borderSize, borderType, pattern, foregroundColor, textColor, opacity } = this.props; + const { title, bgColor, borderColor, borderSize, borderType, pattern, foregroundColor, textColor, opacity, author } = this.props; const styleToApply = { borderTop: `${borderSize}px ${borderType} ${borderColor}`, backgroundColor: `${this.hexToRgbA(foregroundColor, opacity)}`, color: `${textColor}`, }; return ( -
-
-
-

{title}

+
+
+
+
+

{title}

+
+
+
A blog by {author}
); }