Skip to content

Commit

Permalink
feat: Add history of cigarettes (#121)
Browse files Browse the repository at this point in the history
* Start ts

* Convert all files to TS

* Make search work

* Make png import work

* Add retry

* Make api call work

* Add long waiting on Loading

* Make screens work

* Make cigarettes work

* Make header work

* Reverse geocoding

* Make details work

* Make search work

* Fix reload app

* Make tests pass

* Run eslint

* AqiHistory

* Add History manager back

* Start getting background location

* Remove circular dependency

* Fix isSaveNeeded

* Add getData for testing

* Add clearTable

* Fix tests

* Update README

* Remove vs code settings

* Fix too many requests

* Add task to save to AsyncStorage

* Return correct background fetch response

* Refactor a bit the components

* Make scroll work nicely

* Add shadow on buttons

* Make stuff work

* Weekly monthly

* Calculate cigarettes

* Small fixes

* Small fixes

* Small tweaks with icons

* Add more dev info

* Reverse geocode in search

* Small tweaks

* Small tweaks

* Update icons
  • Loading branch information
amaury1093 committed Jul 18, 2019
1 parent a5a1a3a commit 8e8f836
Show file tree
Hide file tree
Showing 130 changed files with 4,138 additions and 2,431 deletions.
28 changes: 0 additions & 28 deletions .eslintrc

This file was deleted.

20 changes: 20 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
env: {
jest: true
},
extends: [
'prettier',
'prettier/standard',
'prettier/@typescript-eslint',
'semistandard'
],
parser: '@typescript-eslint/parser',
plugins: ['react', '@typescript-eslint'],
rules: {
// https://stackoverflow.com/questions/55280555/typescript-eslint-eslint-plugin-error-route-is-defined-but-never-used-no-un
'@typescript-eslint/no-unused-vars': 'error',
'no-unused-vars': 'off',
'react/jsx-uses-react': 1,
'react/jsx-uses-vars': 1
}
};
64 changes: 28 additions & 36 deletions App/App.js → App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,53 +14,45 @@
// You should have received a copy of the GNU General Public License
// along with Sh**t! I Smoke. If not, see <http:https://www.gnu.org/licenses/>.

import React, { PureComponent } from 'react';
import * as Font from 'expo-font';
import Constants from 'expo-constants';
import { Provider } from 'mobx-react';
import React, { useEffect, useState } from 'react';
import Sentry from 'sentry-expo';

import { RootStore } from './stores';
import { Background as LoadingBackground } from './Screens/Loading/Background';
import { Screens } from './Screens';

// Set up global MST stores
const stores = RootStore.create({
api: undefined,
error: undefined,
location: {}
});
import { Background as LoadingBackground } from './Screens/Loading/Background';
import {
ApiContextProvider,
ErrorContextProvider,
LocationContextProvider
} from './stores';

// Add sentry if available
if (Constants.manifest.extra.sentryPublicDsn) {
Sentry.enableInExpoDevelopment = true;
Sentry.config(Constants.manifest.extra.sentryPublicDsn).install();
}

export class App extends PureComponent {
state = {
fontLoaded: false
};

async componentDidMount () {
// Using custom fonts with Expo
// https://docs.expo.io/versions/latest/guides/using-custom-fonts
await Font.loadAsync({
export function App () {
const [fontLoaded, setFontLoaded] = useState(false);
useEffect(() => {
Font.loadAsync({
'gotham-black': require('../assets/fonts/Gotham-Black.ttf'),
'gotham-book': require('../assets/fonts/Gotham-Book.ttf')
});

this.setState({ fontLoaded: true });
}

render () {
const { fontLoaded } = this.state;

return fontLoaded ? (
<Provider stores={stores}>
<Screens />
</Provider>
) : (
<LoadingBackground />
);
}
})
.then(() => setFontLoaded(true))
.catch(console.error);
}, []);

return fontLoaded ? (
<ErrorContextProvider>
<LocationContextProvider>
<ApiContextProvider>
<Screens />
</ApiContextProvider>
</LocationContextProvider>
</ErrorContextProvider>
) : (
<LoadingBackground />
);
}
182 changes: 0 additions & 182 deletions App/Screens/About/About.js

This file was deleted.

Loading

0 comments on commit 8e8f836

Please sign in to comment.