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

Refactor: include company name in copyright text #1416

Merged
merged 24 commits into from
Aug 25, 2024
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b526469
Feat: remove checkbox in register page
Feng-09 Aug 18, 2024
9920221
Feat: remove option to create org on sign up
Feng-09 Aug 18, 2024
d08f7a1
Fix: resolve merge conflicts
Feng-09 Aug 19, 2024
2b3a371
Merge branch 'dev' of https://github.com/Feng-09/hng_boilerplate_next…
Feng-09 Aug 23, 2024
4cb4336
refactor: Add website name to All Rights Reserved text external pages…
Feng-09 Aug 23, 2024
841e193
Merge branch 'dev' of https://github.com/Feng-09/hng_boilerplate_next…
Feng-09 Aug 23, 2024
e2dffb2
Refactor: include company name in external page footer
Feng-09 Aug 24, 2024
1cf6379
Feat: Implement fetching blog data from backend
Feng-09 Aug 24, 2024
f209c3b
Feat: Fetch blogs from api to display in blog page
Feng-09 Aug 24, 2024
db271dc
Feat: merge conflicts
Feng-09 Aug 24, 2024
9e347df
Fix: fix typescript error
Feng-09 Aug 24, 2024
d94926e
Merge branch 'dev' into refactor/landing-page
Feng-09 Aug 24, 2024
fabe6df
Fix: Implement PR review
Feng-09 Aug 24, 2024
303c242
Merge branch 'dev' of https://github.com/Feng-09/hng_boilerplate_next…
Feng-09 Aug 24, 2024
b81cba4
Merge branch 'refactor/landing-page' of https://github.com/Feng-09/hn…
Feng-09 Aug 24, 2024
84b170e
Merge branch 'dev' into refactor/landing-page
incredible-phoenix246 Aug 24, 2024
feda449
Fix: fix lint errors
Feng-09 Aug 24, 2024
0550e06
Merge branch 'refactor/landing-page' of https://github.com/Feng-09/hn…
Feng-09 Aug 24, 2024
098684f
Merge branch 'dev' of https://github.com/Feng-09/hng_boilerplate_next…
Feng-09 Aug 24, 2024
3af8d50
Merge branch 'dev' of https://github.com/Feng-09/hng_boilerplate_next…
Feng-09 Aug 25, 2024
1d82194
Feat: implement back button in settings side nav
Feng-09 Aug 25, 2024
6aef623
Fix: install dependencies
Feng-09 Aug 25, 2024
05828af
Fix: install dependencies
Feng-09 Aug 25, 2024
140fbc5
Fix: lint errors
Feng-09 Aug 25, 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
12,529 changes: 5,764 additions & 6,765 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion public/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@
"footerBottom": {
"privacyPolicy": "Privacy Policy",
"termsOfUse": "Terms of Use",
"copyright": "2024 All Rights Reserved"
"copyright": "2024 All Rights Reserved",
"companyName": "HNG Boilerplate"
}
},
"pricing": {
Expand Down
21 changes: 1 addition & 20 deletions src/app/(auth-routes)/register/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { registerUser, resendOtp, verifyOtp } from "~/actions/register";
import CustomButton from "~/components/common/common-button/common-button";
import { Input } from "~/components/common/input";
import LoadingSpinner from "~/components/miscellaneous/loading-spinner";
import { Checkbox } from "~/components/ui/checkbox";
import {
Dialog,
DialogContent,
Expand Down Expand Up @@ -51,7 +50,6 @@ const Register = () => {
const [showOtp, setShowOtp] = useState(false);
const [timeLeft, setTimeLeft] = useState<number>(15 * 60);
const [value, setValue] = useState("");
const [createOrg, setCreateOrg] = useState<boolean>(false);

if (status === "authenticated") {
router.push("/dashboard");
Expand All @@ -73,12 +71,7 @@ const Register = () => {
startTransition(async () => {
await registerUser(values).then(async (data) => {
if (data.status === 201) {
// Handle redirection based on createOrg condition
if (createOrg) {
router.push("/register/organisation");
} else {
router.push("/login");
}
router.push("/login");

toast({
title: "Account created successfully",
Expand Down Expand Up @@ -336,18 +329,6 @@ const Register = () => {
</FormItem>
)}
/>
<div
className="flex items-center gap-2"
onClick={() => setCreateOrg((a) => !a)}
>
<Checkbox id="createOrg" />
<label
htmlFor="createOrg"
className="font-inter ms-1 text-center text-sm leading-[19.2px] hover:cursor-pointer"
>
Also create an organisation
</label>
</div>
<CustomButton
type="submit"
variant="primary"
Expand Down
73 changes: 55 additions & 18 deletions src/app/(landing-routes)/blog/[id]/RelatedArticle.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { useRouter } from "next/navigation";
// import { blogPosts } from "../data/mock";
import { useEffect, useState } from "react";

import BlogCard from "~/components/layouts/BlogCards";
import { blogPosts } from "../data/mock";

export type New = {
id: number;
Expand All @@ -10,29 +11,65 @@ export type New = {

const RelatedArticle = () => {
const router = useRouter();
const [data, setData] = useState<
{
id: string;
title: string;
date: string;
readTime: string;
category: string;
image: string;
labelClassName: string;
}[]
>([]);
const [isLoading, setIsLoading] = useState<boolean>(true);

useEffect(() => {
const fetchData = async () => {
try {
setIsLoading(true);
const response = await fetch(
`https://staging.api-csharp.boilerplate.hng.tech/api/v1/blogs`,
);
const result = await response.json();
setData(result.data);
} finally {
setIsLoading(false);
}
};

fetchData();
}, []);

return (
<>
<div className="">
<h1 className="font-inter text-center text-xl font-bold leading-[29.05px] text-[#525252] sm:text-2xl md:text-left">
Related Articles
</h1>
<div className="mt-6 grid gap-6 sm:mt-8 sm:gap-8">
{blogPosts.slice(0, 3).map((post, index) => (
<BlogCard
key={index}
title={post.title}
date={post.date}
readTime={post.readTime}
category={post.category}
image={post.image}
labelClassName={post.labelClassName}
onClick={() => {
localStorage.setItem("currentBlogPost", JSON.stringify(post));
router.push(`/blog/${post.id}`);
}}
/>
))}
</div>
{isLoading ? (
<div className="animate-pulse text-2xl font-bold">
Loading Related...
</div>
) : (
<div className="mt-6 grid gap-6 sm:mt-8 sm:gap-8">
{data?.slice(0, 3).map((post, index) => (
<BlogCard
key={index}
title={post.title}
date={post.date}
readTime={post.readTime}
category={post.category}
image={post.image}
labelClassName={post.labelClassName}
onClick={() => {
localStorage.setItem("currentBlogPost", JSON.stringify(post));
router.push(`/blog/${post.id}`);
}}
/>
))}
</div>
)}
</div>
</>
);
Expand Down
Loading
Loading