@@ -3,7 +3,7 @@ import axios from 'axios';
3
3
import classnames from 'classnames' ;
4
4
import qs from 'query-string' ;
5
5
import { Copy , Mail , Repeat } from 'react-feather' ;
6
- import type { QRCodeProps } from 'react-qr-svg ' ;
6
+ import type { QRCodeSVG } from 'qrcode. react' ;
7
7
8
8
import type { SemTimetableConfig } from 'types/timetables' ;
9
9
import type { ModuleCode , Semester } from 'types/modules' ;
@@ -48,7 +48,7 @@ export const SHORT_URL_KEY = 'shorturl';
48
48
49
49
export default class ShareTimetable extends React . PureComponent < Props , State > {
50
50
// React QR component is lazy loaded for performance
51
- static QRCode : React . ComponentType < QRCodeProps > | null ;
51
+ static QRCode : typeof QRCodeSVG | null ;
52
52
53
53
// Save a copy of the current URL to detect when URL changes
54
54
url : string | null = null ;
@@ -63,8 +63,8 @@ export default class ShareTimetable extends React.PureComponent<Props, State> {
63
63
64
64
override componentDidMount ( ) {
65
65
if ( ! ShareTimetable . QRCode ) {
66
- retryImport ( ( ) => import ( /* webpackChunkName: "export" */ 'react-qr-svg ' ) ) . then ( ( module ) => {
67
- ShareTimetable . QRCode = module . QRCode ;
66
+ retryImport ( ( ) => import ( /* webpackChunkName: "export" */ 'qrcode. react' ) ) . then ( ( module ) => {
67
+ ShareTimetable . QRCode = module . QRCodeSVG ;
68
68
this . forceUpdate ( ) ;
69
69
} ) ;
70
70
}
@@ -167,7 +167,7 @@ export default class ShareTimetable extends React.PureComponent<Props, State> {
167
167
< div className = "col-sm-4" >
168
168
< h3 className = { styles . shareHeading } > QR Code</ h3 >
169
169
< div className = { styles . qrCode } >
170
- { ShareTimetable . QRCode && < ShareTimetable . QRCode value = { url } /> }
170
+ { ShareTimetable . QRCode && < ShareTimetable . QRCode size = { 172 } value = { url } /> }
171
171
</ div >
172
172
</ div >
173
173
< div className = "col-sm-4" >
0 commit comments