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

feat(aastu-web-1): added animation on scroll #459

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
26 changes: 26 additions & 0 deletions aastu/web/group-1/a2sv-blogs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions aastu/web/group-1/a2sv-blogs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"@types/node": "20.5.1",
"@types/react": "18.2.20",
"@types/react-dom": "18.2.7",
"aos": "^2.3.4",
"autoprefixer": "10.4.15",
"classnames": "^2.3.2",
"eslint": "8.47.0",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
"use client";
import { useAuth } from "@/hooks/useAuth";
import { resetAuth } from "@/lib/redux/slices/authSlice";
import Image from "next/image";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { useEffect, useState } from "react";
import { useDispatch } from "react-redux";

export default function page() {
const [email, setEmail] = useState<string>("");
const [name, setName] = useState<string>("");
const [password, setPassword] = useState<string>("");

const dispatch = useDispatch();
const {
auth: { isAuthenticated, error, isLoading },
signupHandler,
Expand Down Expand Up @@ -75,6 +77,23 @@ export default function page() {
<span className="text-primary ">Please register </span>
into the system!
</h4>
{error && (
<div className="w-full bg-red-400 text-white rounded-lg py-1 flex items-center justify-center space-x-5">
<Image
src="/images/sign-error.svg"
width={23}
height={23}
alt="error sign"
className="object-contain cursor-pointer"
onClick={() => dispatch(resetAuth())}
/>
<p>
{error?.status === "FETCH_ERROR"
? "Network Error"
: error?.data.message}
</p>
</div>
)}
<form className="py-4 flex flex-col" onSubmit={handleSubmit}>
<input
type="email"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,18 @@ const Blog = ({ params }: { params: { id: string } }) => {
if (!blogData) {
return <div>No blog data available.</div>;
}

console.log(blogData);
return (
<div className="md:p-20 p-5 flex flex-col items-center gap-10">
<div className="flex flex-col items-center gap-4 mt-24">
<h1 className="text-3xl font-french md:max-md:max-lg:text-xl">
{blogData.title}
</h1>
<p className="font-montserrat uppercase text-xs text-center">
{blogData.tags.map((tag: any, index: any) =>
index != blogData.tags.length - 1 ? `${tag}, ` : tag
)}
{blogData.tags &&
blogData.tags.map((tag: any, index: any) =>
index != blogData.tags.length - 1 ? `${tag}, ` : tag
)}
</p>
</div>
{blogData.image && (
Expand All @@ -43,9 +44,9 @@ const Blog = ({ params }: { params: { id: string } }) => {
width={1000}
height={450}
/>
)}{" "}
)}
<div className="flex flex-col items-center gap-2">
{blogData.author && (
{blogData.author && blogData.author.image && (
<Image
src={blogData.author.image}
alt="author image"
Expand All @@ -59,13 +60,16 @@ const Blog = ({ params }: { params: { id: string } }) => {
</p>
</div>
<div className="md:px-32 flex flex-col gap-8 text-justify py-4">
{blogData.description.split("\n").map((paragraph: any, index: any) => (
<p
key={index}
className="font-montserrat text-sm text-left"
dangerouslySetInnerHTML={{ __html: paragraph }}
></p>
))}
{blogData.description &&
blogData.description
.split("\n")
.map((paragraph: any, index: any) => (
<p
key={index}
className="font-montserrat text-sm text-left"
dangerouslySetInnerHTML={{ __html: paragraph }}
></p>
))}
</div>
<div className="text-left w-full flex flex-col gap-12">
<h1 className="font-montserrat text-xl font-bold">Related Blogs</h1>
Expand Down
Loading