Skip to content

Commit

Permalink
refactor(Article): polish up
Browse files Browse the repository at this point in the history
issue #77
  • Loading branch information
sabertazimi committed Jul 13, 2021
1 parent f73145f commit 7bda08b
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 11 deletions.
1 change: 1 addition & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = {
facebook: 'sabertazimi',
weibo: 'sabertazimi',
email: '[email protected]',
disqusUrl: 'https://sabertaz-blog.disqus.com',
booklist: [
{
title: 'awesome-notes',
Expand Down
4 changes: 2 additions & 2 deletions src/components/Article/Article.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ const Article = ({ post }) => {
<ArticleNavigation toc={toc} />
<ArticleContent content={html} />
<ArticleDivider>{post.subtitle || 'Blog'}</ArticleDivider>
<ArticleFooter post={post} />
<ArticleFooter post={postMetadata} />
<ArticleDivider>
<Icons.Comment style={{ color: Colors.primary }} />
<Icons.Comment style={{ fontSize: '1.35em', color: Colors.primary }} />
</ArticleDivider>
<ArticleComments />
<SocialGroup />
Expand Down
5 changes: 3 additions & 2 deletions src/components/Article/ArticleComments.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React from 'react';
import { useDisqus } from 'hooks';
import { useDisqus, useSiteMetadata } from '@/hooks';
import * as styles from './ArticleComments.module.css';

const ArticleComments = () => {
useDisqus('https://http-blog-hust-cf.disqus.com');
const { disqusUrl } = useSiteMetadata();
useDisqus(disqusUrl);

return <div id="disqus_thread" className={styles.disqus} />;
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/Article/ArticleContent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const ArticleContent = ({ content }) => {
return (
<animated.div
style={props}
dangerouslySetInnerHTML={{ __html: content }}
className={styles.markdownBody}
dangerouslySetInnerHTML={{ __html: content }}
/>
);
};
Expand Down
4 changes: 2 additions & 2 deletions src/components/Article/ArticleFooter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
ArrowRightOutlined,
HomeOutlined,
} from '@ant-design/icons';
import { useResponsive } from 'hooks';
import { BreakPoints, Colors } from 'config';
import { useResponsive } from '@/hooks';
import { BreakPoints, Colors } from '@/config';
import * as styles from './ArticleFooter.module.css';

const ArticleFooter = ({ post }) => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/Article/ArticleHeader.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import { Link } from 'gatsby';
import { useSpring, animated } from 'react-spring';
import { Tag } from 'antd';
import { Colors } from 'config';
import { useSpring, animated } from 'react-spring';
import { Colors } from '@/config';

const ArticleHeader = ({ post }) => {
const props = useSpring({
Expand Down
4 changes: 2 additions & 2 deletions src/components/Article/ArticleNavigation.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useState } from 'react';
import { Button, Drawer } from 'antd';
import { CloseOutlined, MenuFoldOutlined } from '@ant-design/icons';
import { useResponsive } from 'hooks';
import { BreakPoints, Colors } from 'config';
import { useResponsive } from '@/hooks';
import { BreakPoints, Colors } from '@/config';
import * as styles from './ArticleNavigation.module.css';

const ArticleNavigation = ({ toc }) => {
Expand Down
1 change: 1 addition & 0 deletions src/hooks/useSiteMetadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const useSiteMetadata = () => {
twitter
facebook
email
disqusUrl
booklist {
title
author
Expand Down

0 comments on commit 7bda08b

Please sign in to comment.