Skip to content

Commit

Permalink
Merge pull request Techtonica#1907 from Techtonica/dependabot/npm_and…
Browse files Browse the repository at this point in the history
…_yarn/projects/Template2023Projects/client/webpack-5.76.2

Adding one router rout
  • Loading branch information
daaimah123 authored Aug 19, 2024
2 parents 411e488 + 4d24056 commit 21d3a08
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 1 deletion.
2 changes: 1 addition & 1 deletion projects/2023TemplateWithVite/client/package-lock.json

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

4 changes: 4 additions & 0 deletions projects/2023TemplateWithVite/client/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,7 @@ button.btn.btn-primary {
margin-left: 2em;
margin-right: 2em;
}

#contact{
padding: 5em;
}
49 changes: 49 additions & 0 deletions projects/2023TemplateWithVite/client/src/components/contact.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@


export default function Contact() {
const contact = {
first: "Cristina",
last: "Rodriguez",
avatar: "https://placekitten.com/g/200/200",
twitter: "yosola",
notes: "Some notes",
favorite: true,
};

return (
<div id="contact">
<div>
<img
key={contact.avatar}
src={contact.avatar || null}
/>
</div>

<div>
<h1>
{contact.first || contact.last ? (
<>
{contact.first} {contact.last}
</>
) : (
<i>No Name</i>
)}{" "}
</h1>

{contact.twitter && (
<p>
<a
target="_blank"
href={`https://twitter.com/${contact.twitter}`}
>
{contact.twitter}
</a>
</p>
)}

{contact.notes && <p>{contact.notes}</p>}

</div>
</div>
)
}
16 changes: 16 additions & 0 deletions projects/2023TemplateWithVite/client/src/components/error-page.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { useRouteError } from "react-router-dom";

export default function ErrorPage() {
const error = useRouteError();
console.error(error);

return (
<div id="error-page">
<h1>Oops Techtonica template apologizes!!</h1>
<p>Sorry, an unexpected error has occurred.</p>
<p>
<i>{error.statusText || error.message}</i>
</p>
</div>
);
}

0 comments on commit 21d3a08

Please sign in to comment.