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

Hackinrish/button #20

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
4 changes: 1 addition & 3 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const Home = () => {
return (
<div className="flex h-screen w-screen items-center justify-center">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you revert this change so it still says hello world

Hello World
</div>
<div className="flex h-screen w-screen items-center justify-center"></div>
);
};

Expand Down
17 changes: 17 additions & 0 deletions src/components/Button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Link from "next/link";
import React from "react";

interface ButtonProps {
text: string;
link: string;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of passing in a link can you pass in an arrow function here. For example it can be handleSubmit: () => void. Then this function should be called when the button component is clicked.

}

const Button = ({ text, link }: ButtonProps) => {
return (
<div className="rounded-md bg-blue-900 px-8 py-2 font-serif text-[vw] text-white">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of a div can we use the button component here. It's better for accessibility and makes more sense in this case.

<Link href={link}> {text} </Link>
</div>
);
};

export default Button;
Loading