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

Version 3 - BunnieAbc (2024) #31

Open
wants to merge 73 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
fd65fd4
Initailize BunnieABC v2 coprate site
tito-arch Nov 19, 2023
262206f
Docs: remove ReadME boilerplate doc.
tito-arch Nov 19, 2023
2f9ca77
Deps: update project deps
tito-arch Nov 19, 2023
b7d509a
Add: page title and description
tito-arch Nov 19, 2023
29ee3d8
Add: favicon images [brand files]
tito-arch Nov 19, 2023
30ca84d
Cleanup: move unused assets to public folder
tito-arch Nov 19, 2023
5cde0f4
clean up: remove next js boiler plate code
tito-arch Nov 19, 2023
7e2f46c
Clean up: move assets to public folder
tito-arch Nov 19, 2023
3c9ffda
Chore: update tailwind config
tito-arch Nov 19, 2023
37917f0
Add: home page mark up and some styling, nothing fancy
tito-arch Nov 19, 2023
eacf544
Merge branch 'v2-main' of https://github.com/tito-arch/bunniestoreken…
tito-arch Nov 23, 2023
c5d590e
Add: local proxy server
tito-arch Nov 26, 2023
027ff30
Chore: Add Axios, express, fast-xml-parser
tito-arch Nov 26, 2023
becd289
Add: call blogs component [test purposes]
tito-arch Nov 26, 2023
944790e
Add: blogs component
tito-arch Nov 26, 2023
8631203
Feat: Fetch and map all blog posts from RSS feed
tito-arch Nov 26, 2023
c53c5ad
Deps: add he - Html Elements to parse Ascii to text
tito-arch Nov 26, 2023
7fefa84
Feat: Fetch and Display Random Tech Blog Previews
tito-arch Nov 26, 2023
ff20905
Add: new blogs page route
tito-arch Nov 26, 2023
ab1933b
Add: footer with adress, import the blogs component
tito-arch Dec 1, 2023
b8b7395
Add: responsive grid layout to show blogs
tito-arch Dec 1, 2023
7198a19
Refactor: render the blogs component as a separate page
tito-arch Dec 1, 2023
0f92ad1
Deprecated:
tito-arch Dec 1, 2023
73216db
Add: arrow buttons to move to next page
tito-arch Dec 2, 2023
052eb81
Update: .gitignore file to ignore .env files
tito-arch Dec 21, 2023
7d1e0bc
Add: add whitelisted domains
tito-arch Dec 21, 2023
720853c
Chore: add react-icons and unsplash sdk
tito-arch Dec 21, 2023
9db1758
Add: import unsplash
tito-arch Dec 21, 2023
657dd1d
Feat: blog post preview page
tito-arch Dec 21, 2023
48e8956
Add: simple node js proxy for local development
tito-arch Dec 21, 2023
fd0d2f4
Add: client component to fetch unsplash images given a query
tito-arch Dec 21, 2023
23c7e36
Add: static assets
tito-arch Jan 4, 2024
5f9fb3c
Feat: add staff showcase [demo]
tito-arch Jan 4, 2024
c69f007
Styles: add header styles and header image
tito-arch Jan 6, 2024
65f744d
Add: problem statement images
tito-arch Jan 13, 2024
865481a
Debug value: log all links in the console
tito-arch Jan 13, 2024
b7aef76
Typo:
tito-arch Jan 13, 2024
92d3454
Add: shadcn ui components
tito-arch Jan 15, 2024
bce0392
Add: refactor card component
tito-arch Jan 15, 2024
d26a544
Add: leads form :shadcn ui
tito-arch Jan 15, 2024
e128990
connect vercel serverless function, Exhausted AF
tito-arch Jan 20, 2024
f810023
update endpoint
tito-arch Jan 20, 2024
c71b79a
Chore: update dependancies
tito-arch Jan 20, 2024
e661a54
Feat: alert user form was successfully submitted
tito-arch Jan 20, 2024
d01d54d
Vamos: form 90% done
tito-arch Jan 20, 2024
e1f0ec9
touch ups
tito-arch Jan 20, 2024
0d1f6ca
update FAQ section
tito-arch Jan 20, 2024
97e5aa1
Polishing up adjust withs and paddings
tito-arch Jan 20, 2024
bf1dd03
Fix: card padding x
tito-arch Jan 20, 2024
b5abe4f
Chore: update project dependancies
tito-arch Jan 23, 2024
2ff2104
Feat: add id to form component
tito-arch Jan 23, 2024
8c7f7c3
Refactor: fetch blogs on the server server components
tito-arch Jan 26, 2024
9b81685
Chore: allow domain specific images
tito-arch Jan 28, 2024
6b96ad3
Fix: render nav and footer in all pages by default
tito-arch Jan 28, 2024
fd89e9c
Cleanup: create nav and footer reusable components
tito-arch Jan 28, 2024
5e50b0a
Refactor: change fetcing and rendering logic to server component. Ref…
tito-arch Jan 28, 2024
4e9a1c1
FIx: move footer and nav components
tito-arch Jan 28, 2024
41aa97e
Add: loading GIF: Giphy
tito-arch Jan 28, 2024
e1cf25b
Merge pull request #34 from tito-arch/server-side-components
tito-arch Jan 28, 2024
0c0519d
Winding up !
tito-arch Feb 3, 2024
2aae8ae
.
tito-arch Feb 4, 2024
2c9cae0
Merge pull request #35 from tito-arch/server-side-components
tito-arch Feb 4, 2024
9bcb302
Add: microsoft clarity
tito-arch Feb 4, 2024
656135a
fix: ms clarity tracking implementation
tito-arch Feb 4, 2024
e9d6b00
fix: check if window is defined
tito-arch Feb 4, 2024
0d9f4ce
Merge pull request #36 from tito-arch/server-side-components
tito-arch Feb 4, 2024
5ce2e24
update personal page link
tito-arch Feb 4, 2024
a458c66
Update project dependancies
tito-arch Mar 2, 2024
bc77e8f
Add: pass set selected plan function as a prop
tito-arch Mar 2, 2024
c0fc0b3
Pass selected plan to the formData component
tito-arch Mar 2, 2024
f95b9c8
Add, shadcn ui tabs component
tito-arch Mar 2, 2024
9d59edb
Add: A note to the people
tito-arch Mar 2, 2024
4729e6b
Merge pull request #37 from tito-arch/server-side-components
tito-arch Mar 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
41 changes: 0 additions & 41 deletions .github/workflows/Pr-Title.yaml

This file was deleted.

71 changes: 0 additions & 71 deletions .github/workflows/apisec-scan.yml

This file was deleted.

22 changes: 18 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,34 @@
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*
.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
46 changes: 29 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
# BunnieABC
This code base powers the BunnieABC corporate site. Feel free to submit issues.
## Commit messages conventions.
Available types:
- feat: A new feature
- fix: A bug fix
- docs: Documentation only changes
- style: Changes that do not affect the meaning of the code (white space, formatting, missing semi-colons, etc)
- refactor: A code change that neither fixes a bug nor adds a feature
- perf: A code change that improves performance
- test: Adding missing tests or correcting existing tests
- build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
- ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
- chore: Other changes that don't modify src or test files
- revert: Reverts a previous commit

Pull reguest titles not following these conventions will be declined.
## bUnNiEAbc••
Next 2024 BunnieAbc Client App. Built on NextJs A framework of a framework if that makes sense, follow along.

Check out the official NextJS docs.

------

## Getting Started
Run `npm install`

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```


- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!


152 changes: 152 additions & 0 deletions app/blog/Blogs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
"use client";

import { useState, useEffect } from "react";
import MyArticlesData from "../server/getBlogs";
import { IoMdCalendar } from "react-icons/io";
import Image from "next/image";
import LoadingGif from "../../public/assets/BunnieLoading.gif";

function Blogs() {
const [articlesData, setArticlesData] = useState([]);
const [loading, setLoading] = useState(true);
const [currentPage, setCurrentPage] = useState(1);
const [postsPerPage] = useState(9);

useEffect(() => {
const fetchData = async () => {
try {
// Fetch article data from the server
const data = await MyArticlesData();

// Update state with the fetched data
setArticlesData(data);
console.log(articlesData);

// Set loading to false
setLoading(false);
} catch (error) {
console.error("Error fetching articles:", error);
// Handle the error as needed
setLoading(false);
}
};

// Fetch data when the component mounts
fetchData();
}, []);

// Logic for pagination
const indexOfLastPost = currentPage * postsPerPage;
const indexOfFirstPost = indexOfLastPost - postsPerPage;
const currentPosts = articlesData.slice(indexOfFirstPost, indexOfLastPost);

// Function to change the current page
const paginate = (pageNumber) => setCurrentPage(pageNumber);

// Format date string
const formatDate = (dateString) => {
const options = {
year: "numeric",
month: "long",
day: "numeric",
};
return new Date(dateString).toLocaleDateString("en-US", options);
};

// Truncate text for uniformity
function truncateText(text, max_length = 120) {
// Truncates text to a given length with ellipses
if (text.length <= max_length) {
return text;
}
return text.substring(0, max_length - 3) + "...";
}

return (
<div className="md:ml-8 my-3">
{loading ? (
<div className="min-h-screen flex items-center justify-center">
<div className="text-center">
<div className="rounded-full overflow-hidden">
<Image className="w-22 h-22" src={LoadingGif} alt="Loading GIF" />
</div>
<h1 className="text-2xl font-semibold mt-4">Hmmm! </h1>
</div>
</div>
) : (
<div>
<div className="grid grid-cols-1 md:grid-cols-3 gap-4 md:m-0 ">
{currentPosts.map((article, index) => (
<div
key={index}
className="bg-white max-w-sm rounded-lg shadow-md overflow-hidden "
>
<Image
src={article.image}
alt={article.title || "No Title"}
className="w-full"
width={300}
height={300}
/>
<div className="p-4">
<div className="flex justify-between items-start">
<div className="flex items-center">
<p className="text-gray-800 font-semibold">
{article.author || "Unknown"}
</p>
<IoMdCalendar className="ml-2 text-gray-400" />
<p className="text-gray-400 ml-1">
{formatDate(article.datePublished)}
</p>
</div>
</div>
<a
href={article.link}
target="_blank"
rel="noopener noreferrer"
className="mt-2 text-xl font-bold hover:underline"
>
{truncateText(article.title || "No Title", 120)}
</a>
<p className="text-gray-700">
Description:{" "}
{truncateText(
article.description || "No description available.",
120
)}
</p>
</div>
</div>
))}
</div>
<div className="flex justify-center mt-4">
{/* Pagination */}
<nav>
<ul className="pagination flex gap-2">
{[
...Array(
Math.ceil(articlesData.length / postsPerPage)
).keys(),
].map((number) => (
<li key={number} className="page-item">
<a
onClick={() => paginate(number + 1)}
href="#"
className={`page-link ${
currentPage === number + 1 ? "active" : ""
}`}
>
{number + 1}
</a>
</li>
))}
</ul>
</nav>
</div>
</div>
)}
</div>
);
}

export default Blogs;
9 changes: 9 additions & 0 deletions app/blog/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Blogs from "./Blogs";

export default function Blog() {
return (
<div>
<Blogs />
</div>
);
}
Binary file added app/favicon.ico
Binary file not shown.
Loading
Loading