Skip to content

Commit 8afad23

Browse files
committed
[demos] Improve v6
1 parent f4f0432 commit 8afad23

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

site/demos/04_todo/v6.md

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -167,19 +167,17 @@ and function from the app-level state, and renders either a button to create a
167167
room and start sharing, or a link to the room that is already being shared to.
168168

169169
```jsx
170-
const Share = ({roomId, createRoomId}) => {
171-
return (
172-
<div id="room">
173-
{roomId ? (
174-
<a href={'?' + roomId} target="_blank">
175-
&#128279; Share link
176-
</a>
177-
) : (
178-
<span onClick={createRoomId}>&#127880; Start sharing</span>
179-
)}
180-
</div>
181-
);
182-
};
170+
const Share = ({roomId, createRoomId}) => (
171+
<div id="share">
172+
{roomId ? (
173+
<a href={'?' + roomId} target="_blank">
174+
&#128279; Share link
175+
</a>
176+
) : (
177+
<span onClick={createRoomId}>&#127880; Start sharing</span>
178+
)}
179+
</div>
180+
);
183181
```
184182

185183
We can add this to the top of the left-hand side of the app. For the sake of
@@ -199,7 +197,7 @@ clarity, we remove the undo buttons for now:
199197
Let's give it this share button some styling to make it prominent for this demo:
200198

201199
```less
202-
#room {
200+
#share {
203201
a,
204202
span {
205203
background: #eee;

0 commit comments

Comments
 (0)