Skip to content

Commit

Permalink
docs: Typography demo add import React statement
Browse files Browse the repository at this point in the history
  • Loading branch information
madocto committed Mar 28, 2022
1 parent b66bb9c commit b86bce7
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions components/typography/demo/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ title:
Display the document sample.

```tsx
import React from 'react';
import { Typography, Divider } from 'antd';

const { Title, Paragraph, Text, Link } = Typography;
Expand Down
11 changes: 6 additions & 5 deletions components/typography/demo/ellipsis-debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@ debug: true
Multiple line ellipsis support.

```tsx
import React, { useState } from 'react';
import { Typography, Slider, Switch } from 'antd';

const { Text, Paragraph } = Typography;

const App = () => {
const [rows, setRows] = React.useState(1);
const [longText, setLongText] = React.useState(true);
const [copyable, setCopyable] = React.useState(false);
const [editable, setEditable] = React.useState(false);
const [expandable, setExpandable] = React.useState(false);
const [rows, setRows] = useState(1);
const [longText, setLongText] = useState(true);
const [copyable, setCopyable] = useState(false);
const [editable, setEditable] = useState(false);
const [expandable, setExpandable] = useState(false);

return (
<>
Expand Down
1 change: 1 addition & 0 deletions components/typography/demo/ellipsis-middle.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ title:
You can ellipsis content from middle by customize `ellipsis={{ suffix: ... }}`.

```tsx
import React from 'react';
import { Typography } from 'antd';

const { Text } = Typography;
Expand Down
3 changes: 2 additions & 1 deletion components/typography/demo/ellipsis.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ title:
Multiple line ellipsis support. You can use `tooltip` to config ellipsis tooltip. Recommend `expandable` when have lots of content.

```tsx
import React, { useState } from 'react';
import { Typography, Switch } from 'antd';

const { Paragraph, Text } = Typography;

const App = () => {
const [ellipsis, setEllipsis] = React.useState(true);
const [ellipsis, setEllipsis] = useState(true);

return (
<>
Expand Down
1 change: 1 addition & 0 deletions components/typography/demo/paragraph-debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ debug: true
Display the title and paragraph.

```tsx
import React from 'react';
import { Typography } from 'antd';

const { Title, Paragraph, Text } = Typography;
Expand Down
3 changes: 2 additions & 1 deletion components/typography/demo/suffix.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ title:
add suffix ellipsis support.

```tsx
import React, { useState } from 'react';
import { Typography, Slider } from 'antd';

const { Paragraph } = Typography;

const App = () => {
const [rows, setRows] = React.useState(1);
const [rows, setRows] = useState(1);

const article =
"To be, or not to be, that is a question: Whether it is nobler in the mind to suffer. The slings and arrows of outrageous fortune Or to take arms against a sea of troubles, And by opposing end them? To die: to sleep; No more; and by a sleep to say we end The heart-ache and the thousand natural shocks That flesh is heir to, 'tis a consummation Devoutly to be wish'd. To die, to sleep To sleep- perchance to dream: ay, there's the rub! For in that sleep of death what dreams may come When we have shuffled off this mortal coil, Must give us pause. There 's the respect That makes calamity of so long life";
Expand Down
1 change: 1 addition & 0 deletions components/typography/demo/text.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ title:
Provides multiple types of text and link.

```tsx
import React from 'react';
import { Typography, Space } from 'antd';

const { Text, Link } = Typography;
Expand Down
1 change: 1 addition & 0 deletions components/typography/demo/title.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ title:
Display title in different level.

```tsx
import React from 'react';
import { Typography } from 'antd';

const { Title } = Typography;
Expand Down

0 comments on commit b86bce7

Please sign in to comment.