Skip to content

Commit 0374652

Browse files
Update next and next dependencies (#46)
* Remove Next-Sass(Next added native support in 9.2) * Update Next and Node-sass. * Add config for typescript-plugin-css-modules * Rewrite SCSS to SCSS Modules. * Update TSC * Some missing Styles * Prettier 2 * Upgrade * Update other deps and fix rest of global css * Fix tsc * Add size-limit check * Update * Update node * Make sure modals show Co-authored-by: Michal Miszczyszyn <michal@mmiszy.pl>
1 parent e8721ad commit 0374652

File tree

100 files changed

+12134
-13927
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+12134
-13927
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
API_URL="http://api.devfaq.localhost:3002"
2+
API_URL="https://staging-api.devfaq.pl"
23
GA_TRACKING_ID=""
34
ABSOLUTE_URL="http://app.devfaq.localhost:3000"
45
SENTRY_DSN=

.github/workflows/bundleanalyze.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/workflows/test-PR.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ jobs:
6161

6262
- name: Run build
6363
if: steps.cache-to-skip.outputs.cache-hit != 'true'
64-
env:
65-
BUNDLE_ANALYZER_TOKEN: ${{ secrets.BUNDLE_ANALYZER_TOKEN }}
66-
run: ANALYZE=true npm run build
64+
run: npm run build
65+
66+
- name: Sizelimit
67+
uses: andresz1/size-limit-action@v1.3.1
68+
with:
69+
github_token: ${{ secrets.GITHUB_TOKEN }}
70+
skip_step: build

app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ app
2424
const port = process.env.PORT || '3000';
2525
server.listen(port, () => console.log(`Server listening at localhost:${port}`));
2626
})
27-
.catch(err => {
27+
.catch((err) => {
2828
console.error(err);
2929
process.exit(1);
3030
});

components/activeLink/ActiveLink.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ import { connect } from 'react-redux';
55
import { RouteDetails } from '../../utils/types';
66
import Link, { LinkProps } from 'next/link';
77
import { hrefQueryToAsPath } from '../../utils/redirect';
8+
import invariant from 'invariant';
89

910
interface ActiveLinkOwnProps {
10-
activeClassName?: string;
11+
activeClassName: string;
1112
exact?: boolean;
1213
disabledWhenActive?: boolean;
1314
onClick?: React.MouseEventHandler<any>;
1415
children: React.ReactElement<any>;
15-
query?: Record<string, string[] | string>;
16+
query?: Record<string, string[] | string | undefined>;
1617
}
1718

1819
type ActiveLinkComponentProps = Omit<LinkProps, 'as'> & ActiveLinkOwnProps;
@@ -38,7 +39,7 @@ class ActiveLinkComponent extends React.Component<
3839
render() {
3940
const {
4041
isMatch,
41-
activeClassName = 'active',
42+
activeClassName,
4243
disabledWhenActive,
4344
query,
4445
as,
@@ -52,6 +53,8 @@ class ActiveLinkComponent extends React.Component<
5253
prefetch,
5354
} = this.props;
5455

56+
invariant(activeClassName != null, 'activeClassName is required!');
57+
5558
const child = React.Children.only(children);
5659
const newChild = this.conditionallyAddClassToChild(isMatch, activeClassName, child);
5760

components/adminQuestions/AdminQuestions.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ import { connect } from 'react-redux';
66
import { TechnologyKey } from '../../constants/technology-icon-items';
77
import { Question } from '../../redux/reducers/questions';
88
import { CommonModalProps } from '../modals/baseModal/BaseModal';
9+
import questionListStyles from '../questions/questionsList/questionsList.module.scss';
10+
import noQuestionsStyles from '../questions/selectedQuestions/noQuestionsSelectedInfo.module.scss';
11+
import spinnerStyles from '../../components/layout/appSpinner.module.scss';
12+
import classNames from 'classnames';
913

1014
type AdminQuestionsProps = ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps;
1115
type AdminQuestionsState = {
@@ -48,15 +52,15 @@ class AdminQuestions extends React.Component<AdminQuestionsProps, AdminQuestions
4852
return;
4953
}
5054

51-
const question = this.props.questions.data.data.find(q => q.id === questionId);
55+
const question = this.props.questions.data.data.find((q) => q.id === questionId);
5256
if (!question) {
5357
return;
5458
}
5559

5660
this.props.uiOpenEditQuestionModal(question, this.onEditFinished);
5761
};
5862

59-
onEditFinished: CommonModalProps['onClose'] = e => {
63+
onEditFinished: CommonModalProps['onClose'] = (e) => {
6064
if (e.reason && e.reason === 'submit') {
6165
this.refetchQuestions();
6266
}
@@ -67,15 +71,15 @@ class AdminQuestions extends React.Component<AdminQuestionsProps, AdminQuestions
6771
return null;
6872
}
6973
return (
70-
<div className="app-questions--list" style={{ flex: 1 }}>
71-
<div className="selected-questions--empty container">
74+
<div className={questionListStyles.appQuestionsList} style={{ flex: 1 }}>
75+
<div className={classNames(noQuestionsStyles, 'container')}>
7276
<p>Nie zadnych pytań do zaakceptowania!</p>
7377
</div>
7478
</div>
7579
);
7680
};
7781

78-
updateStatus: React.ChangeEventHandler<HTMLSelectElement> = e => {
82+
updateStatus: React.ChangeEventHandler<HTMLSelectElement> = (e) => {
7983
this.setState({ status: e.currentTarget.value as 'pending' | 'accepted' });
8084
};
8185

@@ -94,7 +98,7 @@ class AdminQuestions extends React.Component<AdminQuestionsProps, AdminQuestions
9498
<option value="accepted">accepted</option>
9599
</select>
96100
</label>
97-
{this.props.questions.isLoading && <div className="spinner" />}
101+
{this.props.questions.isLoading && <div className={spinnerStyles.spinner} />}
98102
{this.maybeRenderEmptyMessage()}
99103
<QuestionsList
100104
selectable={false}
@@ -123,7 +127,4 @@ const mapDispatchToProps = {
123127
uiOpenEditQuestionModal: ActionCreators.uiOpenEditQuestionModal,
124128
};
125129

126-
export default connect(
127-
mapStateToProps,
128-
mapDispatchToProps
129-
)(AdminQuestions);
130+
export default connect(mapStateToProps, mapDispatchToProps)(AdminQuestions);

components/animateProperty/AnimateProperty.tsx

Lines changed: 46 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react';
22
import { Transition } from 'react-transition-group';
3-
import { EndHandler, EnterHandler, ExitHandler } from 'react-transition-group/Transition';
43

54
export class AnimateHeight extends React.PureComponent<{
65
in?: boolean;
@@ -15,78 +14,61 @@ export class AnimateHeight extends React.PureComponent<{
1514
return `${this.props.exitTime}ms`;
1615
}
1716

18-
onExit: ExitHandler = el => {
19-
// console.log('onExit');
20-
// @ts-ignore
21-
el.style.willChange = 'height, opacity';
22-
el.style.height = el.scrollHeight + 'px';
23-
el.style.opacity = '1';
24-
this.reflow(el);
25-
};
26-
27-
onExiting: ExitHandler = el => {
28-
// console.log('onExiting');
29-
el.style.height = '0';
30-
el.style.opacity = '0';
31-
el.style.minHeight = '0';
32-
el.style.transition = `height ${this.exitDuration}, opacity ${this.exitDuration}`;
33-
};
34-
35-
onExited: ExitHandler = el => {
36-
// console.log('onExited');
37-
el.style.height = '';
38-
el.style.opacity = '';
39-
el.style.transition = '';
40-
el.style.minHeight = '';
41-
};
42-
43-
onEnter: EnterHandler = el => {
44-
// console.log('onEnter');
45-
// @ts-ignore
46-
el.style.willChange = 'height, opacity';
47-
el.style.height = '0';
48-
el.style.opacity = '0';
49-
el.style.minHeight = '0';
50-
this.reflow(el);
51-
};
52-
53-
onEntering: EnterHandler = el => {
54-
// console.log('onEntering');
55-
el.style.height = el.scrollHeight + 'px';
56-
el.style.opacity = '1';
57-
el.style.transition = `height ${this.enterDuration}, opacity ${this.enterDuration}`;
58-
};
59-
60-
onEntered: EnterHandler = el => {
61-
// console.log('onEntered');
62-
el.style.height = '';
63-
el.style.opacity = '';
64-
el.style.transition = '';
65-
el.style.minHeight = '';
66-
};
67-
68-
addEndListener: EndHandler = (el, done) => {
69-
// console.log('addEndListener');
70-
el.addEventListener('transitionend', done, { once: true, passive: true });
71-
};
72-
7317
render() {
7418
const { in: isIn, enterTime, exitTime } = this.props;
7519

76-
// @ts-ignore
7720
const isBrowser = !process || !!process.browser;
7821

7922
return (
8023
<Transition
8124
in={isIn}
8225
timeout={{ enter: enterTime, exit: exitTime }}
83-
onExit={this.onExit}
84-
onExiting={this.onExiting}
85-
onExited={this.onExited}
86-
onEnter={this.onEnter}
87-
onEntering={this.onEntering}
88-
onEntered={this.onEntered}
89-
addEndListener={this.addEndListener}
26+
onExit={(el) => {
27+
// console.log('onExit');
28+
el.style.willChange = 'height, opacity';
29+
el.style.height = el.scrollHeight + 'px';
30+
el.style.opacity = '1';
31+
this.reflow(el);
32+
}}
33+
onExiting={(el) => {
34+
// console.log('onExiting');
35+
el.style.height = '0';
36+
el.style.opacity = '0';
37+
el.style.minHeight = '0';
38+
el.style.transition = `height ${this.exitDuration}, opacity ${this.exitDuration}`;
39+
}}
40+
onExited={(el) => {
41+
// console.log('onExited');
42+
el.style.height = '';
43+
el.style.opacity = '';
44+
el.style.transition = '';
45+
el.style.minHeight = '';
46+
}}
47+
onEnter={(el, isAppearing) => {
48+
// console.log('onEnter');
49+
// @ts-ignore
50+
el.style.willChange = 'height, opacity';
51+
el.style.height = '0';
52+
el.style.opacity = '0';
53+
el.style.minHeight = '0';
54+
this.reflow(el);
55+
}}
56+
onEntering={(el, isAppearing) => {
57+
// console.log('onEntering');
58+
el.style.height = el.scrollHeight + 'px';
59+
el.style.opacity = '1';
60+
el.style.transition = `height ${this.enterDuration}, opacity ${this.enterDuration}`;
61+
}}
62+
onEntered={(el, isAppearing) => {
63+
// console.log('onEntered');
64+
el.style.height = '';
65+
el.style.opacity = '';
66+
el.style.transition = '';
67+
el.style.minHeight = '';
68+
}}
69+
addEndListener={(el, done) => {
70+
el.addEventListener('transitionend', done, { once: true, passive: true });
71+
}}
9072
unmountOnExit={isBrowser}
9173
>
9274
{() => this.props.children}

components/appLogo/AppLogo.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import './appLogo.scss';
1+
import styles from './appLogo.module.scss';
22

33
const AppLogo = ({ fill = '#ffffff' }) => {
44
return (
5-
<span className="app-logo">
6-
<span className="scaling-svg-container" style={{ height: '100%' }}>
5+
<span className={styles.appLogo}>
6+
<span className={styles.scalingSvgContainer} style={{ height: '100%' }}>
77
<svg
8-
className="scaling-svg"
8+
className={styles.scalingSvg}
99
width="472px"
1010
height="104px"
1111
xmlns="http://www.w3.org/2000/svg"

components/asyncComponent/AsyncComponent.tsx

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)