-
Notifications
You must be signed in to change notification settings - Fork 1
Blog branch #33
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
base: main
Are you sure you want to change the base?
Blog branch #33
Conversation
…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
Signed-off-by: Motunrayo Adeneye <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
src/app/blog/BlogCard.tsx
Outdated
|
|
||
| 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; |
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.
This can just be NEWS_API_KEY
src/app/blog/BlogCard.tsx
Outdated
| const [currentPage, setCurrentPage] = useState(1); | ||
| const [totalResults, setTotalResults] = useState(0); | ||
|
|
||
| const PAGE_SIZE = 6; |
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.
This and line 27 below can be put outside the React function
src/app/lib/supabaseClient.ts
Outdated
|
|
||
| const SUPABASE_URL = "https://uwaealrpqxidfqcdtqac.supabase.co"; | ||
| const SUPABASE_ANON_KEY = | ||
| "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InV3YWVhbHJwcXhpZGZxY2R0cWFjIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDM5NDkwOTgsImV4cCI6MjA1OTUyNTA5OH0.5hV2m3HWEItKISvU2aNUy56ToweNxqsNo9yO0jyoB5g"; |
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.
You should use an env var for this
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.
oh...
src/app/lib/supabaseClient.ts
Outdated
| "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InV3YWVhbHJwcXhpZGZxY2R0cWFjIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDM5NDkwOTgsImV4cCI6MjA1OTUyNTA5OH0.5hV2m3HWEItKISvU2aNUy56ToweNxqsNo9yO0jyoB5g"; | ||
|
|
||
| const SUPABASE_URL = process.env.NEXT_PUBLIC_SUPABASE_URL!; | ||
| const SUPABASE_ANON_KEY = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!; |
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.
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
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.
This
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.
I found out that the api is only used in local server and not in production
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.
Even if. It's a secret, it should not be visible to the public
This include the setup of the blog section