Skip to content

Commit fbaaa1b

Browse files
authored
Merge branch 'master' into fix/pagination
2 parents 3766dae + 494cb71 commit fbaaa1b

File tree

6 files changed

+69
-153
lines changed

6 files changed

+69
-153
lines changed

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Boilerplate with React ⚛️ and Firebase 🔥designed to quickly spin up a ful
1515
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
1616
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
1717

18-
1918
- [What is this?](#what-is-this)
2019
- [Why should I use it?](#why-should-i-use-it)
2120
- [Features](#features)
@@ -132,9 +131,8 @@ React Firebase Admin is our in-house admin dashboard boilerplate, used in many o
132131
- [React-spinners](https://github.com/davidhu2000/react-spinners) (★ 1.2k) a collection of loading spinner components for React.
133132
- [Firebase](https://firebase.google.com/) for serverless architecture - CDN Hosting, Realtime Database, Authentication, Storage and Cloud Functions (see [docs](https://firebase.google.com/docs/web)).
134133
- [Format.js](https://formatjs.io/) (★ 11.7k) libraries for internationalization (see [docs](https://formatjs.io/docs/basic-internationalization-principles)).
135-
- [date-fns](https://formatjs.io/) (★ 22.3k) date utility library (see [docs]https://date-fns.org/docs/Getting-Started)).
136-
- [redux-persist-cookie-storage](https://github.com/abersager/redux-persist-cookie-storage) (★ 70) **Redux Persist** storage adapter for cookies.
137-
- [cookies-js](https://github.com/js-cookie/js-cookie) (★ 15.5k) API for handling browser cookies.
134+
- [date-fns](https://date-fns.org/) (★ 22.3k) date utility library (see [docs](https://date-fns.org/docs/Getting-Started)).
135+
- [cross-env](https://github.com/kentcdodds/cross-env) (★ 4.9k) run scripts that set and use environment variables across platforms (see [docs](https://www.npmjs.com/package/cross-env)).
138136

139137
### Unit Testing
140138

@@ -536,7 +534,7 @@ For requesting access to the [demo](https://react-firebase-admin-eeac2.firebasea
536534
537535
## Internationalization
538536
539-
For the internationalization we decided to choose the library [Format.js](https://formatjs.io/) using react-intl as the react integration. We made a wrapper called **LanguageWrapper** that contains all of our translation logic. Apart from that, we save the language preferences of the user in the redux store and we persist it using cookies ([redux-persist-cookie-storage](https://github.com/abersager/redux-persist-cookie-storage)). The user has the option to change their language preferences.
537+
For the internationalization we decided to choose the library [Format.js](https://formatjs.io/) using react-intl as the react integration. We made a wrapper called **LanguageWrapper** that contains all of our translation logic. Apart from that, we save the language preferences of the user in the redux store and we persist it using the local storage. The user has the option to change their language preferences.
540538
541539
![Boilerplate - Dinamical Internationalization](https://media.giphy.com/media/St3bw0rjlBQmKzf6fC/source.gif)
542540
@@ -686,7 +684,7 @@ We implemented social media authentication using Firebase!. You can take a look
686684
687685
### Can I add more login methods?
688686
689-
Yes you can!. We already have the setup in place for more login methods like Twitter, GitHub, etc. You can add them without chaning much code at all. You can see other login methods provided by Firebase [here](https://firebase.google.com/docs/auth/web/start).
687+
Yes you can!. We already have the setup in place for more login methods like Twitter, GitHub, etc. You can add them without changing much code at all. You can see other login methods provided by Firebase [here](https://firebase.google.com/docs/auth/web/start).
690688
691689
### Facebook
692690

package-lock.json

Lines changed: 52 additions & 131 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"bulma": "^0.9.0",
77
"bulma-social": "^1.1.1",
88
"classnames": "^2.2.6",
9-
"cookies-js": "^1.2.3",
109
"date-fns": "^2.15.0",
1110
"firebase": "^7.17.1",
1211
"prop-types": "^15.7.2",
@@ -23,7 +22,6 @@
2322
"redux": "^4.0.5",
2423
"redux-act": "^1.8.0",
2524
"redux-persist": "^6.0.0",
26-
"redux-persist-cookie-storage": "^1.0.0",
2725
"redux-thunk": "^2.3.0"
2826
},
2927
"scripts": {
@@ -35,8 +33,8 @@
3533
"setup-admin-dashboard": "npm install && npm build && firebase deploy",
3634
"deploy": "npm run build && firebase deploy --only hosting",
3735
"precommit:react": "npm test",
38-
"precommit:functions": "cd functions/ && tsc && npm test",
39-
"precommit": "CI=true npm run precommit:react && npm run precommit:functions"
36+
"precommit:functions": "cd functions/ && npm run build && npm test",
37+
"precommit": "cross-env CI=true npm run precommit:react && npm run precommit:functions"
4038
},
4139
"eslintConfig": {
4240
"extends": "react-app"
@@ -56,6 +54,7 @@
5654
"devDependencies": {
5755
"babel-eslint": "^10.1.0",
5856
"babel-loader": "^8.1.0",
57+
"cross-env": "^7.0.2",
5958
"deep-freeze": "^0.0.1",
6059
"dotenv": "^8.2.0",
6160
"enzyme": "^3.11.0",

src/components/LanguageWrapper/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ const LanguageWrapper = ({ children }) => {
99
const dispatch = useDispatch();
1010

1111
let { locale } = useSelector(
12-
state => ({
13-
locale: state.preferences.locale
12+
(state) => ({
13+
locale: state.preferences.locale,
1414
}),
1515
shallowEqual
1616
);

src/components/Navigation/NavBar/index.jsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ const NavBar = ({ handleMobileToggle, asideMobileActive }) => {
1515
const [navMobileActive, setNavMobileActive] = useState(false);
1616

1717
const { userName, logoUrl, locale } = useSelector(
18-
state => ({
18+
(state) => ({
1919
userName: state.auth.userData.name,
2020
logoUrl: state.auth.userData.logoUrl,
21-
locale: state.preferences.locale
21+
locale: state.preferences.locale,
2222
}),
2323
shallowEqual
2424
);
@@ -33,11 +33,11 @@ const NavBar = ({ handleMobileToggle, asideMobileActive }) => {
3333
setNavMobileActive(!navMobileActive);
3434
}, [setNavMobileActive, navMobileActive]);
3535

36-
const changeLocaleHandler = local => {
36+
const changeLocaleHandler = (local) => {
3737
dispatch(setUserLocale(local));
3838
};
3939

40-
const locales = availableLocales.filter(local => local !== locale);
40+
const locales = availableLocales.filter((local) => local !== locale);
4141

4242
return (
4343
<nav id="navbar-main" className="navbar is-fixed-top">
@@ -77,7 +77,7 @@ const NavBar = ({ handleMobileToggle, asideMobileActive }) => {
7777
</div>
7878
<div
7979
className={classNames('navbar-menu', 'fadeIn', 'animated', 'faster', {
80-
'is-active': navMobileActive
80+
'is-active': navMobileActive,
8181
})}
8282
id="navbar-menu"
8383
>
@@ -94,7 +94,7 @@ const NavBar = ({ handleMobileToggle, asideMobileActive }) => {
9494
</span>
9595
</a>
9696
<div className="navbar-dropdown">
97-
{locales.map(local => (
97+
{locales.map((local) => (
9898
<a
9999
onClick={() => changeLocaleHandler(local)}
100100
className="navbar-item"
@@ -150,7 +150,7 @@ const NavBar = ({ handleMobileToggle, asideMobileActive }) => {
150150

151151
NavBar.propTypes = {
152152
handleMobileToggle: PropTypes.func.isRequired,
153-
asideMobileActive: PropTypes.bool
153+
asideMobileActive: PropTypes.bool,
154154
};
155155

156156
export default NavBar;

src/state/reducers/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import { combineReducers } from 'redux';
22
import { persistReducer } from 'redux-persist';
33
import storage from 'redux-persist/lib/storage';
44
import { reducer as toastrReducer } from 'react-redux-toastr';
5-
import { CookieStorage } from 'redux-persist-cookie-storage';
6-
import Cookies from 'cookies-js';
75

86
import { authReducer } from './auth';
97
import { usersReducer } from './users';
@@ -19,7 +17,7 @@ export default combineReducers({
1917
authReducer
2018
),
2119
preferences: persistReducer(
22-
{ key: 'preferences', storage: new CookieStorage(Cookies) },
20+
{ key: 'preferences', storage },
2321
preferencesReducer
2422
),
2523
users: persistReducer(

0 commit comments

Comments
 (0)