-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docz-theme-default): use typescript instead of javascript
- Loading branch information
1 parent
ae597af
commit 4de326a
Showing
7 changed files
with
72 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"external": ["react", "react-dom", "react-router-dom"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react' | ||
import { Link } from 'react-router-dom' | ||
|
||
import { Docs } from 'playgrodd' | ||
|
||
export const List = () => ( | ||
<Docs> | ||
{docs => ( | ||
<ul> | ||
{docs.map(doc => ( | ||
<li key={doc.id}> | ||
<Link to={doc.route}>{doc.name}</Link> | ||
</li> | ||
))} | ||
</ul> | ||
)} | ||
</Docs> | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React, { Fragment } from 'react' | ||
|
||
import { Preview } from 'playgrodd' | ||
|
||
export const View = () => ( | ||
<Preview> | ||
{({ id, name, docDescription, sections }) => ( | ||
<Fragment key={id}> | ||
<h2>{name}</h2> | ||
{docDescription && <p>{docDescription}</p>} | ||
{sections && | ||
sections.length > 0 && | ||
sections.map(section => ( | ||
<Fragment key={section.id}> | ||
<h3>{section.title}</h3> | ||
<div>{section.render()}</div> | ||
</Fragment> | ||
))} | ||
</Fragment> | ||
)} | ||
</Preview> | ||
) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React, { Fragment } from 'react' | ||
import { createTheme } from 'playgrodd' | ||
|
||
import { List } from './components/List' | ||
import { View } from './components/View' | ||
|
||
export const Theme = createTheme(() => ( | ||
<Fragment> | ||
<h1>Default theme</h1> | ||
<List /> | ||
<View /> | ||
</Fragment> | ||
)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "dist/main", | ||
"rootDir": "src", | ||
"skipLibCheck": true, | ||
"types": ["node"], | ||
"typeRoots": ["node_modules/@types"] | ||
}, | ||
"include": ["src/**/*"], | ||
"exclude": ["node_modules/**"] | ||
} |