diff --git a/src/components/ComponentToImg.js b/src/components/ComponentToImg.js index cabd57f..15336d2 100644 --- a/src/components/ComponentToImg.js +++ b/src/components/ComponentToImg.js @@ -26,7 +26,7 @@ const ComponentToImg = (props) => { // exportComponentAsPNG(componentRef, 'cover') // console.log(unsplashImage.downloadLink) - unsplash.photos.trackDownload({ downloadLocation: unsplashImage.downloadLink, }); + // unsplash.photos.trackDownload({ downloadLocation: unsplashImage.downloadLink, }); const element = componentRef.current; // You can use element's ID or Class here // console.log(element) @@ -42,7 +42,9 @@ const ComponentToImg = (props) => { height: element.offsetHeight + "px", } }) - await saveImage(data) + + console.log(data) + await saveImage(data); } diff --git a/src/components/CoverImage.js b/src/components/CoverImage.js index e5322bd..4c6b64e 100644 --- a/src/components/CoverImage.js +++ b/src/components/CoverImage.js @@ -6,7 +6,7 @@ import BasicTheme from "./Themes/BasicTheme"; import OutlineTheme from "./Themes/OutlineTheme"; import PreviewTheme from "./Themes/PreviewTheme"; import StylishTheme from "./Themes/StylishTheme"; - +import MobileMockupTheme from "./Themes/MobileMockupTheme"; const CoverImage = (props) => { // hexToRgbA(hex, opacity) { @@ -31,6 +31,7 @@ const CoverImage = (props) => { case 'outline': return case 'preview': return case 'stylish': return + case 'mobile': return default: return } diff --git a/src/components/Editor.js b/src/components/Editor.js index 3509f33..7b62c5a 100644 --- a/src/components/Editor.js +++ b/src/components/Editor.js @@ -17,14 +17,14 @@ import theme5 from '../assets/images/theme5.webp' const defaultSettings = { title: "A begineers guide to frontend development", - bgColor: "#ffe9e3", + bgColor: "#949ee5", pattern: "", download: "PNG", author: 'Rutik Wankhade', icon: { 'label': 'react', 'value': 'react' }, devIconOptions: {}, font: 'font-Anek', - theme: 'stylish', + theme: 'mobile', customIcon: '', platform: 'hashnode' diff --git a/src/components/Themes/MobileMockupTheme.js b/src/components/Themes/MobileMockupTheme.js new file mode 100644 index 0000000..c55274e --- /dev/null +++ b/src/components/Themes/MobileMockupTheme.js @@ -0,0 +1,67 @@ +import React, { useState } from 'react'; + +const MobileMockupTheme = ({ config }) => { + const { bgColor, platform, title } = config; + + const [image, setImage] = useState() + + return ( +
+ + +
+ + +

{title}

+ +
+
+ +
+ +
+
+ +
+ + +
+ + + + {image ? +
+ preview + +
+ : +
+ setImage(URL.createObjectURL(e.target.files[0]))} + /> + click to upload a screenshot +
+ + } +
+ + + + + +
+ + +
+ ); +} + +export default MobileMockupTheme; \ No newline at end of file