Skip to content

Commit

Permalink
Merge pull request #153 from govau/feat-tab-order
Browse files Browse the repository at this point in the history
Sort docs languages alphabetically & update copy
  • Loading branch information
dalehurwitz authored Nov 22, 2018
2 parents d1b62c3 + d93fb58 commit 7bb19ed
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 21 deletions.
40 changes: 21 additions & 19 deletions docs/src/components/language-selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,26 @@ const NavLanguageLink = styled(LanguageLink)`
}
`

const languages = {
python: 'Python',
java: 'Java',
node: 'Node.js',
//ruby: 'Ruby',
//dotnet: '.NET',
}

const createLanguageOption = language => ({
value: language,
label: languages[language],
})

const languageOptions = Object.keys(languages)
.sort()
.map(createLanguageOption)

// Pretty-print the current language
const getLanguageLabel = language => languages[language]

const Context = createContext({
current: '',
changeLanguage: language => {},
Expand All @@ -44,7 +64,7 @@ const Context = createContext({
// Wrap everything in this to give access to a current language. You can nest
// this to give a sub-current-language.
class Provider extends React.Component {
state = { current: this.props.initial || 'python' }
state = { current: this.props.initial || languageOptions[0].value }

changeLanguage = current => {
this.setState({ current })
Expand All @@ -63,24 +83,6 @@ class Provider extends React.Component {
}
}

const languages = {
python: 'Python',
java: 'Java',
node: 'Node.js',
//ruby: 'Ruby',
//dotnet: '.NET',
}

const createLanguageOption = language => ({
value: language,
label: languages[language],
})

const languageOptions = Object.keys(languages).map(createLanguageOption)

// Pretty-print the current language
const getLanguageLabel = language => languages[language]

// Language selector. Pop this anywhere inside a provider context to allow for
// language selection.
const Languages = props => (
Expand Down
4 changes: 2 additions & 2 deletions docs/src/content/sending-messages.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Contents from 'components/table-of-contents'

# Send a message

You can use Notify to send text messages, emails and letters.
You can use Notify to send text messages and emails.

This API allows you to send text or email notifications to users and track
their progress. You might send out notifications in response to some
Expand Down Expand Up @@ -47,7 +47,7 @@ messages in user interface for each service.
<Examples reference="sending-emails" />


## Sending a SMS
## Sending an SMS

Sending an SMS is similar to sending an email. Send them one-by-one to a
recipient. If you set up a reply number in the Notify interface, you'll be able
Expand Down

0 comments on commit 7bb19ed

Please sign in to comment.