-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added medium blogs fetch feature for blogs section #445
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/saadpasta/developer-folio/6PUQCoxizfYWep9fzYc2kpHR26Cc |
src/containers/blogs/Blogs.js
Outdated
useEffect(() => { | ||
if (blogSection.mediumUserAccount !== "") | ||
fetch( | ||
"https://api.rss2json.com/v1/api.json?rss_url=https://medium.com/feed/@" + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason why you closed this? |
Re-opening the issue (it was closed after branch rebase, sorry for that) Fetching the blogs on start makes sense. Environment variables to be set for tests: |
I will review this PR tomorrow. Thanks for the PR. |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for your contribution :) |
/> | ||
); | ||
}) | ||
: mediumBlogs.map((blog, i) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this doesn't work and broke the main site. from console:
TypeError: x.map is not a function
H Blogs.js:79
React 7
unstable_runWithPriority scheduler.production.min.js:19
React 5
y Blogs.js:11
H Blogs.js:39
promise callback*H/< Blogs.js:35
React 2
unstable_runWithPriority scheduler.production.min.js:19
React 4
unstable_runWithPriority scheduler.production.min.js:19
React 6
<anonymous> index.js:7
i (index):1
<anonymous> main.99d3a735.chunk.js:1
i (index):1
r (index):1
t (index):1
<anonymous> main.99d3a735.chunk.js:1
react-dom.production.min.js:209:194
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
displayMediumBlogs needs to be set to false in portofolio.js, I've just commited this after merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#446 - Created additional pull request
@allcontributors add @CanciuCostin for code |
I've put up a pull request to add @CanciuCostin! 🎉 |
* added medium blogs fetch * added medium args to env.example * added displayMediumBlogs to blogSection * added blogs.json parsing * renamed function and added comment for extractTextContent * removed USE_MEDIUM_DATA env variable * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * updated readme with medium blogs fetch docs * Update portfolio.js * set displayMediumBlogs default to true in portofolio.js * removed USE_MEDIUM_DATA env variable from fetch.js * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
I've added this for my personal blog and I think it would be a nice feature.
See output for my medium account (costin.canciu - https://medium.com/@costin.canciu):
The hardcoded blogs will still be displayed if the medium user account is not set in portofolio.js.