diff --git a/src/components/Editor.js b/src/components/Editor.js
index 4e735f7..8079844 100644
--- a/src/components/Editor.js
+++ b/src/components/Editor.js
@@ -25,7 +25,7 @@ const defaultSettings = {
platform: 'hashnode'
};
-const devIconsUrl = "https://mirror.20200511.xyz/https://raw.githubusercontent.com/devicons/devicon/master/devicon.json"
+const devIconsUrl = "https://raw.githubusercontent.com/devicons/devicon/master/devicon.json"
class Editor extends React.Component {
diff --git a/src/components/Themes/BasicTheme.js b/src/components/Themes/BasicTheme.js
index b5e6041..39d6a32 100644
--- a/src/components/Themes/BasicTheme.js
+++ b/src/components/Themes/BasicTheme.js
@@ -1,43 +1,71 @@
-import React from 'react';
-
+import React, { useContext } from 'react';
+import { ImgContext } from '../../utils/ImgContext';
+import UnsplashSearch from '../UnsplashSearch';
const BasicTheme = ({ config }) => {
const { title, bgColor, pattern, author, icon, font, customIcon } = config;
+ const { unsplashImage, setUnsplashImage } = useContext(ImgContext);
return (
-
-
+
-
-
-
-
-
- {
- customIcon ?
-
-

+
+
+ {unsplashImage ?
+
+
+
- :
-
-
+
+
+
+
+
+
+
{title}
+
+
+
+ {
+ customIcon ?
+
+

+
+ :
+
+
+
+ }
+
{author}
+
+
+
+
+
+ :
+
+
+
}
-
-
-
{author}
-
-
-
-
);
}
diff --git a/src/components/Themes/MobileMockupTheme.js b/src/components/Themes/MobileMockupTheme.js
index 826510d..eb8e72c 100644
--- a/src/components/Themes/MobileMockupTheme.js
+++ b/src/components/Themes/MobileMockupTheme.js
@@ -1,65 +1,80 @@
-import React, { useState } from 'react';
+import React, { useState, useContext } from 'react';
+import { ImgContext } from '../../utils/ImgContext';
+import UnsplashSearch from '../UnsplashSearch';
const MobileMockupTheme = ({ config }) => {
const { bgColor, title, font } = config;
-
- const [image, setImage] = useState()
+ const { unsplashImage, setUnsplashImage } = useContext(ImgContext);
+ const [image, setImage] = useState();
return (
-
-
-
+
+ {unsplashImage ?
+
+
+

+
+
+
-
{title}
+
{title}
-
-
+
+
-
+ {image ?
+
+

+
+
+ :
+
+ setImage(URL.createObjectURL(e.target.files[0]))}
+ />
+ 点击上传截图
+
+ }
+
+
-
-
-
-
-
-
-
-
-
-
- {image ?
-
-

-
+
:
-
-
setImage(URL.createObjectURL(e.target.files[0]))}
- />
-
点击上传截图
+
+
-
}
-
-
-
-
-
-
-
);
}
diff --git a/src/components/Themes/ModernTheme.js b/src/components/Themes/ModernTheme.js
index 35205f1..51f43a5 100644
--- a/src/components/Themes/ModernTheme.js
+++ b/src/components/Themes/ModernTheme.js
@@ -1,39 +1,71 @@
-import React from 'react';
-
+import React, { useContext } from 'react';
+import { ImgContext } from '../../utils/ImgContext';
+import UnsplashSearch from '../UnsplashSearch';
const ModernTheme = ({ config }) => {
-
const { title, bgColor, pattern, author, icon, font, customIcon } = config;
+ const { unsplashImage, setUnsplashImage } = useContext(ImgContext);
return (
-
-
-
+
+
+
+ {unsplashImage ?
+
+
+

+
- {
- customIcon ?
-
-

+
+
+
+
+ {
+ customIcon ?
+
+

+
+ :
+
+
+
+ }
+
+
+
+
{title}
+ {author}
+
+
+
+
+
+
:
-
-
+
+
- }
-
-
-
-
-
{title}
- {author}
-
+ }
-
-
);
}
diff --git a/src/components/Themes/OutlineTheme.js b/src/components/Themes/OutlineTheme.js
index c1f6866..b3b4b9a 100644
--- a/src/components/Themes/OutlineTheme.js
+++ b/src/components/Themes/OutlineTheme.js
@@ -1,41 +1,69 @@
-import React from 'react';
+import React, { useContext } from 'react';
+import { ImgContext } from '../../utils/ImgContext';
+import UnsplashSearch from '../UnsplashSearch';
+
const OutlineTheme = ({ config }) => {
const { title, bgColor, author, icon, font, customIcon } = config;
+ const { unsplashImage, setUnsplashImage } = useContext(ImgContext);
return (
-
-
-
-
+
+
+
+ {unsplashImage ?
+
+
+

+
+
+
-
- {
- customIcon ?
-
-

+
+ {
+ customIcon ?
+
+

+
+ :
+
+
+
+ }
+
{title}
+
+
+
{author}
+
+
+
+
+
:
-
-
+
+
- }
-
{title}
-
-
-
-
{author}
-
+ }
-
-
-
-
-
);
}
diff --git a/src/components/Themes/PreviewTheme.js b/src/components/Themes/PreviewTheme.js
index 8999d4a..287f018 100644
--- a/src/components/Themes/PreviewTheme.js
+++ b/src/components/Themes/PreviewTheme.js
@@ -1,53 +1,79 @@
-import React, { useState } from 'react';
+import React, { useState, useContext } from 'react';
+import { ImgContext } from '../../utils/ImgContext';
+import UnsplashSearch from '../UnsplashSearch';
const PreviewTheme = ({ config }) => {
const { bgColor, title, font } = config;
-
- const [image, setImage] = useState()
+ const { unsplashImage, setUnsplashImage } = useContext(ImgContext);
+ const [image, setImage] = useState();
return (
-
-
-
+
+ {unsplashImage ?
+
+
+

+
-
{title}
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+ {image ?
+
+

+
+ :
+
+ setImage(URL.createObjectURL(e.target.files[0]))}
+ />
+ 点击上传截图
+
+ }
+
+
- {image ?
-
-

-
+
:
-
-
setImage(URL.createObjectURL(e.target.files[0]))}
- />
-
点击上传截图
+
+
-
}
-
-
);
}
diff --git a/src/components/Themes/StylishTheme.js b/src/components/Themes/StylishTheme.js
index 50d41d6..33e953f 100644
--- a/src/components/Themes/StylishTheme.js
+++ b/src/components/Themes/StylishTheme.js
@@ -6,81 +6,60 @@ const StylishTheme = ({ config }) => {
const { title, author, font, icon, customIcon, bgColor } = config;
const { unsplashImage, setUnsplashImage } = useContext(ImgContext);
-
return (
-
-
-
-
+
-
-
-
-
-
-
{title}
+
+
+
+
{title}
{
customIcon ?
-
+
:
-
+
}
-
{author}
-
-
+
{author}
-
-
{unsplashImage ?
-
-
-

-
+
+
-
-
-
-
);
}