diff --git a/.huskyrc b/.huskyrc deleted file mode 100644 index bb83017..0000000 --- a/.huskyrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "hooks": { - "pre-commit": "pretty-quick --staged" - } -} \ No newline at end of file diff --git a/.prettierrc b/.prettierrc index f973886..56c22f5 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,7 @@ { - semi: false, + "semi": false, "printWidth": 120, - "singleQuote": true + "singleQuote": true, + "trailingComma": "none", + "arrowParens": "avoid" } \ No newline at end of file diff --git a/README.md b/README.md index f605013..787f38d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ ### TODO: + - (Feature): Enhance toolbar to scroll away animate -- (Feature): Edit transactions - long hold \ No newline at end of file +- (Feature): Edit transactions - long hold +- (Feature): Auto refresh user info when user added into group +- (Bug): Log user out when session expires during graphql request diff --git a/designs/idea5.png b/designs/idea5.png new file mode 100644 index 0000000..2efac62 Binary files /dev/null and b/designs/idea5.png differ diff --git a/designs/idea6.png b/designs/idea6.png new file mode 100644 index 0000000..ec42e30 Binary files /dev/null and b/designs/idea6.png differ diff --git a/package-lock.json b/package-lock.json index 9871bb9..16a0fc0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3689,8 +3689,7 @@ "compare-versions": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", - "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", - "dev": true + "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==" }, "component-emitter": { "version": "1.3.0", @@ -5828,6 +5827,14 @@ "locate-path": "^2.0.0" } }, + "find-versions": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-3.2.0.tgz", + "integrity": "sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww==", + "requires": { + "semver-regex": "^2.0.0" + } + }, "flat-cache": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", @@ -6621,6 +6628,154 @@ "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=" }, + "husky": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/husky/-/husky-4.2.5.tgz", + "integrity": "sha512-SYZ95AjKcX7goYVZtVZF2i6XiZcHknw50iXvY7b0MiGoj5RwdgRQNEHdb+gPDPCXKlzwrybjFjkL6FOj8uRhZQ==", + "requires": { + "chalk": "^4.0.0", + "ci-info": "^2.0.0", + "compare-versions": "^3.6.0", + "cosmiconfig": "^6.0.0", + "find-versions": "^3.2.0", + "opencollective-postinstall": "^2.0.2", + "pkg-dir": "^4.2.0", + "please-upgrade-node": "^3.2.0", + "slash": "^3.0.0", + "which-pm-runs": "^1.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", + "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "cosmiconfig": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", + "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", + "requires": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.1.0", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.7.2" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "requires": { + "p-limit": "^2.2.0" + } + }, + "parse-json": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.0.tgz", + "integrity": "sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw==", + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1", + "lines-and-columns": "^1.1.6" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "requires": { + "find-up": "^4.0.0" + } + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==" + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==" + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "hyphenate-style-name": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/hyphenate-style-name/-/hyphenate-style-name-1.0.3.tgz", @@ -9639,6 +9794,11 @@ } } }, + "opencollective-postinstall": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz", + "integrity": "sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw==" + }, "opn": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/opn/-/opn-5.5.0.tgz", @@ -10089,6 +10249,14 @@ "find-up": "^2.1.0" } }, + "please-upgrade-node": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", + "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", + "requires": { + "semver-compare": "^1.0.0" + } + }, "plist": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.1.tgz", @@ -12530,6 +12698,16 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" }, + "semver-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", + "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=" + }, + "semver-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-2.0.0.tgz", + "integrity": "sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw==" + }, "send": { "version": "0.17.1", "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", @@ -15888,6 +16066,11 @@ "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" }, + "which-pm-runs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", + "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=" + }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", diff --git a/package.json b/package.json index 274cfb6..30d5748 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,9 @@ "android:copy": "ionic capacitor copy android", "android:initial": "ionic capacitor add android" }, + "hooks": { + "pre-commit": "pretty-quick --staged" + }, "repository": { "type": "git", "url": "git+https://github.com/mrowe009/FinanceApp.git" @@ -46,6 +49,7 @@ }, "devDependencies": { "@capacitor/cli": "2.0.1", + "husky": "^4.2.5", "prettier": "^2.0.4", "pretty-quick": "^2.0.1" }, diff --git a/src/App.js b/src/App.js index 43b22fa..215078e 100644 --- a/src/App.js +++ b/src/App.js @@ -29,6 +29,9 @@ const client = new ApolloClient({ } }) } + // onError: ({ graphQLErrors }) => { + // // handle when session expires during GraphQL request + // } }) const App = () => ( diff --git a/src/components/AuthorizedRoute.js b/src/components/AuthorizedRoute.js index 3323272..f57006d 100644 --- a/src/components/AuthorizedRoute.js +++ b/src/components/AuthorizedRoute.js @@ -9,13 +9,13 @@ import { useAuthentication, useUser } from 'modules/authentication' export const AuthorizedRoute = ({ path, admin, component }) => { const { isAuthenticated } = useAuthentication() - const { role } = useUser() + const { isAdmin } = useUser() if (!isAuthenticated) { return } - if (admin && role !== 'ADMIN') { + if (admin && !isAdmin) { return } diff --git a/src/components/FullPageLoader.js b/src/components/FullPageLoader.js index 66e7e16..5ed1038 100644 --- a/src/components/FullPageLoader.js +++ b/src/components/FullPageLoader.js @@ -51,4 +51,4 @@ export const RelativeLoader = () => { ) -} \ No newline at end of file +} diff --git a/src/components/Transaction.js b/src/components/Transaction.js index a71c90f..02baf35 100644 --- a/src/components/Transaction.js +++ b/src/components/Transaction.js @@ -10,7 +10,7 @@ const useTransactionStyles = createUseStyles(theme => ({ transaction: { marginBottom: theme.spacing(2), borderRadius: theme.spacing(1), - boxShadow: '0px 2px 5px -2px var(--black)', + boxShadow: '0px 2px 5px -2px var(--black)' }, label: { display: 'flex', @@ -41,14 +41,18 @@ export const TransactionEntry = ({ id, amount, description, createdAt, onCheckbo -

{description || ((blank))}

+

{description || (blank)}

{formatDate(createdAt)}

${(amount / 100).toFixed(2)}

- {group &&

group

} + {group && ( +

+ group +

+ )}
diff --git a/src/elements/Input.js b/src/elements/Input.js index 13e616d..3587841 100644 --- a/src/elements/Input.js +++ b/src/elements/Input.js @@ -37,7 +37,9 @@ const useAutoFocus = autoFocus => { export const Input = ({ className, onChange, onBlur, autoFocus, ...rest }) => { const classes = useInputStyles() const element = useAutoFocus(autoFocus) - return + return ( + + ) } Input.propTypes = { @@ -63,7 +65,14 @@ export const MaskedInput = ({ className, onChange, onBlur, format, value, autoFo ) return ( - + ) } diff --git a/src/modules/admin/util.js b/src/modules/admin/util.js index d775375..506e40f 100644 --- a/src/modules/admin/util.js +++ b/src/modules/admin/util.js @@ -33,4 +33,4 @@ export const useUsersTabStyles = createUseStyles(theme => ({ wrapper: { margin: theme.spacing(2, 2, 0) } -})) \ No newline at end of file +})) diff --git a/src/modules/admin/views/AdminView.js b/src/modules/admin/views/AdminView.js index e9c976d..53df368 100644 --- a/src/modules/admin/views/AdminView.js +++ b/src/modules/admin/views/AdminView.js @@ -4,8 +4,10 @@ import { IonToolbar, IonSegment, IonSegmentButton, IonLabel } from '@ionic/react import PayTransaction from './PayTab' import Users from './UsersTab' import { Toolbar } from 'components' +import { useUser } from 'modules/authentication' const Admin = () => { + const { inGroup } = useUser() const [activeTab, changeTab] = useState('pay') const handleTabChange = useCallback(e => changeTab(e.target.value), []) @@ -14,19 +16,21 @@ const Admin = () => { - - - Pay - + extraToolbar={ + inGroup && ( + + + + Pay + - - Users - - - - )} + + Users + + + + ) + } /> {activeTab === 'pay' && } {activeTab === 'users' && } diff --git a/src/modules/admin/views/PayTab.js b/src/modules/admin/views/PayTab.js index 58c5a62..75c3cd8 100644 --- a/src/modules/admin/views/PayTab.js +++ b/src/modules/admin/views/PayTab.js @@ -23,7 +23,7 @@ const PayTransaction = () => { const [payTransaction, { loading: ptLoading }] = useMutation(PayTransactions, { variables: { transactionIds }, awaitRefetchQueries: true, - refetchQueries: ['UserTransactions'], + refetchQueries: ['UserTransactions', 'GroupTransactions'], onCompleted: () => Pubsub.emit('TOAST_NOTIFICATION', 'Transactions Paid') }) const checkboxClick = useCallback( @@ -50,23 +50,27 @@ const PayTransaction = () => {
{isEmpty(transactions) ? ( -
No transactions
+
+ No transactions +
- ) : Object.keys(transactions).map(email => ( - - -
{email}
-
- {map(t => ( - - ))(transactions[email])} -
- ))} + ) : ( + Object.keys(transactions).map(email => ( + + +
{email}
+
+ {map(t => ( + + ))(transactions[email])} +
+ )) + )}
{!!transactionIds.length && ( diff --git a/src/modules/user/user.gql.js b/src/modules/user/user.gql.js index 8749986..e1136ba 100644 --- a/src/modules/user/user.gql.js +++ b/src/modules/user/user.gql.js @@ -12,11 +12,16 @@ export const UserFragment = gql` export const GetUser = gql` query GetUser { me { - id - allowance - dueDate + ...UserFragment + isAdmin + inGroup + cards { + name + dueDate + } } } + ${UserFragment} ` export const UpdateUser = gql` diff --git a/src/modules/user/views/UserView.js b/src/modules/user/views/UserView.js index be29af2..8db0440 100644 --- a/src/modules/user/views/UserView.js +++ b/src/modules/user/views/UserView.js @@ -18,10 +18,10 @@ const ProfileView = () => { const [updateProfile, { loading: saving }] = useUpdateUser() const initialValues = useMemo(() => pick(['allowance', 'dueDate'])(userProps), [userProps]) const [editState, toggleEditState] = useToggle(false) - const onSubmit = useCallback( - values => updateProfile(values).finally(() => toggleEditState()), - [updateProfile, toggleEditState] - ) + const onSubmit = useCallback(values => updateProfile(values).finally(() => toggleEditState()), [ + updateProfile, + toggleEditState + ]) const onReset = useCallback(() => toggleEditState(), [toggleEditState]) return ( diff --git a/src/styles/theme.css b/src/styles/theme.css index c2d48f1..fdd47c5 100644 --- a/src/styles/theme.css +++ b/src/styles/theme.css @@ -13,23 +13,23 @@ body { /** Ionic CSS Variables **/ :root { /** font **/ - --ion-font-family: "Ubuntu"; + --ion-font-family: 'Ubuntu'; /** colors **/ --white: #ffffff; --black: #000000; - --gray1: #F8F8F8; - --gray2: #F0F0F0; - --gray3: #ECECEC; - --gray4: #E8E8E8; - --gray5: #BEBEBE; - --gray6: #9C9C9C; + --gray1: #f8f8f8; + --gray2: #f0f0f0; + --gray3: #ececec; + --gray4: #e8e8e8; + --gray5: #bebebe; + --gray6: #9c9c9c; --gray7: #6d6d6d; --themeGray1: #2d2f38; --themeGray2: #202129; --alpha0: rgba(0, 0, 0, 0); - --alpha25: rgba(0, 0, 0, .25); - --alpha5: rgba(0, 0, 0, .5); + --alpha25: rgba(0, 0, 0, 0.25); + --alpha5: rgba(0, 0, 0, 0.5); /** variables **/ --borderRadius: 6px; @@ -37,29 +37,31 @@ body { /** shade === darker **/ /** tint === lighter **/ + /** #313347 + #60637e **/ + /** primary **/ - --ion-color-primary: #02B25F; + --ion-color-primary: #02b25f; --ion-color-primary-rgb: 2, 178, 95; --ion-color-primary-contrast: #ffffff; --ion-color-primary-contrast-rgb: 255, 255, 255; --ion-color-primary-shade: #009946; - --ion-color-primary-tint: #02B25F; + --ion-color-primary-tint: #02b25f; /** secondary **/ --ion-color-secondary: #004ec2; --ion-color-secondary-rgb: 73, 71, 214; --ion-color-secondary-contrast: #ffffff; --ion-color-secondary-contrast-rgb: 255, 255, 255; - --ion-color-secondary-shade: #302EBD; - --ion-color-secondary-tint: #6361F0; + --ion-color-secondary-shade: #302ebd; + --ion-color-secondary-tint: #6361f0; /** tertiary **/ --ion-color-tertiary: #277550; --ion-color-tertiary-rgb: 39, 117, 80; --ion-color-tertiary-contrast: #ffffff; --ion-color-tertiary-contrast-rgb: 255, 255, 255; - --ion-color-tertiary-shade: #0E5C37; - --ion-color-tertiary-tint: #418F6A; + --ion-color-tertiary-shade: #0e5c37; + --ion-color-tertiary-tint: #418f6a; /** success **/ --ion-color-success: #10dc60; @@ -91,14 +93,14 @@ body { --ion-color-dark-contrast: #ffffff; --ion-color-dark-contrast-rgb: 255, 255, 255; --ion-color-dark-shade: #070810; - --ion-color-dark-tint: #3A3B43; + --ion-color-dark-tint: #3a3b43; /** medium **/ --ion-color-medium: #2d2f38; --ion-color-medium-rgb: 45, 47, 56; --ion-color-medium-contrast: #ffffff; --ion-color-medium-contrast-rgb: 255, 255, 255; - --ion-color-medium-shade: #14161F; + --ion-color-medium-shade: #14161f; --ion-color-medium-tint: #474952; /** light **/ @@ -115,48 +117,48 @@ body { --ion-toolbar-color: var(--white); } -*[color="textSecondary"] { +*[color='textSecondary'] { color: var(--gray6); } -*[color="textPrimary"] { +*[color='textPrimary'] { color: var(--black); } p { - font-size: .875rem; + font-size: 0.875rem; line-height: 1.5; } -p[variant="body2"] { - font-size: .875rem; +p[variant='body2'] { + font-size: 0.875rem; line-height: 1.43; } -p[variant="subtitle1"] { +p[variant='subtitle1'] { font-size: 1rem; line-height: 1.75; } -p[variant="subtitle2"] { - font-size: .875rem; +p[variant='subtitle2'] { + font-size: 0.875rem; line-height: 1.57; } -p[variant="caption"] { - font-size: .70rem; +p[variant='caption'] { + font-size: 0.7rem; line-height: 1.66; } -p[display="inline"] { +p[display='inline'] { display: inline-block; } -*[align="right"] { +*[align='right'] { text-align: right; } -*[align="center"] { +*[align='center'] { text-align: center; } diff --git a/src/utils/normalizer.js b/src/utils/normalizer.js index a884035..39fd11d 100644 --- a/src/utils/normalizer.js +++ b/src/utils/normalizer.js @@ -8,11 +8,7 @@ export const pluralize = (count, string) => (1 === count ? string : `${string}s` export const determineDays = (dueDate = 1) => { const now = new Date() const nextPaymentDate = - dayjs().date() <= dueDate - ? dayjs().set('date', dueDate) - : dayjs() - .set('date', dueDate) - .add(2, 'week') + dayjs().date() <= dueDate ? dayjs().set('date', dueDate) : dayjs().set('date', dueDate).add(2, 'week') const difference = dayjs(nextPaymentDate).diff(now, 'day') if (difference === 14 || difference === 0) {