fix: react SFC & children
This commit is contained in:
parent
918f705c5c
commit
de34fab55c
|
|
@ -12,7 +12,7 @@ interface IProps {
|
||||||
style?: React.CSSProperties;
|
style?: React.CSSProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Container: React.FC<IProps> = ({children, style, ...props}) => {
|
const Container: React.FC<React.PropsWithChildren<IProps>> = ({children, style}) => {
|
||||||
const {classes} = useStyles();
|
const {classes} = useStyles();
|
||||||
return (
|
return (
|
||||||
<Paper elevation={6} className={classes.paper} style={style}>
|
<Paper elevation={6} className={classes.paper} style={style}>
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,12 @@ interface IProps {
|
||||||
maxWidth?: number;
|
maxWidth?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
const DefaultPage: FC<IProps> = ({title, rightControl, maxWidth = 700, children}) => (
|
const DefaultPage: FC<React.PropsWithChildren<IProps>> = ({
|
||||||
|
title,
|
||||||
|
rightControl,
|
||||||
|
maxWidth = 700,
|
||||||
|
children,
|
||||||
|
}) => (
|
||||||
<main style={{margin: '0 auto', maxWidth}}>
|
<main style={{margin: '0 auto', maxWidth}}>
|
||||||
<Grid container spacing={4}>
|
<Grid container spacing={4}>
|
||||||
<Grid size={{xs: 12}} style={{display: 'flex', flexWrap: 'wrap'}}>
|
<Grid size={{xs: 12}} style={{display: 'flex', flexWrap: 'wrap'}}>
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ interface IPanelWrapperProps {
|
||||||
icon?: React.ComponentType;
|
icon?: React.ComponentType;
|
||||||
}
|
}
|
||||||
|
|
||||||
const PanelWrapper: React.FC<IPanelWrapperProps> = ({
|
const PanelWrapper: React.FC<React.PropsWithChildren<IPanelWrapperProps>> = ({
|
||||||
name,
|
name,
|
||||||
description,
|
description,
|
||||||
refresh,
|
refresh,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import React, {SFC} from 'react';
|
import React from 'react';
|
||||||
import {Link} from 'react-router-dom';
|
import {Link} from 'react-router-dom';
|
||||||
import Grid from '@mui/material/Grid';
|
import Grid from '@mui/material/Grid';
|
||||||
import Paper from '@mui/material/Paper';
|
import Paper from '@mui/material/Paper';
|
||||||
|
|
@ -62,7 +62,7 @@ interface IRowProps {
|
||||||
fToggleStatus: VoidFunction;
|
fToggleStatus: VoidFunction;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Row: SFC<IRowProps> = observer(({name, id, token, enabled, fToggleStatus}) => (
|
const Row: React.FC<IRowProps> = observer(({name, id, token, enabled, fToggleStatus}) => (
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell>{id}</TableCell>
|
<TableCell>{id}</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue