Removed remaining flow errors
This commit is contained in:
parent
38a52a9e95
commit
965ddd3cb2
6 changed files with 35 additions and 19 deletions
|
@ -37,7 +37,7 @@ export default class WebSectionList extends React.PureComponent<Props, State> {
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
renderSectionHeader: null,
|
renderSectionHeader: null,
|
||||||
stickyHeader: false,
|
stickyHeader: false,
|
||||||
updateData: null,
|
updateData: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
webDataManager: WebDataManager;
|
webDataManager: WebDataManager;
|
||||||
|
@ -213,7 +213,9 @@ export default class WebSectionList extends React.PureComponent<Props, State> {
|
||||||
onRefresh={this.onRefresh}
|
onRefresh={this.onRefresh}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
//$FlowFixMe
|
||||||
renderSectionHeader={shouldRenderHeader ? this.props.renderSectionHeader : this.getEmptySectionHeader}
|
renderSectionHeader={shouldRenderHeader ? this.props.renderSectionHeader : this.getEmptySectionHeader}
|
||||||
|
//$FlowFixMe
|
||||||
renderItem={isEmpty ? this.getEmptyRenderItem : this.props.renderItem}
|
renderItem={isEmpty ? this.getEmptyRenderItem : this.props.renderItem}
|
||||||
style={{minHeight: 300, width: '100%'}}
|
style={{minHeight: 300, width: '100%'}}
|
||||||
stickySectionHeadersEnabled={this.props.stickyHeader}
|
stickySectionHeadersEnabled={this.props.stickyHeader}
|
||||||
|
|
|
@ -5,13 +5,19 @@ import {FlatList} from "react-native";
|
||||||
import packageJson from '../../package';
|
import packageJson from '../../package';
|
||||||
import {List} from 'react-native-paper';
|
import {List} from 'react-native-paper';
|
||||||
|
|
||||||
function generateListFromObject(object) {
|
type listItem = {
|
||||||
|
name: string,
|
||||||
|
version: string
|
||||||
|
};
|
||||||
|
|
||||||
|
function generateListFromObject(object: { [string]: string }): Array<listItem> {
|
||||||
let list = [];
|
let list = [];
|
||||||
let keys = Object.keys(object);
|
let keys = Object.keys(object);
|
||||||
let values = Object.values(object);
|
let values = Object.values(object);
|
||||||
for (let i = 0; i < keys.length; i++) {
|
for (let i = 0; i < keys.length; i++) {
|
||||||
list.push({name: keys[i], version: values[i]});
|
list.push({name: keys[i], version: values[i]});
|
||||||
}
|
}
|
||||||
|
//$FlowFixMe
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -131,7 +131,12 @@ class DebugScreen extends React.Component<Props, State> {
|
||||||
<Card.Content>
|
<Card.Content>
|
||||||
{Object.values(this.state.currentPreferences).map((object) =>
|
{Object.values(this.state.currentPreferences).map((object) =>
|
||||||
<View>
|
<View>
|
||||||
{DebugScreen.getGeneralItem(() => this.showEditModal(object), undefined, object.key, 'Click to edit')}
|
{DebugScreen.getGeneralItem(
|
||||||
|
() => this.showEditModal(object),
|
||||||
|
undefined,
|
||||||
|
//$FlowFixMe
|
||||||
|
object.key,
|
||||||
|
'Click to edit')}
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
</Card.Content>
|
</Card.Content>
|
||||||
|
|
|
@ -33,14 +33,16 @@ class PlanningDisplayScreen extends React.Component<Props> {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
// console.log("rendering planningDisplayScreen");
|
// console.log("rendering planningDisplayScreen");
|
||||||
|
let subtitle = PlanningEventManager.getFormattedEventTime(
|
||||||
|
this.displayData["date_begin"], this.displayData["date_end"]);
|
||||||
|
let dateString = PlanningEventManager.getDateOnlyString(this.displayData["date_begin"]);
|
||||||
|
if (dateString !== null)
|
||||||
|
subtitle += ' | ' + DateManager.getInstance().getTranslatedDate(dateString);
|
||||||
return (
|
return (
|
||||||
<ScrollView style={{paddingLeft: 5, paddingRight: 5}}>
|
<ScrollView style={{paddingLeft: 5, paddingRight: 5}}>
|
||||||
<Card.Title
|
<Card.Title
|
||||||
title={this.displayData.title}
|
title={this.displayData.title}
|
||||||
subtitle={
|
subtitle={subtitle}
|
||||||
PlanningEventManager.getFormattedEventTime(this.displayData["date_begin"], this.displayData["date_end"])
|
|
||||||
+ ' | '
|
|
||||||
+ DateManager.getInstance().getTranslatedDate(PlanningEventManager.getDateOnlyString(this.displayData["date_begin"]))}
|
|
||||||
/>
|
/>
|
||||||
{this.displayData.logo !== null ?
|
{this.displayData.logo !== null ?
|
||||||
<View style={{width: '100%', height: 300}}>
|
<View style={{width: '100%', height: 300}}>
|
||||||
|
|
|
@ -165,13 +165,13 @@ export default class Tetromino {
|
||||||
|
|
||||||
static colors: Object;
|
static colors: Object;
|
||||||
|
|
||||||
currentType: Object;
|
currentType: number;
|
||||||
currentShape: Object;
|
currentShape: Object;
|
||||||
currentRotation: number;
|
currentRotation: number;
|
||||||
position: Object;
|
position: Object;
|
||||||
colors: Object;
|
colors: Object;
|
||||||
|
|
||||||
constructor(type: Tetromino.types, colors: Object) {
|
constructor(type: number, colors: Object) {
|
||||||
this.currentType = type;
|
this.currentType = type;
|
||||||
this.currentRotation = 0;
|
this.currentRotation = 0;
|
||||||
this.currentShape = Tetromino.shapes[this.currentRotation][type];
|
this.currentShape = Tetromino.shapes[this.currentRotation][type];
|
||||||
|
@ -181,15 +181,15 @@ export default class Tetromino {
|
||||||
else
|
else
|
||||||
this.position.x = 3;
|
this.position.x = 3;
|
||||||
this.colors = colors;
|
this.colors = colors;
|
||||||
Tetromino.colors = {
|
Tetromino.colors = [
|
||||||
0: colors.tetrisI,
|
colors.tetrisI,
|
||||||
1: colors.tetrisO,
|
colors.tetrisO,
|
||||||
2: colors.tetrisT,
|
colors.tetrisT,
|
||||||
3: colors.tetrisS,
|
colors.tetrisS,
|
||||||
4: colors.tetrisZ,
|
colors.tetrisZ,
|
||||||
5: colors.tetrisJ,
|
colors.tetrisJ,
|
||||||
6: colors.tetrisL,
|
colors.tetrisL,
|
||||||
};
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
getColor() {
|
getColor() {
|
||||||
|
@ -210,7 +210,7 @@ export default class Tetromino {
|
||||||
return coordinates;
|
return coordinates;
|
||||||
}
|
}
|
||||||
|
|
||||||
rotate(isForward) {
|
rotate(isForward: boolean) {
|
||||||
if (isForward)
|
if (isForward)
|
||||||
this.currentRotation++;
|
this.currentRotation++;
|
||||||
else
|
else
|
||||||
|
|
|
@ -96,6 +96,7 @@ export default class AsyncStorageManager {
|
||||||
let prefKeys = [];
|
let prefKeys = [];
|
||||||
// Get all available keys
|
// Get all available keys
|
||||||
for (let [key, value] of Object.entries(this.preferences)) {
|
for (let [key, value] of Object.entries(this.preferences)) {
|
||||||
|
//$FlowFixMe
|
||||||
prefKeys.push(value.key);
|
prefKeys.push(value.key);
|
||||||
}
|
}
|
||||||
// Get corresponding values
|
// Get corresponding values
|
||||||
|
|
Loading…
Reference in a new issue