Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions docs-templates/api/components/plural.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ In other languages, you have to define up to six.
```jsx
const count = 1;
<Plural n={count}
one={You have one item.}
other={You have some items.}
one={<>You have one item.</>}
other={<>You have some items.</>}
/>
```

Expand Down Expand Up @@ -95,8 +95,8 @@ import { Plural } from '__PACKAGE_NAME__';
export default function ItemCount({ count }) {
return (
<Plural n={count} // [!code highlight]
one={You have one item.}
other={You have some items.}
one={<>You have one item.</>}
other={<>You have some items.</>}
/>
);
}
Expand All @@ -111,7 +111,7 @@ import { Plural } from '__PACKAGE_NAME__';
export default function ItemCount({ count }) {
return (
<Plural n={count}
one={You have one item.}
one={<>You have one item.</>}
>
You have some items. // [!code highlight]
</Plural>
Expand All @@ -129,9 +129,10 @@ export default function ItemCount({ count }) {
return (
<T id="itemCount">
<Plural n={count}
one={You have an item.} // [!code highlight]
other={You have some items.} // [!code highlight]
one={<>You have an item.</>} // [!code highlight]
other={<>You have some items.</>} // [!code highlight]
/>
</T>
);
}
```
Expand All @@ -145,8 +146,8 @@ import { T, Plural, Num } from '__PACKAGE_NAME__';
export default function ItemCount({ count }) {
return (
<Plural n={count}
one={You have <Num>{count}</Num> item.} // [!code highlight]
other={You have <Num>{count}</Num> items.} // [!code highlight]
one={<>You have <Num>{count}</Num> item.</>} // [!code highlight]
other={<>You have <Num>{count}</Num> items.</>} // [!code highlight]
/>
);
}
Expand All @@ -156,8 +157,8 @@ When inside of a `<T>` component, wrap all dynamic content with a `<Currency>`,
```jsx
<T id="itemCount">
<Plural n={count}
one={You have <Num>{count}</Num> item.} // [!code highlight]
other={You have <Num>{count}</Num> items.} // [!code highlight]
one={<>You have <Num>{count}</Num> item.</>} // [!code highlight]
other={<>You have <Num>{count}</Num> items.</>} // [!code highlight]
/>
</T>
```
Expand Down
Loading