Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 3ba7100

Browse files
authored
feat(docs): add FAQ page (#1227)
* Adding simple FAQ * Fixing typo * Updates for per review
1 parent 7830f6a commit 3ba7100

File tree

5 files changed

+84
-2
lines changed

5 files changed

+84
-2
lines changed

docs/src/components/Sidebar/Sidebar.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,13 @@ class Sidebar extends React.Component<any, any> {
273273
to: '/quick-start',
274274
styles: menuItemStyles,
275275
},
276+
{
277+
key: 'faq',
278+
content: 'FAQ',
279+
as: NavLink,
280+
to: '/faq',
281+
styles: menuItemStyles,
282+
},
276283
{
277284
key: 'accessiblity',
278285
content: 'Accessibility',

docs/src/routes.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import DocsRoot from './components/DocsRoot'
77

88
import Accessibility from './views/Accessibility'
99
import ColorPalette from './views/ColorPalette'
10+
11+
import FAQ from './views/FAQ'
1012
import ShorthandProps from './views/ShorthandProps'
1113
import Introduction from './views/Introduction'
1214
import PageNotFound from './views/PageNotFound'
@@ -97,6 +99,7 @@ const Router = () => (
9799
component={require('./prototypes/alerts/index').default}
98100
/>,
99101
]}
102+
<DocsLayout exact path="/faq" component={FAQ} />
100103
<DocsLayout exact path="/accessibility" component={Accessibility} />
101104
<DocsLayout exact path="/accessibility-behaviors" component={AccessibilityBehaviors} />
102105
<DocsLayout exact path="/focus-zone" component={FocusZone} />

docs/src/views/Accessibility.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ export default () => (
428428
</ul>
429429

430430
<GuidesNavigationFooter
431-
previous={{ name: 'Quick Start', url: 'quick-start' }}
431+
previous={{ name: 'FAQ', url: 'faq' }}
432432
next={{ name: 'Theming', url: 'theming' }}
433433
/>
434434
</DocPage>

docs/src/views/FAQ.tsx

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
import * as React from 'react'
2+
import DocPage from '../components/DocPage/DocPage'
3+
import GuidesNavigationFooter from '../components/GuidesNavigationFooter'
4+
import CodeSnippet from '../components/CodeSnippet'
5+
import { link } from '../utils/helpers'
6+
7+
import { Header } from '@stardust-ui/react'
8+
9+
const Category = props => <Header as="h2" {...props} />
10+
const Question = props => <Header as="h3" {...props} />
11+
const Answer = props => <p>{props.content}</p>
12+
13+
export default () => (
14+
<DocPage title="FAQ">
15+
<Category content="General" />
16+
<Question content="Does Stardust support mobile?" />
17+
<Answer content="No. Scope is limited to Web / Desktop at present." />
18+
19+
<Question content="How can @mixins be used in the Stardust's styles" />
20+
<Answer
21+
content="
22+
As the styles in Stardust are defined using CSS in JS, mixins can be defined as simple
23+
functions that can be reused on multiple places.
24+
"
25+
/>
26+
27+
<Question content="How to use Links and React-Router" />
28+
<Answer
29+
content={
30+
<p>
31+
We recommend to render links from react router as Buttons as below:
32+
<CodeSnippet
33+
value={`
34+
<>
35+
import { Link } from 'react-router-dom'
36+
37+
<Button
38+
as={Link}
39+
content={previous.name}
40+
icon="arrow left"
41+
iconPosition="before"
42+
primary
43+
to={previous.url}
44+
/>
45+
</>
46+
`}
47+
/>
48+
</p>
49+
}
50+
/>
51+
52+
<Category content="Teams Specific" />
53+
<Question content="How to add Icons to Stardust" />
54+
<Answer
55+
content={
56+
<p>
57+
Generally Teams should be using SVG icons only. If you need FontAwesome or other icons,
58+
process for adding them is described in{' '}
59+
{link(
60+
'Issue 585',
61+
'https://github.com/stardust-ui/react/pull/585',
62+
true, // if 'true', opens in a new tab
63+
)}
64+
</p>
65+
}
66+
/>
67+
<GuidesNavigationFooter
68+
previous={{ name: 'Quick Start', url: 'quick-start' }}
69+
next={{ name: 'Accessibility', url: 'accessibility' }}
70+
/>
71+
</DocPage>
72+
)

docs/src/views/QuickStart.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ export default () => (
5353
`}
5454
/>
5555

56-
<GuidesNavigationFooter next={{ name: 'Accessibility', url: 'accessibility' }} />
56+
<GuidesNavigationFooter next={{ name: 'FAQ', url: 'faq' }} />
5757
</DocPage>
5858
)

0 commit comments

Comments
 (0)