Skip to content

Conversation

@motuncoded
Copy link
Owner

This include the setup of the blog section

…dated category.json, and refactored category.tsx and Footer.tsx components"

Signed-off-by: Motunrayo Adeneye <[email protected]>
This commit introduces the category section of the website and the set up of the aet category page
@motuncoded motuncoded added the enhancement New feature or request label Apr 7, 2025
@motuncoded motuncoded self-assigned this Apr 7, 2025
@vercel
Copy link

vercel bot commented Apr 7, 2025

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

Name Status Preview Comments Updated (UTC)
edulearning ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 7, 2025 5:26pm
edulearning-17en ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 7, 2025 5:26pm


const PAGE_SIZE = 6;
const NEWS_URL = `https://newsapi.org/v2/everything?q=learning&from=2025-03-06&sortBy=publishedAt&pageSize=${PAGE_SIZE}&page=${currentPage}&apiKey=9bb1ce4f63d74db08d7433bd4bfd17a5`;
const NEXT_PUBLIC_NEWS_API_KEY = process.env.NEXT_PUBLIC_NEWS_API_KEY;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This can just be NEWS_API_KEY

const [currentPage, setCurrentPage] = useState(1);
const [totalResults, setTotalResults] = useState(0);

const PAGE_SIZE = 6;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This and line 27 below can be put outside the React function


const SUPABASE_URL = "https://uwaealrpqxidfqcdtqac.supabase.co";
const SUPABASE_ANON_KEY =
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InV3YWVhbHJwcXhpZGZxY2R0cWFjIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDM5NDkwOTgsImV4cCI6MjA1OTUyNTA5OH0.5hV2m3HWEItKISvU2aNUy56ToweNxqsNo9yO0jyoB5g";
Copy link
Collaborator

Choose a reason for hiding this comment

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

You should use an env var for this

Copy link
Owner Author

Choose a reason for hiding this comment

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

oh...

"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InV3YWVhbHJwcXhpZGZxY2R0cWFjIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDM5NDkwOTgsImV4cCI6MjA1OTUyNTA5OH0.5hV2m3HWEItKISvU2aNUy56ToweNxqsNo9yO0jyoB5g";

const SUPABASE_URL = process.env.NEXT_PUBLIC_SUPABASE_URL!;
const SUPABASE_ANON_KEY = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This looks like it only runs on the server, and as such, you should not save the key with PUBLIC, because PUBLIC is exposed to the frontend

Copy link
Collaborator

Choose a reason for hiding this comment

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

This

Copy link
Owner Author

@motuncoded motuncoded Apr 7, 2025

Choose a reason for hiding this comment

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

I found out that the api is only used in local server and not in production

Copy link
Collaborator

Choose a reason for hiding this comment

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

Even if. It's a secret, it should not be visible to the public

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants