Skip to content

Commit 0489c3a

Browse files
Fix Errors generated due to dependency updates
Framer Motion 10+ & Recharts 2.15 introduced stricter TypeScript typing rules.
1 parent 04b8b0b commit 0489c3a

File tree

4 files changed

+32
-21
lines changed

4 files changed

+32
-21
lines changed

apps/backend/source/controllers/auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export class AuthController {
8181
isUserAuthenticated = async (req: Request, res: Response, next: NextFunction) => {
8282
try {
8383
const uaRes = isAuthenticated(req.cookies.token);
84-
if (req.body.returnResponse) {
84+
if (req.body?.returnResponse || false) {
8585
// Frontend is asking if user is authenticated or not
8686
if (APP_CONSTANTS.APP_SINGLE_SIGN_ON === 'true') {
8787
return res.status(201).json({ isAuthenticated: true, isValidPassword: true });

apps/backend/source/controllers/shared.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ export class SharedController {
8282
const FIAT_VENUE = FIAT_VENUES.hasOwnProperty(req.params.fiatCurrency)
8383
? FIAT_VENUES[req.params.fiatCurrency]
8484
: 'COINGECKO';
85-
logger.info('Fiat URL: ' + FIAT_RATE_API + FIAT_VENUE + '/pairs/XBT/' + req.params.fiatCurrency);
85+
logger.info(
86+
'Fiat URL: ' + FIAT_RATE_API + FIAT_VENUE + '/pairs/XBT/' + req.params.fiatCurrency,
87+
);
8688
return axios
8789
.get(FIAT_RATE_API + FIAT_VENUE + '/pairs/XBT/' + req.params.fiatCurrency)
8890
.then((response: any) => {
@@ -100,11 +102,11 @@ export class SharedController {
100102
})
101103
.catch(err => {
102104
logger.error('Fiat Error Response: ' + JSON.stringify(err));
103-
res.status(200).json({ venue: "NONE", rate: "0" });
105+
res.status(200).json({ venue: 'NONE', rate: '0' });
104106
});
105107
} catch (error: any) {
106108
logger.error('Error from Fiat Rate: ' + JSON.stringify(error));
107-
res.status(200).json({ venue: "NONE", rate: "0" });
109+
res.status(200).json({ venue: 'NONE', rate: '0' });
108110
}
109111
};
110112

apps/frontend/src/components/bookkeeper/Volume/VolumeGraph/VolumeGraph.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ const VolumeGraph = () => {
8282
let pieColors: any[] = [];
8383
const RADIAN = Math.PI / 180;
8484

85-
const renderLabel = ({ cx, cy, midAngle, innerRadius, outerRadius, index, data, isInner = false }) => {
85+
const renderLabel = ({ cx, cy, midAngle, innerRadius, outerRadius, index, data, isInner = false }: any) => {
8686
const entry = data[index];
8787
const radius = innerRadius + (outerRadius - innerRadius) * (isInner ? 0.5 : 1.4);
8888
const x = cx + radius * Math.cos(-midAngle * RADIAN);

apps/frontend/src/utilities/constants.ts

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
faShekelSign,
99
faLiraSign,
1010
} from '@fortawesome/free-solid-svg-icons';
11+
import { cubicBezier, spring } from 'framer-motion';
1112
import moment from 'moment';
1213

1314
export const HOST = process.env.NODE_ENV !== 'production' ? 'localhost' : window.location.hostname;
@@ -325,30 +326,38 @@ export const ANIMATION_FINAL_STATE = { opacity: 1, scale: 1 };
325326
export const ANIMATION_TRANSITION = {
326327
duration: COUNTUP_DURATION,
327328
delay: 0,
328-
ease: [0, 0.71, 0.2, 1.01],
329+
ease: cubicBezier(0, 0.71, 0.2, 1.01),
329330
};
330331
export const ANIMATION_DELAYED_TRANSITION = {
331332
duration: COUNTUP_DURATION,
332333
delay: 0.5,
333-
ease: [0, 0.71, 0.2, 1.01],
334+
ease: cubicBezier(0, 0.71, 0.2, 1.01),
334335
};
335336

336337
export const OPACITY_VARIANTS = { visible: { opacity: 1 }, hidden: { opacity: 0 } };
337-
export const SPRING_VARIANTS = { type: 'spring', stiffness: 400, damping: 25 };
338-
export const BOUNCY_SPRING_VARIANTS_1 = { type: 'spring', stiffness: 600, damping: 20 };
339-
export const BOUNCY_SPRING_VARIANTS_2 = { type: 'spring', stiffness: 700, damping: 10 };
340-
export const BOUNCY_SPRING_VARIANTS_3 = { type: 'spring', stiffness: 400, damping: 8, delay: 0.2 };
341-
export const BOUNCY_SPRING_VARIANTS_4 = { type: 'spring', stiffness: 250, damping: 15 };
338+
export const SPRING_VARIANTS = { type: spring, stiffness: 400, damping: 25 };
339+
export const BOUNCY_SPRING_VARIANTS_1 = { type: spring, stiffness: 600, damping: 20 };
340+
export const BOUNCY_SPRING_VARIANTS_2 = { type: spring, stiffness: 700, damping: 10 };
341+
export const BOUNCY_SPRING_VARIANTS_3 = { type: spring, stiffness: 400, damping: 8, delay: 0.2 };
342+
export const BOUNCY_SPRING_VARIANTS_4 = { type: spring, stiffness: 250, damping: 15 };
342343
export const STAGERRED_SPRING_VARIANTS_1 = {
343344
hidden: { pathLength: 0, opacity: 0 },
344-
visible: i => {
345-
const delay = 0 + i * 0.5;
345+
visible: (i: number) => {
346+
const delay = i * 0.5;
346347
return {
347348
pathLength: 1,
348349
opacity: 1,
349350
transition: {
350-
pathLength: { delay, type: 'spring', duration: COUNTUP_DURATION, bounce: 0 },
351-
opacity: { delay, duration: 0.02 },
351+
pathLength: {
352+
delay,
353+
type: spring,
354+
duration: COUNTUP_DURATION,
355+
bounce: 0,
356+
},
357+
opacity: {
358+
delay,
359+
duration: 0.02,
360+
},
352361
},
353362
};
354363
},
@@ -360,20 +369,20 @@ export const STAGERRED_SPRING_VARIANTS_2 = {
360369
return {
361370
x: 0,
362371
transition: {
363-
x: { delay, type: 'spring', stiffness: 700, damping: 10 },
372+
x: { delay, type: spring, stiffness: 700, damping: 10 },
364373
},
365374
};
366375
},
367376
};
368377

369378
export const STAGERRED_SPRING_VARIANTS_3 = {
370379
hidden: { y: -10 },
371-
visible: i => {
380+
visible: (i: number) => {
372381
const delay = 0 + i * 0.5;
373382
return {
374383
y: 0,
375384
transition: {
376-
y: { delay, type: 'spring', stiffness: 700, damping: 4 },
385+
y: { delay, type: spring, stiffness: 700, damping: 4 },
377386
},
378387
};
379388
},
@@ -386,7 +395,7 @@ export const STAGERRED_SPRING_VARIANTS_4 = {
386395
return {
387396
opacity: 1,
388397
transition: {
389-
opacity: { delay, type: 'spring', stiffness: 500, damping: 3 },
398+
opacity: { delay, type: spring, stiffness: 500, damping: 3 },
390399
},
391400
};
392401
},
@@ -403,4 +412,4 @@ export const STAGERRED_COLOR_DRAIN = {
403412
},
404413
};
405414
},
406-
};
415+
} as const;

0 commit comments

Comments
 (0)