Skip to content

Commit fe63cba

Browse files
committed
add header
1 parent 56c106f commit fe63cba

File tree

4 files changed

+50
-0
lines changed

4 files changed

+50
-0
lines changed

examples/phaser/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"react": "^18.2.0",
2424
"react-dom": "^18.2.0",
2525
"react-ga4": "^2.1.0",
26+
"react-icons": "^4.9.0",
2627
"react-router-dom": "^6.11.2",
2728
"react-scripts": "5.0.1",
2829
"regenerator-runtime": "^0.13.11",

examples/phaser/src/Game.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import AgentDisplay from "./AgentDisplay";
77
import { locations } from "./data/world";
88
import AgentChat from "./AgentChat";
99
import NotificationModal from "./NotificationModal";
10+
import Header from "./Header";
1011

1112
interface Props {
1213
openaiKey: string;
@@ -55,6 +56,7 @@ function Game(props: Props) {
5556

5657
return (
5758
<div className='p-5 overflow-scroll bg-gray-50 relative'>
59+
<Header />
5860
<AgentDisplay agent={agents[selectedAgentIndex]} />
5961
{showNotification && (
6062
<NotificationModal

examples/phaser/src/Header.tsx

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import React from "react";
2+
// import from react-icons
3+
import { FaTwitter, FaGithub, FaDiscord } from "react-icons/fa";
4+
5+
const button = [
6+
{ href: "https://twitter.com/toughyear", icon: <FaTwitter /> },
7+
{
8+
href: "https://github.com/toughyear/generative-agents",
9+
icon: <FaGithub />,
10+
},
11+
{ href: "https://discord.com/invite/9NjpMXtVaW", icon: <FaDiscord /> },
12+
];
13+
14+
function Header() {
15+
return (
16+
<section>
17+
<nav className='flex px-6 h-16 items-center justify-end gap-2'>
18+
<a
19+
href={"https://multimode.run/"}
20+
className='flex items-center mr-auto font-semibold tracking-wide'
21+
>
22+
Generative Agents Demo
23+
</a>
24+
{button.map(({ href, icon }) => {
25+
return (
26+
<a
27+
key={href}
28+
href={href}
29+
target='_blank'
30+
rel='noopener noreferrer'
31+
className='hover:opacity-75 p-2'
32+
>
33+
{icon}
34+
</a>
35+
);
36+
})}
37+
</nav>
38+
</section>
39+
);
40+
}
41+
42+
export default Header;

examples/phaser/yarn.lock

+5
Original file line numberDiff line numberDiff line change
@@ -7592,6 +7592,11 @@ react-ga4@^2.1.0:
75927592
resolved "https://registry.yarnpkg.com/react-ga4/-/react-ga4-2.1.0.tgz#56601f59d95c08466ebd6edfbf8dede55c4678f9"
75937593
integrity sha512-ZKS7PGNFqqMd3PJ6+C2Jtz/o1iU9ggiy8Y8nUeksgVuvNISbmrQtJiZNvC/TjDsqD0QlU5Wkgs7i+w9+OjHhhQ==
75947594

7595+
react-icons@^4.9.0:
7596+
version "4.9.0"
7597+
resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-4.9.0.tgz#ba44f436a053393adb1bdcafbc5c158b7b70d2a3"
7598+
integrity sha512-ijUnFr//ycebOqujtqtV9PFS7JjhWg0QU6ykURVHuL4cbofvRCf3f6GMn9+fBktEFQOIVZnuAYLZdiyadRQRFg==
7599+
75957600
react-is@^16.13.1:
75967601
version "16.13.1"
75977602
resolved "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz"

0 commit comments

Comments
 (0)