Skip to content

Commit

Permalink
finishing touches
Browse files Browse the repository at this point in the history
  • Loading branch information
spencerc99 committed Aug 18, 2024
1 parent 9aff2ef commit c3da679
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions website/events/gray-area/gray-area.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ function Main() {
</em>
<br />
<br />
<Guestbook name={name} from={from} />
<Guestbook name={name || undefined} from={from || undefined} />
<footer>
a workshop by <a href="https://spencer.place/">spencer</a>
</footer>
Expand All @@ -435,24 +435,24 @@ function Main() {
}

interface GuestbookEntry {
name: string;
from: string;
name?: string;
from?: string;
color?: string;
message: string;
timestamp: number;
}

const Guestbook = withSharedState(
{ defaultData: [] as GuestbookEntry[] },
({ data, setData }, { name, from }: { name: string; from: string }) => {
({ data, setData }, { name, from }: { name?: string; from?: string }) => {
const [message, setMessage] = React.useState("");

const handleSubmit = () => {
if (message.trim()) {
setData([
...data,
{
name,
name: name,
from,
color: window?.cursors?.color || undefined,
message,
Expand All @@ -479,7 +479,7 @@ const Guestbook = withSharedState(
color: window?.cursors.color || "black",
}}
>
{name}
{name || "Anonymous"}
</b>
{from ? ` (${from})` : ""} says...
</span>
Expand Down Expand Up @@ -515,7 +515,7 @@ const Guestbook = withSharedState(
color: entry.color || "black",
}}
>
{entry.name}
{entry.name || "Anonymous"}
</b>{" "}
{entry.from && `(from ${entry.from})`}
<div
Expand Down

0 comments on commit c3da679

Please sign in to comment.