1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-29 18:09:49 +02:00

Show View Source link next to example title (#2577)

Add a view source link in Slate's examples to make it easy to see how an example was created
This commit is contained in:
Marko Grešak
2019-02-19 21:11:17 +01:00
committed by Sunny Hirai
parent 8e659dbd28
commit 9694b22846

View File

@@ -291,7 +291,14 @@ export default class App extends React.Component {
<Switch>
{EXAMPLES.map(([name, Component, path]) => (
<Route key={path} exact path={path}>
<ExampleTitle>{name}</ExampleTitle>
<ExampleTitle>
{name}
<Link
href={`https://github.com/ianstormtaylor/slate/blob/master/examples${path}`}
>
(View Source)
</Link>
</ExampleTitle>
</Route>
))}
</Switch>