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

introduced proptypes #3

Open
wants to merge 1 commit 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
9 changes: 8 additions & 1 deletion app/(pages)/about/Member.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import PropTypes from 'prop-types';

export default function Member({photo, position, email}){
return(
<div>

</div>
)
}
}

Member.propTypes = {
photo: PropTypes.object.isRequired,
position: PropTypes.string.isRequired,
email: PropTypes.string.isRequired
};
15 changes: 14 additions & 1 deletion app/(pages)/blogs/BlogCard.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Image from "next/image";
import PropTypes from 'prop-types';

export default function BlogCard({ title, descrip, img, link, date }) {
return (
Expand All @@ -15,7 +16,7 @@ export default function BlogCard({ title, descrip, img, link, date }) {
src={img}
className="w-full h-full object-cover"
loading="eager"
alt=" "
alt={title}
/>
</div>
<header>
Expand All @@ -35,3 +36,15 @@ export default function BlogCard({ title, descrip, img, link, date }) {
</a>
);
}

BlogCard.propTypes = {
title: PropTypes.string.isRequired,
descrip: PropTypes.string.isRequired,
img: PropTypes.object.isRequired,
link: PropTypes.string.isRequired,
date: PropTypes.string.isRequired
};

// added proptypes to blogcard, blogdescrip, figure, member
// catches prop bugs.
// plus we don't need typescript changes
8 changes: 8 additions & 0 deletions app/(pages)/blogs/BlogDescrip.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Image from "next/image";
import PropTypes from 'prop-types';
import Divider from "@/public/images/assets/blog-date-divider.png";

export default function BlogDescrip({ title, body, date, description }) {
Expand Down Expand Up @@ -29,3 +30,10 @@ export default function BlogDescrip({ title, body, date, description }) {
</section>
);
}

BlogDescrip.propTypes = {
title: PropTypes.string.isRequired,
body: PropTypes.node.isRequired,
date: PropTypes.string.isRequired,
description: PropTypes.string.isRequired
};
7 changes: 7 additions & 0 deletions app/(pages)/blogs/Figure.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Image from "next/image";
import PropTypes from 'prop-types';

export default function Figure({ img, descrip, number }) {
return (
Expand All @@ -12,3 +13,9 @@ export default function Figure({ img, descrip, number }) {
</div>
);
}

Figure.propTypes = {
img: PropTypes.object.isRequired,
descrip: PropTypes.string.isRequired,
number: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired
};