Skip to content
This repository was archived by the owner on Nov 16, 2022. It is now read-only.

Commit 00c8b0a

Browse files
committed
[Demos] Added source code links.
1 parent 28855b5 commit 00c8b0a

File tree

7 files changed

+58
-9
lines changed

7 files changed

+58
-9
lines changed

src/pages/Components/CodeDemo/index.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ export default function CodeDemo() {
4848
theme={"darcula"}
4949
paperContainer
5050
actions={[{label: "Source code", link: ""}]}
51+
actions={[{
52+
label: "GitHub source",
53+
link: "https://github.com/material-docs/material-docs-documentation/blob/master/src/examples/Code/CodeExample.js"
54+
}]}
5155
>
5256
<Box p={1}>
5357
<CodeExample />
@@ -60,6 +64,10 @@ export default function CodeDemo() {
6064
theme={"darcula"}
6165
paperContainer
6266
actions={[{label: "Source code", link: ""}]}
67+
actions={[{
68+
label: "GitHub source",
69+
link: "https://github.com/material-docs/material-docs-documentation/blob/master/src/examples/Code/ExpansionCodeExample.js"
70+
}]}
6371
>
6472
<Box p={1}>
6573
<TaggingContext.Provider value={{setTag: () => {}, removeTag: () => {}}}>
@@ -72,9 +80,11 @@ export default function CodeDemo() {
7280
<DemoWithCode
7381
code={demoWithCodeCode}
7482
theme={"darcula"}
75-
actions={[{label: "Source code", link: ""}]}
7683
paperContainer
77-
actions={[{label: "Source code", link: ""}]}
84+
actions={[{
85+
label: "GitHub source",
86+
link: "https://github.com/material-docs/material-docs-documentation/blob/master/src/examples/Code/DemoWithCodeExpample.js"
87+
}]}
7888
>
7989
<Box p={1}>
8090
<TaggingContext.Provider value={{setTag: () => {}, removeTag: () => {}}}>

src/pages/Components/HeadersDemo/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ export default function HeadersDemo() {
3838
theme={"darcula"}
3939
defaultExpanded
4040
name={locale.headersExample}
41+
actions={[{
42+
label: "GitHub source",
43+
link: "https://github.com/material-docs/material-docs-documentation/blob/master/src/examples/Headers/AllHeaders.js"
44+
}]}
4145
>
4246
<Box p={2}>
4347
<TaggingContext.Provider value={{

src/pages/Components/ImagesDemo/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ export default function ImagesDemo() {
3333
theme={"darcula"}
3434
paperContainer
3535
defaultExpanded
36+
actions={[{
37+
label: "GitHub source",
38+
link: "https://github.com/material-docs/material-docs-documentation/blob/master/src/examples/Images/ImagesOverview.js"
39+
}]}
3640
>
3741
<ImagesOverview/>
3842
</DemoWithCode>

src/pages/Components/ListsDemo/index.js

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,17 @@ export default function ListsDemo() {
3636
can contain
3737
its content and nested list items inside ```ListItemContained``` component.
3838
</Markdown>
39-
<DemoWithCode code={simpleListCode} paperContainer theme={"darcula"} name={"Simple list"} defaultExpanded>
39+
<DemoWithCode
40+
code={simpleListCode}
41+
paperContainer
42+
theme={"darcula"}
43+
name={"Simple list"}
44+
defaultExpanded
45+
actions={[{
46+
label: "GitHub source",
47+
link: "https://github.com/material-docs/material-docs-documentation/blob/master/src/examples/Lists/SimpleList.js"
48+
}]}
49+
>
4050
<Box p={2}>
4151
<SimpleList/>
4252
</Box>
@@ -46,15 +56,30 @@ export default function ListsDemo() {
4656
You can create __nested lists__ inside ```ListItem``` component. Just place __nested items__ inside
4757
```ListItemContained``` component in ```ListItem```.
4858
</Markdown>
49-
<DemoWithCode code={listWithNestedItemsCode} paperContainer theme={"darcula"}
50-
name={"List with nested items"}>
59+
<DemoWithCode
60+
code={listWithNestedItemsCode}
61+
paperContainer theme={"darcula"}
62+
name={"List with nested items"}
63+
actions={[{
64+
label: "GitHub source",
65+
link: "https://github.com/material-docs/material-docs-documentation/blob/master/src/examples/Lists/ListWithNestedItems.js"
66+
}]}
67+
>
5168
<Box p={2}>
5269
<ListWithNestedItems/>
5370
</Box>
5471
</DemoWithCode>
5572

5673
<Markdown>Lists can be __decorated__ with several points type.</Markdown>
57-
<DemoWithCode code={decoratedListCode} paperContainer theme={"darcula"} name={"List with items decoration"}>
74+
<DemoWithCode
75+
code={decoratedListCode}
76+
paperContainer theme={"darcula"}
77+
name={"List with items decoration"}
78+
actions={[{
79+
label: "GitHub source",
80+
link: "https://github.com/material-docs/material-docs-documentation/blob/master/src/examples/Lists/DecoratedList.js"
81+
}]}
82+
>
5883
<Box p={2}>
5984
<DecoratedList/>
6085
</Box>

src/pages/Components/MarkdownDemo/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ import codeBlockExample from "../../../examples/Markdown/CodeMD.md"
3131

3232

3333
const codeBlockExamples = {
34-
"expansion-code": {code: expansionCodeBlockExample, demo: <ExpansionCodeMD/>},
35-
"demo-with-code": {code: demoWithCodeBlockExample, demo: <DemoWithCodeMD/>},
36-
"code": {code: codeBlockExample, demo: <CodeMD/>},
34+
"expansion-code": {code: expansionCodeBlockExample, demo: <ExpansionCodeMD/>, page: "https://github.com/material-docs/material-docs-documentation/blob/master/src/examples/Markdown/ExpansionCodeMD.js"},
35+
"demo-with-code": {code: demoWithCodeBlockExample, demo: <DemoWithCodeMD/>, page: "https://github.com/material-docs/material-docs-documentation/blob/master/src/examples/Markdown/DemoWithCodeMD.js"},
36+
"code": {code: codeBlockExample, demo: <CodeMD/>, page: "https://github.com/material-docs/material-docs-documentation/blob/master/src/examples/Markdown/CodeMD.js"},
3737
}
3838

3939
export default function MarkdownDemo() {
@@ -56,6 +56,7 @@ export default function MarkdownDemo() {
5656
paperContainer
5757
defaultExpanded
5858
name={locale.overviewExample}
59+
actions={[{label: "GitHub source", link: "https://github.com/material-docs/material-docs-documentation/blob/master/src/examples/Markdown/MarkdownOverview.js"}]}
5960
>
6061
<Box p={2}>
6162
<TaggingContext.Provider value={{
@@ -82,6 +83,7 @@ export default function MarkdownDemo() {
8283
code={demo.code}
8384
theme={"darcula"}
8485
paperContainer
86+
actions={[{label: "GitHub source", link: demo.page}]}
8587
>
8688
<Box p={2}>
8789
<TaggingContext.Provider value={{

src/pages/Components/TablesDemo/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export default function TablesDemo() {
3333
code={simpleTableCode}
3434
paperContainer
3535
defaultExpanded
36+
actions={[{label: "GitHub source", link: "https://github.com/material-docs/material-docs-documentation/blob/master/src/examples/Tables/SimpleTable.js"}]}
3637
>
3738
<Box p={1}>
3839
<SimpleTable/>
@@ -44,6 +45,7 @@ export default function TablesDemo() {
4445
theme={"darcula"}
4546
code={tableWithMarkdownCode}
4647
paperContainer
48+
actions={[{label: "GitHub source", link: "https://github.com/material-docs/material-docs-documentation/blob/master/src/examples/Tables/TableWithMarkdown.js"}]}
4749
>
4850
<Box p={1}>
4951
<TableWithMarkdown/>

src/pages/Components/TextStylingDemo/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export default function TextStylingDemo() {
3838
defaultExpanded
3939
theme={"darcula"}
4040
name={locale.overview}
41+
actions={[{label: "GitHub source", link: "https://github.com/material-docs/material-docs-documentation/blob/master/src/examples/TextStyling/TextStylingOverview.js"}]}
4142
>
4243
<Box p={2}>
4344
<TextStylingOverview/>
@@ -50,6 +51,7 @@ export default function TextStylingDemo() {
5051
code={nestedCode}
5152
theme={"darcula"}
5253
name={locale.nestedComponents}
54+
actions={[{label: "GitHub source", link: "https://github.com/material-docs/material-docs-documentation/blob/master/src/examples/TextStyling/TextStylingNested.js"}]}
5355
>
5456
<Box p={2}>
5557
<TextStylingNested/>

0 commit comments

Comments
 (0)