Skip to content
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 the hide blog feature #50

Merged

Conversation

akshidas
Copy link
Contributor

Add a new field in the yourData.json named hideBlog which is a boolean field.

In the Header/index.js used logical and operator to hide the navItem

yourData.json named "hideBlog". and hid the blog values from navigation.
@netlify
Copy link

netlify bot commented Jul 10, 2022

Deploy Preview for react-portfolio-template ready!

Name Link
🔨 Latest commit 4763878
🔍 Latest deploy log https://app.netlify.com/sites/react-portfolio-template/deploys/62cad30eba9a8f0009f795db
😎 Deploy Preview https://deploy-preview-50--react-portfolio-template.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Owner

@chetanverma16 chetanverma16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome
Looks Great!

@chetanverma16
Copy link
Owner

chetanverma16 commented Jul 10, 2022

Go ahead And merge Away 🚀

@akshidas
Copy link
Contributor Author

Go ahead And merge Away rocket

I can't merge this. I don't have write access, only you can merge

@Aryan3212
Copy link
Contributor

Hi nice job! Just a question, if someone were to put in /blog after the URL, wouldn't the route still exist? We are only removing the button here. Maybe we can work on this enhancement later. A very minor issue tbh, great work on the commit 😄

@@ -120,6 +120,9 @@ export default {
aboutpara:
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
// End About Section ---------------------

// Hide Blog section
hideBlog: true,
Copy link
Contributor

@Aryan3212 Aryan3212 Jul 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be moved to the top of the json file? It may be more helpful to keep it at the top.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this makes sense.

{data.name}.
</h1>
{!isBlog ? (
<div className="flex">
<Button onClick={handleWorkScroll}>Work</Button>
<Button onClick={handleAboutScroll}>About</Button>
<Button onClick={() => router.push("/blog")}>Blog</Button>
{!data.hideBlog && (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we destructure this variable from the data object? Just makes it a bit more readable.

Copy link
Owner

@chetanverma16 chetanverma16 Jul 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@achu-krishna Once you are done with this resolution we can merge!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chetanverma16 @Aryan3212 Sure I will do it ASAP

@chetanverma16 chetanverma16 linked an issue Jul 11, 2022 that may be closed by this pull request
@akshidas
Copy link
Contributor Author

akshidas commented Jul 11, 2022

Hi nice job! Just a question, if someone were to put in /blog after the URL, wouldn't the route still exist? We are only removing the button here. Maybe we can work on this enhancement later. A very minor issue tbh, great work on the commit 😄

I noticed that too. We could create a new issue for that

@akshidas akshidas closed this Jul 11, 2022
@akshidas akshidas reopened this Jul 11, 2022
@Aryan3212
Copy link
Contributor

Hi nice job! Just a question, if someone were to put in /blog after the URL, wouldn't the route still exist? We are only removing the button here. Maybe we can work on this enhancement later. A very minor issue tbh, great work on the commit 😄

I noticed that too. We could create a new issue for that

@achu-krishna For sure!

@chetanverma16
Copy link
Owner

Yeah,
this is a quick fix as of now to hide the blog.
but we can surely work later on for a better approach to this problem.

@achu-krishna Nice Work!

@chetanverma16 chetanverma16 merged commit f3b9648 into chetanverma16:main Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability To Hide Blog From Navigation from yourData.js
3 participants