diff --git a/src/components/Layout/HomeContent.js b/src/components/Layout/HomeContent.js index 22b75016..12fe3210 100644 --- a/src/components/Layout/HomeContent.js +++ b/src/components/Layout/HomeContent.js @@ -755,9 +755,7 @@ function CommunityGallery() { }, []); return ( -
+
- {alt} +
+ {alt} +
))} diff --git a/src/content/learn/tutorial-tic-tac-toe.md b/src/content/learn/tutorial-tic-tac-toe.md index ec8d0f61..11acbadd 100644 --- a/src/content/learn/tutorial-tic-tac-toe.md +++ b/src/content/learn/tutorial-tic-tac-toe.md @@ -2247,7 +2247,11 @@ body { +<<<<<<< HEAD Unapozunguka kupitia orodha ya `history` ndani ya function unayopitisha kwa `map`, hoja ya `squares` inapitia kila kipengele cha `history`, na hoja ya `move` inapitia kila kiashiria cha orodha: `0`, `1`, `2`, …. (Katika hali nyingi, ungehitaji vipengele halisi vya orodha, lakini ili kuonyesha orodha ya harakati utahitaji tu viashiria.) +======= +As you iterate through the `history` array inside the function you passed to `map`, the `squares` argument goes through each element of `history`, and the `move` argument goes through each array index: `0`, `1`, `2`, …. (In most cases, you'd need the actual array elements, but to render a list of moves you will only need indexes.) +>>>>>>> e9a7cb1b6ca1659b42d81555ecef0cd554b7a983 Kwa kila harakati katika historia ya mchezo wa tic-tac-toe, unaunda kipengele cha orodha `
  • ` kinachojumuisha kitufe ` +

    Main content

    + + ); } ``` +```js src/Sidebar.js +import { useState } from 'react'; -```js src/TabButton.js active -import { useTransition } from 'react'; - -export default function TabButton({ action, children, isActive }) { - const [isPending, startTransition] = useTransition(); - if (isActive) { - return {children} - } - if (isPending) { - return {children}; - } +export default function Sidebar() { + const [isExpanded, setIsExpanded] = useState(false) + return ( - + ); } ``` -```js src/AboutTab.js hidden -import {unstable_ViewTransition as ViewTransition} from 'react'; +```css +body { height: 275px; margin: 0; } +#root { + display: flex; + gap: 10px; + height: 100%; +} +nav { + padding: 10px; + background: #eee; + font-size: 14px; + height: 100%; +} +main { + padding: 10px; +} +p { + margin: 0; +} +h1 { + margin-top: 10px; +} +.indicator { + margin-left: 4px; + display: inline-block; + rotate: 90deg; +} +.indicator.down { + rotate: 180deg; +} +``` -export default function AboutTab() { - return ( - -

    Welcome to my profile!

    -
    - ); +```json package.json hidden +{ + "dependencies": { + "react": "experimental", + "react-dom": "experimental", + "react-scripts": "latest", + "toastify-js": "1.12.0" + }, + "scripts": { + "start": "react-scripts start", + "build": "react-scripts build", + "test": "react-scripts test --env=jsdom", + "eject": "react-scripts eject" + } } ``` -```js src/PostsTab.js hidden -import {use, unstable_ViewTransition as ViewTransition} from 'react'; -import { fetchData } from './data.js'; + -function PostsTab() { - const posts = use(fetchData('/posts')); - return ( - -
      - {posts.map(post => - - )} -
    -
    - ); -} +The Overview section always starts out collapsed. Because we unmount the sidebar when `isShowingSidebar` flips to `false`, all its internal state is lost. -function Post({ title }) { - return ( -
  • - {title} -
  • - ); -} +This is a perfect use case for Activity. We can preserve the internal state of our sidebar, even when visually hiding it. -export default PostsTab; -``` +Let's replace the conditional rendering of our sidebar with an Activity boundary: -```js src/ContactTab.js hidden -import {unstable_ViewTransition as ViewTransition} from 'react'; +```jsx {7,9} +// Before +{isShowingSidebar && ( + +)} -export default function ContactTab() { - return ( - -

    - Send me a message! -

    -