Skip to content

Refactor to use modern React #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"presets": ["env", "react", "es2017", "stage-0"],
"plugins": [
"transform-object-rest-spread",
["babel-plugin-styled-components", {
"displayName": true,
"ssr": true
}]
]
}
1 change: 1 addition & 0 deletions .env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
REACT_EDITOR=code
29 changes: 0 additions & 29 deletions .eslintrc

This file was deleted.

9 changes: 9 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
"extends": "airbnb",
"rules": {
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }]
},
"env": {
"browser": true
}
};
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
/yarn-error.log
25 changes: 0 additions & 25 deletions .jshintrc

This file was deleted.

2 changes: 2 additions & 0 deletions .storybook/addons.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import '@storybook/addon-actions/register';
import '@storybook/addon-links/register';
10 changes: 10 additions & 0 deletions .storybook/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { configure } from '@storybook/react';
import '@storybook/addon-console';

// automatically import all files ending in *.stories.js
const req = require.context('../stories', true, /.stories.js$/);
function loadStories() {
req.keys().forEach(filename => req(filename));
}

configure(loadStories, module);
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"git.ignoreLimitWarning": true
}
1 change: 1 addition & 0 deletions ACCESS_TOKEN.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default 'CHANGEME';
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ npm install @mapbox/react-geocoder

A geocoder component using Mapbox.

## Storybook
To see options in Storybook run:
```
yarn storybook
```

NOTE: You MUST put
`export default 'your-api-key';` in `ACCESS_TOKEN.js` for this to work.

## api

An `accessToken` is assumed to be a valid Mapbox accessToken.
Expand All @@ -30,3 +39,11 @@ An `accessToken` is assumed to be a valid Mapbox accessToken.
focusOnMount=optional bool, default true
/>
```

# Building
Use Storybook to ensure everything looks right. Then

```
yarn build
```

Loading