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

ft/Removed hard coded content #246

Merged
merged 37 commits into from
Sep 9, 2022
Merged

Conversation

kelvinkipruto
Copy link
Contributor

Description

This PR intends to remove hard-coded content and move it to CMS

Fixes #242

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

@vercel
Copy link

vercel bot commented Sep 2, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
codeforafrica ✅ Ready (Inspect) Visit Preview Sep 9, 2022 at 1:55PM (UTC)

Copy link
Member

@kilemensi kilemensi left a comment

Choose a reason for hiding this comment

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

I still don't grok your approach @kelvinkipruto ... but, my current thinking is:

  1. slug is just another field that can be returned from getCollectionBySlug. No need to do anything special to handle it.
  2. If we need to add a new component, we'll add it to existing page(s).

If there is a situation that necessitates straying away from the above path, let us know.

apps/codeforafrica/src/pages/api/admin/config.js Outdated Show resolved Hide resolved
Update get-in-touch as test case
@kelvinkipruto
Copy link
Contributor Author

@kilemensi As mentioned in the call, I don't think it will be possible to remove all hard coded content. The above solution works for situations where the props does not require a key like getHero here or getOurImpact here. When props property keys are required like partners: getOurPartners() or here for example, we'll need to hard-code the slugs and titles.

@kelvinkipruto
Copy link
Contributor Author

@kilemensi Wow 🤯🤩. Thanks. Let me go through it and see how I should have done it.

Copy link
Member

@kilemensi kilemensi left a comment

Choose a reason for hiding this comment

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

🚀


Create and include changeset @kelvinkipruto

@kelvinkipruto kelvinkipruto merged commit b01498e into main Sep 9, 2022
@kelvinkipruto kelvinkipruto deleted the ft/remove-hard-coded-content branch September 9, 2022 14:07
@kilemensi
Copy link
Member

Where is the changeset @kelvinkipruto ?

🚀


Create and include changeset @kelvinkipruto

@kelvinkipruto kelvinkipruto restored the ft/remove-hard-coded-content branch September 12, 2022 04:02
@kelvinkipruto
Copy link
Contributor Author

ooh, no, Let me try fix it.

@kilemensi kilemensi deleted the ft/remove-hard-coded-content branch October 21, 2022 06:50
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.

Review lib/index.js for any remaining hard-coded strings
2 participants