diff --git a/src/components/App.js b/src/components/App.js index 105e6ba..2696800 100644 --- a/src/components/App.js +++ b/src/components/App.js @@ -5,7 +5,7 @@ class App extends React.Component { render() { return ( -
+
diff --git a/src/components/ComponentToImg.js b/src/components/ComponentToImg.js index faa7b9a..ca616de 100644 --- a/src/components/ComponentToImg.js +++ b/src/components/ComponentToImg.js @@ -15,8 +15,11 @@ class ComponentToImg extends React.Component {
{this.props.children}
+ className="border p-2 bg-gray-700 hover:bg-gray-800 flex items-center text-white text-xl rounded-lg m-4 px-4" + onClick={() => exportComponentAsPNG(this.componentRef, 'cover')}> + + Download +
); } diff --git a/src/components/CoverImage.css b/src/components/CoverImage.css index 301f5c2..ade91dc 100644 --- a/src/components/CoverImage.css +++ b/src/components/CoverImage.css @@ -1,14 +1,10 @@ -.cover { - display: flex; - height: 420px; - width: 800px; - overflow-y: hidden; +.dev { + height: 340px; + width: 860px; } -@media screen and (max-width:600px) { - .cover { - width: 90vw; - height: 60vh; - padding: 4vh; - } +.hashnode { + height: 420px; + width: 800px; + } \ No newline at end of file diff --git a/src/components/CoverImage.js b/src/components/CoverImage.js index f882341..fc01a5c 100644 --- a/src/components/CoverImage.js +++ b/src/components/CoverImage.js @@ -35,7 +35,7 @@ const CoverImage = (props) => { return ( -
+
{selectTheme(theme)}
); diff --git a/src/components/Editor.js b/src/components/Editor.js index 09f83c1..319d266 100644 --- a/src/components/Editor.js +++ b/src/components/Editor.js @@ -13,9 +13,10 @@ const defaultSettings = { author: 'Rutik Wankhade', icon: { 'label': 'react', 'value': 'react' }, devIconOptions: {}, - font: 'font-sans', + font: 'font-Anek', theme: 'modern', - customIcon: '' + customIcon: '', + platform:'hashnode' }; @@ -24,6 +25,7 @@ const devIconsUrl = "https://raw.githubusercontent.com/devicons/devicon/master/d // { value: 'None', label: 'None' }, // { value: 'javascript', label: 'Javascript' }, // { value: 'python', label: 'Python' }, +// ] class Editor extends React.Component { @@ -53,22 +55,6 @@ class Editor extends React.Component { ); - // customOption = props => { - // const { data, innerRef, innerProps } = props; - - // return data.name === 'custom' ? ( - //
- // this.setState({ 'customIcon': URL.createObjectURL(e.target.files[0]) })} - // /> - //
- // ) : ( - // - // ); - - - // }; render() { @@ -83,7 +69,7 @@ class Editor extends React.Component { type="text" value={this.state.title} placeholder="Enter title here" - className="border text-gray-700 text-xl rounded p-2 h-24" + className="focus:outline-none border text-gray-700 text-xl rounded p-2 h-24" onChange={(e) => this.setState({ title: e.target.value })} />
@@ -94,7 +80,7 @@ class Editor extends React.Component { type="text" value={this.state.author} placeholder="Author" - className="border text-gray-700 text-xl rounded bg-white p-2" + className="focus:outline-none border text-gray-700 text-xl rounded bg-white p-2" onChange={(e) => this.setState({ author: e.target.value })} >
@@ -111,7 +97,7 @@ class Editor extends React.Component { onChange={(e) => this.setState({ font: e.target.value })} - className=" text-gray-700 text-xl p-2 rounded border"> + className="focus:outline-none text-gray-700 text-xl p-2 rounded border"> @@ -148,14 +134,14 @@ class Editor extends React.Component { onChange={(selectedOption) => this.setState({ icon: selectedOption })} options={this.state.devIconOptions} formatOptionLabel={this.formatOptionLabel} - className="text-xl text-gray-700" + className="outline-none focus:outline-none text-xl text-gray-700" /> {this.state.icon.label === 'custom' ?
this.setState({ 'customIcon': URL.createObjectURL(e.target.files[0]) })} />
@@ -170,7 +156,7 @@ class Editor extends React.Component { Pattern this.setState({ platform: e.target.value })} + value={this.state.platform} + + className="focus:outline-none text-gray-700 text-xl p-2 rounded border"> + + + + + + + + Made with 💖 by Rutik Wankhade + target="_blank" rel="noopener noreferrer" className="underline hover:text-purple-400">Rutik Wankhade diff --git a/src/components/Themes/BasicTheme.js b/src/components/Themes/BasicTheme.js index 2663aa6..30999f1 100644 --- a/src/components/Themes/BasicTheme.js +++ b/src/components/Themes/BasicTheme.js @@ -2,11 +2,11 @@ import React from 'react'; const BasicTheme = ({ config }) => { - const { title, bgColor, pattern, author, icon, font, customIcon } = config; + const { title, bgColor, pattern, author, icon, font, customIcon,platform } = config; return (
-
@@ -18,7 +18,7 @@ const BasicTheme = ({ config }) => {
-
+
{ customIcon ?
diff --git a/src/components/Themes/ModernTheme.js b/src/components/Themes/ModernTheme.js index d8a518b..edc1c83 100644 --- a/src/components/Themes/ModernTheme.js +++ b/src/components/Themes/ModernTheme.js @@ -3,19 +3,19 @@ import React from 'react'; const ModernTheme = ({ config }) => { - const { title, bgColor, pattern, author, icon, font, customIcon } = config; + const { title, bgColor, pattern, author, icon, font, customIcon, platform } = config; return ( -
-
-
+
+
{ customIcon ? -
- img +
+ img
:
diff --git a/src/components/Themes/OutlineTheme.js b/src/components/Themes/OutlineTheme.js index 52e54b4..b287097 100644 --- a/src/components/Themes/OutlineTheme.js +++ b/src/components/Themes/OutlineTheme.js @@ -1,27 +1,21 @@ import React from 'react'; const OutlineTheme = ({ config }) => { - const { title, bgColor, pattern, author, icon, font, customIcon } = config; + const { title, bgColor, pattern, author, icon, font, customIcon, platform } = config; return (
-
-
-
-
-

{title}

-
-
- - +
+

{title}

-
+
{ customIcon ?
diff --git a/src/components/Themes/PreviewTheme.js b/src/components/Themes/PreviewTheme.js index 63643a7..28e97f0 100644 --- a/src/components/Themes/PreviewTheme.js +++ b/src/components/Themes/PreviewTheme.js @@ -1,7 +1,7 @@ import React, { useState } from 'react'; const PreviewTheme = ({ config }) => { - const {bgColor } = config; + const {bgColor, platform } = config; const [image, setImage] = useState() @@ -9,7 +9,7 @@ const PreviewTheme = ({ config }) => {
-
@@ -30,7 +30,7 @@ const PreviewTheme = ({ config }) => { className="text-xl cursor-pointer mb-2 bg-white rounded border" onChange={(e) => setImage(URL.createObjectURL(e.target.files[0]))} /> - Upload a screenshot of your app + click to upload a screenshot
}