Skip to content

Commit 7ad74e3

Browse files
authored
Merge pull request #809 from ai16z/tcm-contributor-page
fix: refactor contributor page
2 parents c411c2f + 12e1063 commit 7ad74e3

12 files changed

+1015
-31
lines changed

docs/community/Streams/12-2024/2024-12-10.md

-19
Original file line numberDiff line numberDiff line change
@@ -15,45 +15,26 @@ YouTube Link: https://www.youtube.com/watch?v=6I9e9pJprDI
1515

1616
Part 1: Trusted Execution Environments (TEEs) with Agent Joshua
1717
- **00:00:09** - Stream starts, initial setup issues.
18-
- Link: <https://www.youtube.com/watch?v=6I9e9pJprDI&t=9>
1918
- **00:01:58** - Intro to Trusted Execution Environments (TEEs).
20-
- Link: <https://www.youtube.com/watch?v=6I9e9pJprDI&t=118>
2119
- **00:08:03** - Agent Joshua begins explaining TEEs and the Eliza plugin.
22-
- Link: <https://www.youtube.com/watch?v=6I9e9pJprDI&t=483>
2320
- **00:19:15** - Deeper dive into remote attestation.
24-
- Link: <https://www.youtube.com/watch?v=6I9e9pJprDI&t=1155>
2521
- **00:24:50** - Discussion of derived keys.
26-
- Link: <https://www.youtube.com/watch?v=6I9e9pJprDI&t=1490>
2722
- **00:37:00** - Deploying to a real TEE, Phala Network's TEE cloud.
28-
- Link: <https://www.youtube.com/watch?v=6I9e9pJprDI&t=2220>
2923
- **00:50:48** - Q&A with Joshua, contact info, and next steps.
30-
- Link: <https://www.youtube.com/watch?v=6I9e9pJprDI&t=3048>
3124

3225
Part 2: Building a Domino's pizza ordering agent
3326
- **01:04:37** - Transition to building a Domino's pizza ordering agent.
34-
- Link: <https://www.youtube.com/watch?v=6I9e9pJprDI&t=3877>
3527
- **01:14:20** - Discussion of the pizza ordering agent’s order flow and state machine.
36-
- Link: <https://www.youtube.com/watch?v=6I9e9pJprDI&t=4460>
3728
- **01:22:07** - Using Claude to generate a state machine diagram.
38-
- Link: <https://www.youtube.com/watch?v=6I9e9pJprDI&t=4927>
3929
- **01:32:17** - Creating the Domino's plugin in Eliza.
40-
- Link: <https://www.youtube.com/watch?v=6I9e9pJprDI&t=5537>
4130
- **01:54:15** - Working on the pizza order provider.
42-
- Link: <https://www.youtube.com/watch?v=6I9e9pJprDI&t=6855>
4331
- **02:16:46** - Pizza provider code completed.
44-
- Link: <https://www.youtube.com/watch?v=6I9e9pJprDI&t=8206>
4532
- **02:28:50** - Discussion of caching customer and order data.
46-
- Link: <https://www.youtube.com/watch?v=6I9e9pJprDI&t=8930>
4733
- **03:13:45** - Pushing fixes to main branch and continuing work on the agent.
48-
- Link: <https://www.youtube.com/watch?v=6I9e9pJprDI&t=11625>
4934
- **04:24:30** - Discussion of summarizing past agent dev school sessions.
50-
- Link: <https://www.youtube.com/watch?v=6I9e9pJprDI&t=15870>
5135
- **05:01:18** - Shaw returns, admits to ordering Domino's manually.
52-
- Link: <https://www.youtube.com/watch?v=6I9e9pJprDI&t=18078>
5336
- **05:09:00** - Discussing payment flow and a confirm order action.
54-
- Link: <https://www.youtube.com/watch?v=6I9e9pJprDI&t=18540>
5537
- **05:27:17** - Final code push, wrap-up, and end of stream.
56-
- Link: <https://www.youtube.com/watch?v=6I9e9pJprDI&t=19637>
5738

5839

5940
## Summary
+183
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
import React, { useState, useRef, useEffect } from "react";
2+
import { GitHubItem } from "./Contributions";
3+
import { GITHUB_PAGE_LIMIT } from "./Contributors";
4+
5+
interface AccordionProps {
6+
title: string;
7+
isOpen: boolean;
8+
onToggle: () => void;
9+
data: GitHubItem[];
10+
loadMore?: () => void;
11+
total_count: number;
12+
primaryText?: string;
13+
secondaryText?: string;
14+
mainBackgroundColor?: string;
15+
}
16+
17+
export const Accordion: React.FC<AccordionProps> = ({
18+
title,
19+
isOpen,
20+
onToggle,
21+
data,
22+
loadMore,
23+
total_count,
24+
primaryText,
25+
secondaryText,
26+
mainBackgroundColor,
27+
}) => {
28+
const [hoveredIndex, setHoveredIndex] = useState<number | null>(null);
29+
const [hoverLoadMore, setHoverLoadMore] = useState<boolean>(false);
30+
const [maxHeight, setMaxHeight] = useState<string>(
31+
isOpen ? "1000px" : "0px",
32+
);
33+
34+
const contentRef = useRef<HTMLDivElement>(null);
35+
36+
React.useEffect(() => {
37+
setMaxHeight(isOpen ? "1000px" : "0px");
38+
}, [isOpen]);
39+
40+
useEffect(() => {
41+
if (contentRef.current && data.length > GITHUB_PAGE_LIMIT) {
42+
contentRef.current.scrollTo({
43+
top: contentRef.current.scrollHeight,
44+
behavior: "smooth",
45+
});
46+
}
47+
}, [data]);
48+
49+
return (
50+
<div
51+
style={{
52+
display: "flex",
53+
flexDirection: "column",
54+
justifyContent: "center",
55+
borderRadius: "0.5rem",
56+
padding: "1rem",
57+
color: primaryText ?? "black",
58+
background: mainBackgroundColor ?? "",
59+
}}
60+
>
61+
<div
62+
onClick={onToggle}
63+
style={{
64+
cursor: "pointer",
65+
fontWeight: "bold",
66+
fontSize: "1rem",
67+
display: "flex",
68+
alignItems: "center",
69+
justifyContent: "space-between",
70+
width: "100%",
71+
}}
72+
>
73+
<div>{title}</div>
74+
<div
75+
style={{
76+
transform: isOpen ? "rotate(90deg)" : "rotate(0deg)",
77+
transition: "transform 0.3s ease",
78+
}}
79+
>
80+
{"▶"}
81+
</div>
82+
</div>
83+
<div
84+
ref={contentRef}
85+
style={{
86+
maxHeight,
87+
overflow: "scroll",
88+
transition: isOpen ? "max-height 1s ease" : "",
89+
scrollbarWidth: "none",
90+
msOverflowStyle: "none",
91+
}}
92+
>
93+
<div
94+
style={{
95+
display: "flex",
96+
flexDirection: "column",
97+
gap: "1rem",
98+
margin: "2rem 0 1rem 1rem",
99+
}}
100+
>
101+
{data.map((entry, index) => (
102+
<div
103+
key={index}
104+
style={{
105+
opacity: hoveredIndex === index ? 0.8 : 1.0,
106+
}}
107+
>
108+
<div
109+
style={{
110+
display: "flex",
111+
flexDirection: "column",
112+
marginBottom: "0.5rem",
113+
cursor: "pointer",
114+
transition: "color 0.2s ease",
115+
}}
116+
onMouseEnter={() => setHoveredIndex(index)}
117+
onMouseLeave={() => setHoveredIndex(null)}
118+
onClick={() =>
119+
window.open(
120+
entry.html_url,
121+
"_blank",
122+
"noopener,noreferrer",
123+
)
124+
}
125+
>
126+
<div
127+
style={{
128+
display: "flex",
129+
alignItems: "center",
130+
gap: "0.5rem",
131+
}}
132+
>
133+
{entry.bullet && (
134+
<div
135+
style={{
136+
width: "0.5rem",
137+
height: "0.5rem",
138+
borderRadius: "50%",
139+
backgroundColor: entry.bullet,
140+
}}
141+
></div>
142+
)}
143+
<div>{entry.title}</div>
144+
</div>
145+
<div
146+
style={{
147+
fontSize: "0.8rem",
148+
color: secondaryText ?? "gray",
149+
}}
150+
>
151+
{entry.created_at.split("T")[0]}
152+
</div>
153+
</div>
154+
</div>
155+
))}
156+
</div>
157+
</div>
158+
{isOpen && loadMore && data.length < total_count && (
159+
<div
160+
style={{
161+
width: "100%",
162+
display: "flex",
163+
justifyContent: "center",
164+
}}
165+
>
166+
<span
167+
style={{
168+
color: hoverLoadMore
169+
? (secondaryText ?? "#3b82f6")
170+
: (primaryText ?? "black"),
171+
cursor: "pointer",
172+
}}
173+
onMouseEnter={() => setHoverLoadMore(true)}
174+
onMouseLeave={() => setHoverLoadMore(false)}
175+
onClick={loadMore}
176+
>
177+
Load more
178+
</span>
179+
</div>
180+
)}
181+
</div>
182+
);
183+
};

0 commit comments

Comments
 (0)