forked from input-output-hk/daedalus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DDW-596] switch to SWC and latest eslint
- Loading branch information
1 parent
889fbb6
commit e1a612b
Showing
79 changed files
with
1,188 additions
and
1,370 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,20 @@ | ||
/* eslint-disable react/prop-types */ | ||
import React, { Component, Fragment } from 'react'; | ||
import { useEffect } from 'react'; | ||
|
||
export default class WindowSizeManager extends Component { | ||
componentDidMount() { | ||
// @ts-ignore ts-migrate(2339) FIXME: Property 'minScreenHeight' does not exist on type ... Remove this comment to see the full error message | ||
this.updateMinScreenHeight(this.props.minScreenHeight); | ||
} | ||
|
||
componentDidUpdate(prevProps) { | ||
// @ts-ignore ts-migrate(2339) FIXME: Property 'minScreenHeight' does not exist on type ... Remove this comment to see the full error message | ||
if (this.props.minScreenHeight !== prevProps.minScreenHeight) { | ||
// @ts-ignore ts-migrate(2339) FIXME: Property 'minScreenHeight' does not exist on type ... Remove this comment to see the full error message | ||
this.updateMinScreenHeight(this.props.minScreenHeight); | ||
} | ||
} | ||
type Props = { | ||
minScreenHeight: number; | ||
children: Node; | ||
}; | ||
|
||
updateMinScreenHeight(minScreenHeight) { | ||
const rootWindowEl = document.getElementById('root'); | ||
|
||
if (rootWindowEl) { | ||
rootWindowEl.style.minHeight = minScreenHeight; | ||
} | ||
function updateMinScreenHeight(minScreenHeight: number) { | ||
const rootWindowEl = document.getElementById('root'); | ||
if (rootWindowEl) { | ||
rootWindowEl.style.minHeight = minScreenHeight.toString(); | ||
} | ||
} | ||
|
||
render() { | ||
return <Fragment>{this.props.children}</Fragment>; | ||
} | ||
export default function WindowSizeManager(props: Props) { | ||
useEffect(() => { | ||
updateMinScreenHeight(props.minScreenHeight); | ||
}, [props.minScreenHeight]); | ||
return props.children; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.