Commit e63508b1 authored by Rafael's avatar Rafael

Adiciona alterações de migração.

parent c5e9603f
--registry "https://nexus.dev.evologica.com.br/repository/npm/" --registry "https://nexus.dev.evologica.com.br/repository/npm"
"@curio:registry" "https://nexus.dev.evologica.com.br/repository/npm" "@curio:registry" "https://nexus.dev.evologica.com.br/repository/npm"
"@dynamo:registry" "https://nexus.dev.evologica.com.br/repository/npm" "@dynamo:registry" "https://nexus.dev.evologica.com.br/repository/npm"
\ No newline at end of file
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
[ [
"babel-plugin-import", "babel-plugin-import",
{ {
"libraryName": "@material-ui/core", "libraryName": "@mui/material",
"libraryDirectory": "esm", "libraryDirectory": "",
"camel2DashComponentName": false "camel2DashComponentName": false
}, },
"core" "core"
...@@ -30,20 +30,20 @@ ...@@ -30,20 +30,20 @@
[ [
"babel-plugin-import", "babel-plugin-import",
{ {
"libraryName": "@material-ui/lab", "libraryName": "@mui/icons-material",
"libraryDirectory": "esm", "libraryDirectory": "",
"camel2DashComponentName": false "camel2DashComponentName": false
}, },
"lab" "icons"
], ],
[ [
"babel-plugin-import", "babel-plugin-import",
{ {
"libraryName": "@material-ui/icons", "libraryName": "@mui/lab",
"libraryDirectory": "esm", "libraryDirectory": "",
"camel2DashComponentName": false "camel2DashComponentName": false
}, },
"icons" "lab"
], ],
"@babel/plugin-proposal-optional-chaining", "@babel/plugin-proposal-optional-chaining",
"@babel/plugin-proposal-nullish-coalescing-operator", "@babel/plugin-proposal-nullish-coalescing-operator",
......
...@@ -80,17 +80,19 @@ ...@@ -80,17 +80,19 @@
}, },
"dependencies": { "dependencies": {
"@curio/client": "1.3.3", "@curio/client": "1.3.3",
"@curio/components": "^0.1.6", "@curio/components": "^1.0.3",
"@curio/ui": "^0.1.0", "@curio/ui": "^0.1.0",
"@date-io/date-fns": "^1.0.0", "@date-io/date-fns": "^1.0.0",
"@dynamo/components": "0.70.1", "@dynamo/components": "0.70.1",
"@dynamo/curio": "0.70.1", "@dynamo/curio": "0.70.1",
"@dynamo/material-ui": "0.70.1", "@dynamo/material-ui": "0.70.1",
"@material-ui/core": "4.11.4", "@emotion/react": "^11.4.1",
"@material-ui/icons": "^4.11.2", "@emotion/styled": "^11.3.0",
"@material-ui/lab": "4.0.0-alpha.58",
"@material-ui/pickers": "^3.3.10",
"@microcredito/client": "^0.7.26", "@microcredito/client": "^0.7.26",
"@mui/icons-material": "^5.0.0",
"@mui/lab": "^5.0.0-alpha.46",
"@mui/material": "^5.0.0",
"@mui/system": "^5.0.0",
"@reduxjs/toolkit": "^1.2.5", "@reduxjs/toolkit": "^1.2.5",
"@types/react-swipeable-views": "^0.13.1", "@types/react-swipeable-views": "^0.13.1",
"@types/react-swipeable-views-utils": "^0.13.3", "@types/react-swipeable-views-utils": "^0.13.3",
...@@ -103,8 +105,8 @@ ...@@ -103,8 +105,8 @@
"deepmerge": "^4.2.2", "deepmerge": "^4.2.2",
"normalizr": "^3.6.1", "normalizr": "^3.6.1",
"p-min-delay": "^4.0.0", "p-min-delay": "^4.0.0",
"react": "^16.0.0", "react": "^17.0.0",
"react-dom": "^16.0.0", "react-dom": "^17.0.0",
"react-loading-skeleton": "^2.0.1", "react-loading-skeleton": "^2.0.1",
"react-redux": "^7.2.0", "react-redux": "^7.2.0",
"react-router": "5.2.0", "react-router": "5.2.0",
......
...@@ -21,3 +21,12 @@ export interface CreditInstallment extends Entity { ...@@ -21,3 +21,12 @@ export interface CreditInstallment extends Entity {
export interface CreditGracePeriod extends Entity { export interface CreditGracePeriod extends Entity {
description: string description: string
} }
interface OutputGetVisitContext {
gracePeriods: CreditGracePeriod
}
export interface GetVisitContext {
Input: void
Output: OutputGetVisitContext
}
import React from 'react' import React from 'react'
import { Button, LinearProgress } from '@material-ui/core' import { Button, LinearProgress } from '@mui/material'
import { ButtonProps } from '@material-ui/core/Button' import { ButtonProps } from '@mui/material/Button'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { styles } from './styles' import { styles } from './styles'
type ExtendedTypes = WithStyles<typeof styles> & type ExtendedTypes = Pick<ButtonProps, 'disabled' | 'onClick' | 'type' | 'children' | 'sx' | 'color' | 'size' | 'variant'>
Pick<ButtonProps, 'disabled' | 'onClick' | 'type' | 'children' | 'className' | 'color' | 'size' | 'variant'>
interface Props extends ExtendedTypes { interface Props extends ExtendedTypes {
fetching?: boolean fetching?: boolean
} }
const ButtonWithProgress = (props: Props) => { const ButtonWithProgress = (props: Props) => {
const { className, classes, fetching, disabled, onClick, type, children, color = 'primary', size, variant = 'contained' } = props const { sx, fetching, disabled, onClick, type, children, color = 'primary', size, variant = 'contained' } = props
return ( return (
<Button className={className} disabled={disabled || fetching} onClick={onClick} variant={variant} color={color} type={type} size={size}> <Button sx={sx} disabled={disabled || fetching} onClick={onClick} variant={variant} color={color} type={type} size={size}>
{fetching && <LinearProgress className={classes.progress} />} {fetching && <LinearProgress sx={styles.progress} />}
{children} {children}
</Button> </Button>
) )
} }
export default withStyles(styles)(ButtonWithProgress) export default ButtonWithProgress
import { Theme, createStyles } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
export const styles = (theme: Theme) => { export const styles = createSxStyles({
return createStyles({ progress: {
progress: { bottom: 0,
bottom: 0, margin: 0,
margin: 0, width: '100%',
width: '100%', position: 'absolute',
position: 'absolute' },
} })
})
}
import React from 'react' import React from 'react'
import ListItem from '@material-ui/core/ListItem'
import ListItemIcon from '@material-ui/core/ListItemIcon' import ListItem, { ListItemProps } from '@mui/material/ListItem'
import ListItemText from '@material-ui/core/ListItemText' import ListItemIcon from '@mui/material/ListItemIcon'
import ListItemText from '@mui/material/ListItemText'
interface Props { interface Props {
label: string label: string
className?: string sx?: ListItemProps['sx']
children: React.ReactElement children: React.ReactElement
onClick?: () => void onClick?: () => void
} }
const ItemWithIcon = (props: Props) => { const ItemWithIcon = (props: Props) => {
const { className, label, children, onClick } = props const { sx, label, children, onClick } = props
return ( return (
<ListItem button className={className} onClick={onClick}> <ListItem button sx={sx} onClick={onClick}>
<ListItemIcon>{children}</ListItemIcon> <ListItemIcon>{children}</ListItemIcon>
<ListItemText primary={label} /> <ListItemText primary={label} />
</ListItem> </ListItem>
......
import React, { useState } from 'react' import React, { useState } from 'react'
import InputAdornment from '@material-ui/core/InputAdornment' import Visibility from '@mui/icons-material/Visibility'
import TextField, { TextFieldProps } from '@material-ui/core/TextField' import VisibilityOff from '@mui/icons-material/VisibilityOff'
import Visibility from '@material-ui/icons/Visibility' import InputAdornment from '@mui/material/InputAdornment'
import VisibilityOff from '@material-ui/icons/VisibilityOff' import TextField, { TextFieldProps } from '@mui/material/TextField'
import withStyles, { WithStyles } from '@material-ui/styles/withStyles'
import styles from './styles' import styles from './styles'
type BaseProps = WithStyles<typeof styles> & type BaseProps = Pick<TextFieldProps, 'value' | 'onChange' | 'required' | 'label' | 'type' | 'sx' | 'InputProps' | 'autoFocus' | 'inputProps'>
Pick<TextFieldProps, 'value' | 'onChange' | 'required' | 'label' | 'type' | 'className' | 'InputProps' | 'autoFocus' | 'inputProps'>
interface Props extends BaseProps {} interface Props extends BaseProps {}
const TextFieldWithIcon = (props: Props) => { const TextFieldWithIcon = (props: Props) => {
const [isPasswordVisible, setIsPasswordVisible] = useState(false) const [isPasswordVisible, setIsPasswordVisible] = useState(false)
const { onChange, required, value, label, type, className, InputProps, classes, autoFocus } = props const { onChange, required, value, label, type, sx, InputProps, autoFocus } = props
return ( return (
<TextField <TextField
autoFocus={autoFocus} autoFocus={autoFocus}
...@@ -23,14 +21,14 @@ const TextFieldWithIcon = (props: Props) => { ...@@ -23,14 +21,14 @@ const TextFieldWithIcon = (props: Props) => {
value={value} value={value}
onChange={onChange} onChange={onChange}
label={label} label={label}
className={className} sx={sx}
variant="outlined" variant="outlined"
type={type === 'password' ? (isPasswordVisible ? undefined : type) : type} type={type === 'password' ? (isPasswordVisible ? undefined : type) : type}
InputProps={ InputProps={
InputProps || { InputProps || {
startAdornment: startAdornment:
type === 'password' ? ( type === 'password' ? (
<InputAdornment position="start" onClick={() => setIsPasswordVisible(!isPasswordVisible)} className={classes.inputAdorment}> <InputAdornment position="start" onClick={() => setIsPasswordVisible(!isPasswordVisible)} sx={styles.inputAdorment}>
{isPasswordVisible ? <Visibility /> : <VisibilityOff />} {isPasswordVisible ? <Visibility /> : <VisibilityOff />}
</InputAdornment> </InputAdornment>
) : null, ) : null,
...@@ -40,4 +38,4 @@ const TextFieldWithIcon = (props: Props) => { ...@@ -40,4 +38,4 @@ const TextFieldWithIcon = (props: Props) => {
) )
} }
export default withStyles(styles)(TextFieldWithIcon) export default TextFieldWithIcon
import { createStyles, Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
export default (theme: Theme) => export default createSxStyles({
createStyles({ inputAdorment: {
inputAdorment: { cursor: 'pointer',
cursor: 'pointer' },
} })
})
import React from 'react' import React from 'react'
import MuiToolbar from '@material-ui/core/Toolbar' import { Box } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import MuiToolbar, { ToolbarProps as MuiToolbarProps } from '@mui/material/Toolbar'
import { useStyles } from './styles' import { useStyles } from './styles'
...@@ -8,14 +10,15 @@ export interface ToolbarProps { ...@@ -8,14 +10,15 @@ export interface ToolbarProps {
title?: React.ReactNode title?: React.ReactNode
actions?: React.ReactNode actions?: React.ReactNode
nav?: React.ReactNode nav?: React.ReactNode
sx?: MuiToolbarProps['sx']
} }
export function Toolbar({ nav, title, actions }: ToolbarProps) { export function Toolbar({ nav, title, actions, sx }: ToolbarProps) {
const classes = useStyles() const styles = useStyles(useTheme())
return ( return (
<MuiToolbar> <MuiToolbar>
<div className={classes.nav}>{nav}</div> <Box sx={styles.nav}>{nav}</Box>
{title ? <div className={classes.grow}>{title}</div> : <div className={classes.grow} />} {title ? <Box sx={styles.grow}>{title}</Box> : <Box sx={styles.grow} />}
{actions} {actions}
</MuiToolbar> </MuiToolbar>
) )
......
import cn from 'classnames' import deepmerge from 'deepmerge'
import React, { useState } from 'react' import React, { useState } from 'react'
import { Collapse, CollapseProps, Fade } from '@material-ui/core' import { createSxStyles } from '@agiliza/theme'
import MuiAppBar, { AppBarProps as MuiAppBarProps } from '@material-ui/core/AppBar' import { Box, Collapse, CollapseProps, Fade } from '@mui/material'
import { createStyles, makeStyles, Theme } from '@material-ui/core/styles' import MuiAppBar, { AppBarProps as MuiAppBarProps } from '@mui/material/AppBar'
import { Theme, useTheme } from '@mui/material/styles'
import { Toolbar, ToolbarProps } from './Toolbar' import { Toolbar, ToolbarProps } from './Toolbar'
const useStyles = makeStyles((theme: Theme) => const useStyles = (theme: Theme) =>
createStyles({ createSxStyles({
appBar: { appBar: {
// position: 'fixed', // position: 'fixed',
...theme.mixins.toolbar, ...theme.mixins.toolbar,
...@@ -21,21 +22,19 @@ const useStyles = makeStyles((theme: Theme) => ...@@ -21,21 +22,19 @@ const useStyles = makeStyles((theme: Theme) =>
width: '100%', width: '100%',
}, },
}) })
)
type BaseType = Omit<ToolbarProps, 'classes' | 'nav'> type BaseType = Omit<ToolbarProps, 'classes' | 'nav'>
export interface AppBarProps extends BaseType { export interface AppBarProps extends BaseType {
className?: string
position?: MuiAppBarProps['position'] position?: MuiAppBarProps['position']
children?: React.ReactNode children?: React.ReactNode
onNavClick?(event: React.MouseEvent<HTMLButtonElement, MouseEvent>): void onNavClick?(event: React.MouseEvent<HTMLButtonElement, MouseEvent>): void
style?: MuiAppBarProps['style'] style?: MuiAppBarProps['style']
} }
const AppBar = ({ className, position = 'static', actions, title, children, onNavClick, style }: AppBarProps) => { const AppBar = ({ sx, position = 'static', actions, title, children, onNavClick, style }: AppBarProps) => {
const classes = useStyles()
const [fadeIn, setFadeIn] = useState(false) const [fadeIn, setFadeIn] = useState(false)
const styles = useStyles(useTheme())
const onCollapse: CollapseProps['onEntered'] = (el, isAppearing) => { const onCollapse: CollapseProps['onEntered'] = (el, isAppearing) => {
setFadeIn(isAppearing) setFadeIn(isAppearing)
...@@ -48,13 +47,13 @@ const AppBar = ({ className, position = 'static', actions, title, children, onNa ...@@ -48,13 +47,13 @@ const AppBar = ({ className, position = 'static', actions, title, children, onNa
// ) : null // ) : null
return ( return (
<> <>
<MuiAppBar className={cn(classes.appBar, className)} position={position} style={style}> <MuiAppBar sx={deepmerge(styles.appBar, sx || {})} position={position} style={style}>
<Toolbar title={title} actions={actions} /*nav={nav}*/ /> <Toolbar title={title} actions={actions} /*nav={nav}*/ />
{children && ( {children && (
<Collapse appear enter in onEntered={onCollapse} timeout={400}> <Collapse appear enter in onEntered={onCollapse} timeout={400}>
<div> <div>
<Fade in={fadeIn} enter timeout={600}> <Fade in={fadeIn} enter timeout={600}>
<div className={classes.content}>{children}</div> <Box sx={styles.content}>{children}</Box>
</Fade> </Fade>
</div> </div>
</Collapse> </Collapse>
......
import { createStyles, makeStyles, Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
export const useStyles = makeStyles((theme: Theme) => export const useStyles = (theme: Theme) =>
createStyles({ createSxStyles({
grow: { grow: {
flexGrow: 1, flexGrow: 1,
}, },
...@@ -9,4 +10,3 @@ export const useStyles = makeStyles((theme: Theme) => ...@@ -9,4 +10,3 @@ export const useStyles = makeStyles((theme: Theme) =>
marginRight: theme.spacing(2), marginRight: theme.spacing(2),
}, },
}) })
)
import cn from 'classnames' import deepmerge from 'deepmerge'
import React from 'react' import React from 'react'
import CircularProgressMUI from '@material-ui/core/CircularProgress' import Box from '@mui/material/Box'
import Container from '@material-ui/core/Container' import CircularProgressMUI from '@mui/material/CircularProgress'
import { useStyles } from './styles' import { styles } from './styles'
interface Props { interface Props {
className?: string className?: string
...@@ -12,13 +12,10 @@ interface Props { ...@@ -12,13 +12,10 @@ interface Props {
} }
const CircularProgress = (props: Props) => { const CircularProgress = (props: Props) => {
const classes = useStyles()
return ( return (
<Container <Box sx={deepmerge(styles.container, props.root ? styles.allContainer : {})}>
className={cn(classes.container, { [classes.allContainer]: props.root })}
>
<CircularProgressMUI className={props.className} color="secondary" /> <CircularProgressMUI className={props.className} color="secondary" />
</Container> </Box>
) )
} }
......
import { createStyles, makeStyles, Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
export const useStyles = makeStyles((theme: Theme) => export const styles = createSxStyles({
createStyles({ container: {
container: { display: 'flex',
display: 'flex', flex: 1,
flex: 1, justifyContent: 'center',
justifyContent: 'center', alignItems: 'center',
alignItems: 'center' },
}, allContainer: {
allContainer: { height: '100vh',
height: '100vh' },
} })
})
)
import React from 'react' import React from 'react'
import IconButton from '@material-ui/core/IconButton'
import ListItemText from '@material-ui/core/ListItemText' import { MoreVert as ContextIconVertical } from '@mui/icons-material'
import Menu from '@material-ui/core/Menu' import IconButton from '@mui/material/IconButton'
import MenuItem from '@material-ui/core/MenuItem' import ListItemText from '@mui/material/ListItemText'
import { MoreVert as ContextIconVertical } from '@material-ui/icons' import Menu from '@mui/material/Menu'
import MenuItem from '@mui/material/MenuItem'
export interface ContextItem { export interface ContextItem {
icon?: React.ReactElement icon?: React.ReactElement
...@@ -38,23 +39,10 @@ export default function ContextButton({ menuId, disabled, menuItems, className, ...@@ -38,23 +39,10 @@ export default function ContextButton({ menuId, disabled, menuItems, className,
return ( return (
<> <>
<IconButton <IconButton disabled={disabled} className={className} aria-controls={menuId} aria-haspopup="true" onClick={handleClick}>
disabled={disabled}
className={className}
aria-controls={menuId}
aria-haspopup="true"
onClick={handleClick}
>
<ContextIconVertical /> <ContextIconVertical />
</IconButton> </IconButton>
<Menu <Menu id={menuId} anchorEl={anchorEl} keepMounted open={Boolean(anchorEl)} onClose={handleClose} className={menuClassName}>
id={menuId}
anchorEl={anchorEl}
keepMounted
open={Boolean(anchorEl)}
onClose={handleClose}
className={menuClassName}
>
{menuItems.map((item, index) => ( {menuItems.map((item, index) => (
<MenuItem key={index} onClick={(e) => handleItemClick(e, item)}> <MenuItem key={index} onClick={(e) => handleItemClick(e, item)}>
{/* <ListItemIcon>{item.icon}</ListItemIcon> */} {/* <ListItemIcon>{item.icon}</ListItemIcon> */}
......
import React from 'react' import React from 'react'
// import AppBar from '@material-ui/core/AppBar' // import AppBar from '@mui/material/AppBar'
import AppBar from '@agiliza/components/molecules/AppBar' import AppBar from '@agiliza/components/molecules/AppBar'
import { IconButton } from '@material-ui/core' import CloseIcon from '@mui/icons-material/Close'
import Dialog from '@material-ui/core/Dialog' import { IconButton } from '@mui/material'
import DialogActions from '@material-ui/core/DialogActions' import Dialog from '@mui/material/Dialog'
// import Toolbar from '@material-ui/core/Toolbar' import DialogActions from '@mui/material/DialogActions'
// import IconButton from '@material-ui/core/IconButton' // import Toolbar from '@mui/material/Toolbar'
import DialogContent from '@material-ui/core/DialogContent' // import IconButton from '@mui/material/IconButton'
import DialogTitle from '@material-ui/core/DialogTitle' import DialogContent from '@mui/material/DialogContent'
import Slide from '@material-ui/core/Slide' import DialogTitle from '@mui/material/DialogTitle'
import { TransitionProps } from '@material-ui/core/transitions/transition' import Slide from '@mui/material/Slide'
import CloseIcon from '@material-ui/icons/Close' import { TransitionProps } from '@mui/material/transitions/transition'
import type { DialogProps } from '@material-ui/core/Dialog' import type { DialogProps } from '@mui/material/Dialog'
const Transition = React.forwardRef(function Transition( const Transition = React.forwardRef(function Transition(
props: TransitionProps & { children?: React.ReactElement<any, any> }, props: TransitionProps & { children?: React.ReactElement<any, any> },
ref: React.Ref<unknown> ref: React.Ref<unknown>
......
import { Theme, createStyles } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material'
export const styles = (theme: Theme) => export const styles = (theme: Theme) =>
createStyles({ createSxStyles({
appBar: { position: 'relative' }, appBar: { position: 'relative' },
title: { title: {
marginLeft: theme.spacing(2), marginLeft: theme.spacing(2),
flex: 1 flex: 1,
} },
}) })
import cn from 'classnames' import deepmerge from 'deepmerge'
import React from 'react' import React from 'react'
import { RouteComponentProps } from 'react-router' import { RouteComponentProps } from 'react-router'
import logo from '@agiliza/public/images/logo.svg' import logo from '@agiliza/public/images/logo.svg'
import { actions as loginActions } from '@agiliza/redux/ui/login' import { actions as loginActions } from '@agiliza/redux/ui/login'
import Divider from '@material-ui/core/Divider' import { ListItemProps } from '@mui/material'
import MUIDrawer from '@material-ui/core/Drawer' import Divider from '@mui/material/Divider'
import MUIDrawer from '@mui/material/Drawer'
import { useTheme } from '@mui/material/styles'
import { useStyles } from './styles' import { useStyles } from './styles'
type ExtendedTypes = RouteComponentProps type ExtendedTypes = RouteComponentProps
interface DrawerItemsProps extends ExtendedTypes { interface DrawerItemsProps extends ExtendedTypes {
listItemClassName?: string sx: ListItemProps['sx']
toggleDrawer: () => void toggleDrawer: () => void
logout: Props['logout'] logout: Props['logout']
} }
...@@ -28,30 +30,29 @@ export interface Props extends BaseProps { ...@@ -28,30 +30,29 @@ export interface Props extends BaseProps {
const Drawer = (props: Props) => { const Drawer = (props: Props) => {
const { drawerOpen, toggleDrawer, Items, logout, ...routeProps } = props const { drawerOpen, toggleDrawer, Items, logout, ...routeProps } = props
const styles = useStyles(useTheme())
const classes = useStyles()
return ( return (
<MUIDrawer <MUIDrawer
variant="temporary" variant="temporary"
open={drawerOpen} open={drawerOpen}
className={cn(classes.drawer, { sx={deepmerge(styles.drawer, drawerOpen ? styles.drawerOpen : styles.drawerClose)}
[classes.drawerOpen]: drawerOpen, // classes={{
[classes.drawerClose]: !drawerOpen, // paper: cn(classes.drawer, {
})} // [classes.drawerOpen]: drawerOpen,
classes={{ // [classes.drawerClose]: !drawerOpen,
paper: cn(classes.drawer, { // }),
[classes.drawerOpen]: drawerOpen, // }}
[classes.drawerClose]: !drawerOpen, PaperProps={{
}), sx: deepmerge(styles.drawer, drawerOpen ? styles.drawerOpen : styles.drawerClose),
}} }}
onBackdropClick={() => toggleDrawer()} onBackdropClick={() => toggleDrawer()}
> >
<div className={classes.header}> <div style={styles.header}>
<img src={logo} className={classes.headerLogo} alt="Camedics Logo" /> <img src={logo} style={styles.headerLogo} alt="Camedics Logo" />
</div> </div>
<Divider /> <Divider />
{Items ? <Items logout={logout} listItemClassName={classes.listItem} toggleDrawer={toggleDrawer} {...routeProps} /> : null} {Items ? <Items logout={logout} sx={styles.listItem} toggleDrawer={toggleDrawer} {...routeProps} /> : null}
{/* <DrawerItems listItemClassName={classes.listItem} toggleDrawer={toggleDrawer} {...routerProps} /> */} {/* <DrawerItems listItemClassName={classes.listItem} toggleDrawer={toggleDrawer} {...routerProps} /> */}
{/* <div className={classes.grow} /> */} {/* <div className={classes.grow} /> */}
{/* <Divider /> */} {/* <Divider /> */}
......
import { drawerWidth, toolbarHeight } from '@agiliza/constants/styles' import { drawerWidth, toolbarHeight } from '@agiliza/constants/styles'
import { createStyles, makeStyles, Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material'
export const useStyles = makeStyles((theme: Theme) => { export const useStyles = (theme: Theme) => {
const drawerClosedWidth = theme.spacing(0) const drawerClosedWidth = theme.spacing(0)
const hover = '&:hover' const hover = '&:hover'
return createStyles({ return createSxStyles({
grow: { grow: {
flexGrow: 1, flexGrow: 1,
}, },
...@@ -87,4 +88,4 @@ export const useStyles = makeStyles((theme: Theme) => { ...@@ -87,4 +88,4 @@ export const useStyles = makeStyles((theme: Theme) => {
}, },
headerLogo: { width: 100, height: 'auto' }, headerLogo: { width: 100, height: 'auto' },
}) })
}) }
...@@ -4,15 +4,12 @@ import { bindActionCreators, Dispatch } from 'redux' ...@@ -4,15 +4,12 @@ import { bindActionCreators, Dispatch } from 'redux'
import { StoreState } from '@agiliza/redux' import { StoreState } from '@agiliza/redux'
import { actions as errorActions, selectors, State as ErrorState } from '@agiliza/redux/ui/error' import { actions as errorActions, selectors, State as ErrorState } from '@agiliza/redux/ui/error'
import Button from '@material-ui/core/Button' import Button from '@mui/material/Button'
import Dialog from '@material-ui/core/Dialog' import Dialog from '@mui/material/Dialog'
import DialogActions from '@material-ui/core/DialogActions' import DialogActions from '@mui/material/DialogActions'
import DialogContent from '@material-ui/core/DialogContent' import DialogContent from '@mui/material/DialogContent'
import DialogContentText from '@material-ui/core/DialogContentText' import DialogContentText from '@mui/material/DialogContentText'
import DialogTitle from '@material-ui/core/DialogTitle' import DialogTitle from '@mui/material/DialogTitle'
import { withStyles } from '@material-ui/styles'
import { styles } from './styles'
interface Props { interface Props {
error: ErrorState['error'] error: ErrorState['error']
...@@ -60,4 +57,4 @@ const mapDispatchToProps = (dispatch: Dispatch) => ...@@ -60,4 +57,4 @@ const mapDispatchToProps = (dispatch: Dispatch) =>
dispatch dispatch
) )
export default connect(mapStateToProps, mapDispatchToProps)(withStyles(styles)(ErrorDialog)) export default connect(mapStateToProps, mapDispatchToProps)(ErrorDialog)
import { Theme, createStyles } from '@material-ui/core/styles'
export const styles = (theme: Theme) => createStyles({})
import React, { useState } from 'react' import React, { useState } from 'react'
import Popover from '@material-ui/core/Popover' import InfoIcon from '@mui/icons-material/InfoRounded'
import Typography from '@material-ui/core/Typography' import Popover from '@mui/material/Popover'
import InfoIcon from '@material-ui/icons/InfoRounded' import { useTheme } from '@mui/material/styles'
import { WithStyles, withStyles } from '@material-ui/styles' import Typography from '@mui/material/Typography'
import { styles } from './styles' import { useStyles } from './styles'
interface Props extends WithStyles<typeof styles> {} interface Props {}
interface PopItem { interface PopItem {
key: string key: string
...@@ -16,10 +16,11 @@ interface PopItem { ...@@ -16,10 +16,11 @@ interface PopItem {
} }
const PopoverVersion = (props: Props) => { const PopoverVersion = (props: Props) => {
const { classes } = props
const [popItems] = useState<PopItem[]>([]) const [popItems] = useState<PopItem[]>([])
const [anchor, setAnchor] = useState<HTMLDivElement | null>(null) const [anchor, setAnchor] = useState<HTMLDivElement | null>(null)
const styles = useStyles(useTheme())
// useEffect(() => { // useEffect(() => {
// let items: PopItem[] = [{ key: 'Versão', value: VERSION }] // let items: PopItem[] = [{ key: 'Versão', value: VERSION }]
// if (service) { // if (service) {
...@@ -35,16 +36,16 @@ const PopoverVersion = (props: Props) => { ...@@ -35,16 +36,16 @@ const PopoverVersion = (props: Props) => {
const createPopItems = (items: PopItem[]) => const createPopItems = (items: PopItem[]) =>
items.map((item, i) => ( items.map((item, i) => (
<Typography className={classes.msg} color="textPrimary" key={i}> <Typography sx={styles.msg} color="textPrimary" key={i} component="span">
{`${item.key}: `} {`${item.key}: `}
{<span style={{ textDecoration: item.underline ? 'underline' : undefined }}>{item.value || ''}</span>} {<span style={{ textDecoration: item.underline ? 'underline' : undefined }}>{item.value || ''}</span>}
</Typography> </Typography>
)) ))
return ( return (
<div className={classes.root}> <div style={styles.root}>
<div onClick={(evt) => setAnchor(evt.currentTarget)}> <div onClick={(evt) => setAnchor(evt.currentTarget)}>
<InfoIcon className={classes.infoBtn} color="primary" /> <InfoIcon sx={styles.infoBtn} color="primary" />
</div> </div>
<Popover <Popover
id="version-popover" id="version-popover"
...@@ -60,9 +61,9 @@ const PopoverVersion = (props: Props) => { ...@@ -60,9 +61,9 @@ const PopoverVersion = (props: Props) => {
horizontal: 'right', horizontal: 'right',
}} }}
> >
<div className={classes.popoverContent}>{createPopItems(popItems)}</div> <div style={styles.popoverContent}>{createPopItems(popItems)}</div>
</Popover> </Popover>
</div> </div>
) )
} }
export default withStyles(styles)(PopoverVersion) export default PopoverVersion
import { createStyles, Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material'
export const styles = (theme: Theme) => export const useStyles = (theme: Theme) =>
createStyles({ createSxStyles({
root: { position: 'fixed', bottom: theme.spacing(5), right: theme.spacing(5) }, root: { position: 'fixed', bottom: theme.spacing(5), right: theme.spacing(5) },
popoverContent: { padding: theme.spacing(1.5) }, popoverContent: { padding: theme.spacing(1.5) },
msg: { msg: {
......
import cn from 'classnames' import deepmerge from 'deepmerge'
import React from 'react' import React from 'react'
import { makeStyles, Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { Theme, useTheme } from '@mui/material/styles'
const useStyles = makeStyles((theme: Theme) => ({ const useStyles = (theme: Theme) =>
card: { createSxStyles({
// backgroundColor: '#fafafa', card: {
height: 100, // backgroundColor: '#fafafa',
width: 175, height: '100px',
padding: theme.spacing(1), width: '175px',
border: '1px solid #dfdfdf', padding: theme.spacing(1),
borderRadius: '10px', border: '1px solid #dfdfdf',
display: 'flex', borderRadius: '10px',
flexDirection: 'column', display: 'flex',
alignItems: 'center', flexDirection: 'column',
justifyContent: 'center', alignItems: 'center',
// color: theme.palette.grey[500], justifyContent: 'center',
transform: 'scale(1)', // color: theme.palette.grey[500],
transition: theme.transitions.create(['color', 'border', 'transform'], { transform: 'scale(1)',
duration: theme.transitions.duration.short, transition: theme.transitions.create(['color', 'border', 'transform'], {
}), duration: theme.transitions.duration.short,
'&:hover': { }),
transform: 'scale(1.03)', '&:hover': {
color: theme.palette.primary.main, transform: 'scale(1.03)',
borderColor: theme.palette.primary.main, color: theme.palette.primary.main,
cursor: 'pointer', borderColor: theme.palette.primary.main,
border: `1px solid ${theme.palette.primary.main}`, cursor: 'pointer',
border: `1px solid ${theme.palette.primary.main}`,
},
}, },
}, cardIcon: {
cardIcon: { display: 'flex',
display: 'flex', justifyContent: 'center',
justifyContent: 'center', alignItems: 'center',
alignItems: 'center', },
}, cardDescription: {
cardDescription: { textAlign: 'center',
textAlign: 'center', },
}, })
}))
export interface DashboardCardProps { export interface DashboardCardProps {
label: string label: string
icon: React.ReactNode icon: React.ReactNode
className?: string style?: React.CSSProperties
onClick?(): void onClick?(): void
} }
function DashboardCard(props: DashboardCardProps) { function DashboardCard(props: DashboardCardProps) {
const classes = useStyles() const styles = useStyles(useTheme())
return ( return (
<div onClick={props.onClick} className={cn(classes.card, props.className)}> <div onClick={props.onClick} style={deepmerge(styles.card, props.style || {})}>
<div className={classes.cardIcon}>{props.icon}</div> <div style={styles.cardIcon}>{props.icon}</div>
<div className={classes.cardDescription}>{props.label}</div> <div style={styles.cardDescription}>{props.label}</div>
</div> </div>
) )
} }
......
import cn from 'classnames' import deepmerge from 'deepmerge'
import React from 'react' import React from 'react'
import { Button } from '@material-ui/core' import { PhotoCamera as PhotoCameraIcon } from '@mui/icons-material'
import { withStyles, WithStyles } from '@material-ui/core/styles' import { Button, ButtonProps } from '@mui/material'
import { PhotoCamera as PhotoCameraIcon } from '@material-ui/icons' import { useTheme } from '@mui/material/styles'
import styles from './styles' import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles> interface Props {
interface Props extends ExtendedProps {
image?: string image?: string
onChangeImage: React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>['onChange'] onChangeImage: React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>['onChange']
label: string label: string
imageStyle?: React.HTMLAttributes<HTMLDivElement>['style'] imageStyle?: React.HTMLAttributes<HTMLDivElement>['style']
className?: string className?: string
buttonClassName?: string style?: React.CSSProperties
sx?: ButtonProps['sx']
} }
const ImageUpload = (props: Props) => { const ImageUpload = (props: Props) => {
const { classes, className, buttonClassName, image, onChangeImage, label, imageStyle } = props const { style, sx = {}, image, onChangeImage, label, imageStyle = {} } = props
const styles = useStyles(useTheme())
return ( return (
<div className={cn(className, classes.container)}> <div style={deepmerge(style || {}, styles.container)}>
<Button variant="text" component="label" className={cn(classes.photoBtn, buttonClassName)} classes={{ label: classes.photoLabelBtn }}> {/* <Button variant="text" sx={deepmerge(styles.photoBtn, sx || {})} > */}
<Button variant="text" component="label" sx={deepmerge(styles.photoBtn, sx || {})}>
{image ? ( {image ? (
<div className={classes.card} style={imageStyle}> <div style={deepmerge(styles.card, imageStyle)}>
<img src={'data:image/png;base64,' + image} className={classes.media} /> <img src={'data:image/png;base64,' + image} style={styles.media} />
</div> </div>
) : ( ) : (
<PhotoCameraIcon /> <PhotoCameraIcon />
...@@ -44,4 +46,4 @@ const ImageUpload = (props: Props) => { ...@@ -44,4 +46,4 @@ const ImageUpload = (props: Props) => {
) )
} }
export default withStyles(styles)(ImageUpload) export default ImageUpload
import { Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { createStyles } from '@material-ui/styles' import { Theme } from '@mui/material'
// eslint-disable-next-line // eslint-disable-next-line
export default (theme: Theme) => { export default (theme: Theme) =>
return createStyles({ createSxStyles({
container: { width: '100%', textAlign: 'center', marginTop: theme.spacing(1), marginBottom: theme.spacing(1) }, container: { width: '100%', textAlign: 'center', marginTop: theme.spacing(1), marginBottom: theme.spacing(1) },
photoBtn: { width: '100%' }, photoBtn: { width: '100%', '&.MuiButton-text': { display: 'flex', flexDirection: 'column', height: '280px', alignItems: 'center', flexGrow: 1 } },
photoLabelBtn: { display: 'flex', flexDirection: 'column', height: '280px', alignItems: 'center', flexGrow: 1 },
card: { width: '100%', maxWidth: '100%', height: '100%', textAlign: 'center' }, card: { width: '100%', maxWidth: '100%', height: '100%', textAlign: 'center' },
media: { media: {
height: '230px', height: '230px',
...@@ -15,4 +14,3 @@ export default (theme: Theme) => { ...@@ -15,4 +14,3 @@ export default (theme: Theme) => {
// paddingTop: '56.25%', // 16:9 // paddingTop: '56.25%', // 16:9
}, },
}) })
}
import React from 'react' import React from 'react'
import { maskPhone } from '@agiliza/utils/masks' import { maskPhone } from '@agiliza/utils/masks'
import { TextField, TextFieldProps } from '@material-ui/core' import { TextField, TextFieldProps } from '@mui/material'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import styles from './styles' interface Props {
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {
value?: string value?: string
onChange: TextFieldProps['onChange'] onChange: TextFieldProps['onChange']
label?: string label?: string
...@@ -19,4 +14,4 @@ const PhoneField = (props: Props) => { ...@@ -19,4 +14,4 @@ const PhoneField = (props: Props) => {
return <TextField variant="outlined" label={label || 'Telefone'} value={maskPhone(value)} onChange={onChange} inputProps={{ maxLength: 15 }} /> return <TextField variant="outlined" label={label || 'Telefone'} value={maskPhone(value)} onChange={onChange} inputProps={{ maxLength: 15 }} />
} }
export default withStyles(styles)(PhoneField) export default PhoneField
import { Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { createStyles } from '@material-ui/styles'
// eslint-disable-next-line // eslint-disable-next-line
export default (theme: Theme) => { export default createSxStyles({})
return createStyles({})
}
import React from 'react' import React from 'react'
import { SvgIcon } from '@material-ui/core' import { SvgIcon } from '@mui/material'
interface Props {} interface Props {}
......
import React from 'react' import React from 'react'
import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon' import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'
interface Props extends SvgIconProps {} interface Props extends SvgIconProps {}
......
import React from 'react' import React from 'react'
import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'
import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'
interface Props extends SvgIconProps {} interface Props extends SvgIconProps {}
......
import React from 'react' import React from 'react'
import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon' import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'
interface Props extends SvgIconProps {} interface Props extends SvgIconProps {}
......
import React from 'react' import React from 'react'
import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'
import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'
interface Props extends SvgIconProps {} interface Props extends SvgIconProps {}
...@@ -9,7 +10,7 @@ export default (props: Props) => { ...@@ -9,7 +10,7 @@ export default (props: Props) => {
{...props} {...props}
style={{ style={{
width: 21, width: 21,
height: 21 height: 21,
}} }}
viewBox="0 0 21 21" viewBox="0 0 21 21"
> >
......
import React from 'react' import React from 'react'
import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'
import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'
interface Props extends SvgIconProps {} interface Props extends SvgIconProps {}
...@@ -9,7 +10,7 @@ export default (props: Props) => { ...@@ -9,7 +10,7 @@ export default (props: Props) => {
{...props} {...props}
style={{ style={{
width: 21, width: 21,
height: 21 height: 21,
}} }}
viewBox="0 0 21 21" viewBox="0 0 21 21"
> >
......
...@@ -3,14 +3,11 @@ import React from 'react' ...@@ -3,14 +3,11 @@ import React from 'react'
import { BanestesAccount } from '@agiliza/api/domain' import { BanestesAccount } from '@agiliza/api/domain'
import ImageUpload from '@agiliza/components/organisms/ImageUpload' import ImageUpload from '@agiliza/components/organisms/ImageUpload'
import { extractNumbers, getBase64FromFile } from '@agiliza/utils/method' import { extractNumbers, getBase64FromFile } from '@agiliza/utils/method'
import { TextField, TextFieldProps } from '@material-ui/core' import { TextField, TextFieldProps } from '@mui/material'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import styles from './styles' import styles from './styles'
type ExtendedProps = WithStyles<typeof styles> interface Props {
interface Props extends ExtendedProps {
values: BanestesAccount values: BanestesAccount
onChanges: { onChanges: {
account: (type: keyof BanestesAccount) => TextFieldProps['onChange'] account: (type: keyof BanestesAccount) => TextFieldProps['onChange']
...@@ -20,7 +17,7 @@ interface Props extends ExtendedProps { ...@@ -20,7 +17,7 @@ interface Props extends ExtendedProps {
} }
const AccountInputsPhoto = (props: Props) => { const AccountInputsPhoto = (props: Props) => {
const { classes, values, onChanges } = props const { values, onChanges } = props
const { agencyNumber, cardPicture, number } = values const { agencyNumber, cardPicture, number } = values
const handleChangeField = (type: keyof BanestesAccount): TextFieldProps['onChange'] => onChanges.account(type) const handleChangeField = (type: keyof BanestesAccount): TextFieldProps['onChange'] => onChanges.account(type)
...@@ -34,8 +31,8 @@ const AccountInputsPhoto = (props: Props) => { ...@@ -34,8 +31,8 @@ const AccountInputsPhoto = (props: Props) => {
} }
return ( return (
<div className={classes.accountInputsPhotoContainer}> <div style={styles.accountInputsPhotoContainer}>
<div className={classes.accountInputsContainer}> <div style={styles.accountInputsContainer}>
<TextField <TextField
label="Número da agência" label="Número da agência"
value={extractNumbers(agencyNumber) || ''} value={extractNumbers(agencyNumber) || ''}
...@@ -49,4 +46,4 @@ const AccountInputsPhoto = (props: Props) => { ...@@ -49,4 +46,4 @@ const AccountInputsPhoto = (props: Props) => {
) )
} }
export default withStyles(styles)(AccountInputsPhoto) export default AccountInputsPhoto
import { Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { createStyles } from '@material-ui/styles'
// eslint-disable-next-line // eslint-disable-next-line
export default (theme: Theme) => { export default createSxStyles({
return createStyles({ accountInputsPhotoContainer: { width: '100%', height: '100%' },
accountInputsPhotoContainer: { width: '100%', height: '100%' }, accountInputsContainer: { height: '100%' },
accountInputsContainer: { height: '100%' }, photoBtn: { minWidth: '50%' },
photoBtn: { minWidth: '50%' }, photoLabelBtn: { display: 'flex', flexDirection: 'column', height: '280px', alignItems: 'center', flexGrow: 1 },
photoLabelBtn: { display: 'flex', flexDirection: 'column', height: '280px', alignItems: 'center', flexGrow: 1 }, card: { width: 'auto', height: 'auto' },
card: { width: 'auto', height: 'auto' }, media: {
media: { height: '250px',
height: '250px', width: 'auto',
width: 'auto', // paddingTop: '56.25%', // 16:9
// paddingTop: '56.25%', // 16:9 },
}, })
})
}
...@@ -3,15 +3,13 @@ import React, { useMemo } from 'react' ...@@ -3,15 +3,13 @@ import React, { useMemo } from 'react'
import { City, State } from '@agiliza/api/domain' import { City, State } from '@agiliza/api/domain'
import { maskCEP } from '@agiliza/utils/masks' import { maskCEP } from '@agiliza/utils/masks'
import { SelectField, SelectFieldProps } from '@curio/components' import { SelectField, SelectFieldProps } from '@curio/components'
import { TextField, TextFieldProps } from '@material-ui/core' import { TextField, TextFieldProps } from '@mui/material'
import { withStyles, WithStyles } from '@material-ui/core/styles' import { useTheme } from '@mui/material/styles'
import { AddressState } from './state' import { AddressState } from './state'
import styles from './styles' import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles> interface Props {
interface Props extends ExtendedProps {
states: State[] states: State[]
cities: City[] cities: City[]
state: AddressState state: AddressState
...@@ -19,7 +17,8 @@ interface Props extends ExtendedProps { ...@@ -19,7 +17,8 @@ interface Props extends ExtendedProps {
} }
const Address = (props: Props) => { const Address = (props: Props) => {
const { classes, state: _state, onChange, states, cities } = props const styles = useStyles(useTheme())
const { state: _state, onChange, states, cities } = props
const { cep, street, number, complement, state, city, district } = _state const { cep, street, number, complement, state, city, district } = _state
...@@ -54,7 +53,8 @@ const Address = (props: Props) => { ...@@ -54,7 +53,8 @@ const Address = (props: Props) => {
onChange={handleChangeSelect('state')} onChange={handleChangeSelect('state')}
items={states.map((st) => ({ label: st.name, value: st.id }))} items={states.map((st) => ({ label: st.name, value: st.id }))}
shrink={false} shrink={false}
className={classes.selectField} // sx={classes.selectField}
sx={styles.selectField}
/> />
<SelectField <SelectField
id="state-select" id="state-select"
...@@ -65,11 +65,11 @@ const Address = (props: Props) => { ...@@ -65,11 +65,11 @@ const Address = (props: Props) => {
onChange={handleChangeSelect('city')} onChange={handleChangeSelect('city')}
items={availableCities.map((st) => ({ label: st.name, value: st.id }))} items={availableCities.map((st) => ({ label: st.name, value: st.id }))}
shrink={false} shrink={false}
className={classes.selectField} sx={styles.selectField}
/> />
<TextField variant="outlined" label="Bairro" value={district} onChange={handleChange('district')} /> <TextField variant="outlined" label="Bairro" value={district} onChange={handleChange('district')} />
</> </>
) )
} }
export default withStyles(styles)(Address) export default Address
import { Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { createStyles } from '@material-ui/styles' import { Theme } from '@mui/material'
// eslint-disable-next-line // eslint-disable-next-line
export default (theme: Theme) => export default (theme: Theme) =>
createStyles({ createSxStyles({
form: { display: 'flex', flexDirection: 'column' }, form: { display: 'flex', flexDirection: 'column' },
selectField: { marginBottom: theme.spacing(2) }, selectField: { marginBottom: theme.spacing(2) },
}) })
...@@ -5,16 +5,14 @@ import PhoneField from '@agiliza/components/organisms/PhoneField' ...@@ -5,16 +5,14 @@ import PhoneField from '@agiliza/components/organisms/PhoneField'
import { useErrorValidator } from '@agiliza/utils/hooks/errorValidation' import { useErrorValidator } from '@agiliza/utils/hooks/errorValidation'
import { ActionType } from '@agiliza/utils/hooks/state' import { ActionType } from '@agiliza/utils/hooks/state'
import CPFCNPJField from '@agiliza/views/ProposalData/components/atoms/CPFCNPJField' import CPFCNPJField from '@agiliza/views/ProposalData/components/atoms/CPFCNPJField'
import { TextField, TextFieldProps } from '@material-ui/core' import { TextField, TextFieldProps } from '@mui/material'
import { withStyles, WithStyles } from '@material-ui/core/styles' import { useTheme } from '@mui/material/styles'
import AddressForm, { AddressState } from '../Address' import AddressForm, { AddressState } from '../Address'
import { initState, State as FirstAccessState } from './state' import { initState, State as FirstAccessState } from './state'
import styles from './styles' import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles> interface Props {
interface Props extends ExtendedProps {
states: State[] states: State[]
cities: City[] cities: City[]
state: FirstAccessState state: FirstAccessState
...@@ -22,12 +20,14 @@ interface Props extends ExtendedProps { ...@@ -22,12 +20,14 @@ interface Props extends ExtendedProps {
} }
const FirstAccess = (props: Props) => { const FirstAccess = (props: Props) => {
const { classes, states, cities, state, actions } = props const { states, cities, state, actions } = props
const { cpf, name, email, phone, ...addressState } = state const { cpf, name, email, phone, ...addressState } = state
const { actions: errorActions } = useErrorValidator(initState) const { actions: errorActions } = useErrorValidator(initState)
const styles = useStyles(useTheme())
const handleChange = const handleChange =
(key: keyof FirstAccessState): TextFieldProps['onChange'] => (key: keyof FirstAccessState): TextFieldProps['onChange'] =>
(evt) => { (evt) => {
...@@ -39,7 +39,7 @@ const FirstAccess = (props: Props) => { ...@@ -39,7 +39,7 @@ const FirstAccess = (props: Props) => {
} }
return ( return (
<form className={classes.form}> <form style={styles.form}>
<CPFCNPJField value={cpf} onChange={handleChange('cpf')} onlyCPF disabled /> <CPFCNPJField value={cpf} onChange={handleChange('cpf')} onlyCPF disabled />
<TextField variant="outlined" label="Nome" value={name} onChange={handleChange('name')} /> <TextField variant="outlined" label="Nome" value={name} onChange={handleChange('name')} />
<TextField variant="outlined" label="Email" value={email} onChange={handleChange('email')} /> <TextField variant="outlined" label="Email" value={email} onChange={handleChange('email')} />
...@@ -49,4 +49,4 @@ const FirstAccess = (props: Props) => { ...@@ -49,4 +49,4 @@ const FirstAccess = (props: Props) => {
) )
} }
export default withStyles(styles)(FirstAccess) export default FirstAccess
import { Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { createStyles } from '@material-ui/styles' import { Theme } from '@mui/material/styles'
// eslint-disable-next-line // eslint-disable-next-line
export default (theme: Theme) => export default (theme: Theme) =>
createStyles({ createSxStyles({
form: { form: {
display: 'flex', display: 'flex',
flexDirection: 'column', flexDirection: 'column',
......
import React from 'react' import React from 'react'
import TextFieldWithIcon from '@agiliza/components/atoms/TextFieldWithIcon' import TextFieldWithIcon from '@agiliza/components/atoms/TextFieldWithIcon'
import { InputAdornment, TextFieldProps } from '@material-ui/core' import { AccountCircle } from '@mui/icons-material'
import { withStyles, WithStyles } from '@material-ui/core/styles' import { InputAdornment, TextFieldProps } from '@mui/material'
import { AccountCircle } from '@material-ui/icons' import { useTheme } from '@mui/material/styles'
import styles from './styles' import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles> interface Props {
interface Props extends ExtendedProps {
username: string username: string
password: string password: string
onChange(type: 'username' | 'password'): TextFieldProps['onChange'] onChange(type: 'username' | 'password'): TextFieldProps['onChange']
} }
const Login = (props: Props) => { const Login = (props: Props) => {
const { classes, username, password, onChange } = props const styles = useStyles(useTheme())
const { username, password, onChange } = props
return ( return (
<form className={classes.form}> <form style={styles.form}>
<TextFieldWithIcon <TextFieldWithIcon
autoFocus autoFocus
required required
value={username} value={username}
onChange={onChange('username')} onChange={onChange('username')}
label="CPF" label="CPF"
className={classes.usernameTxtField} sx={styles.usernameTxtField}
inputProps={{ maxLength: 14 }} inputProps={{ maxLength: 14 }}
InputProps={{ InputProps={{
startAdornment: ( startAdornment: (
...@@ -41,4 +40,4 @@ const Login = (props: Props) => { ...@@ -41,4 +40,4 @@ const Login = (props: Props) => {
) )
} }
export default withStyles(styles)(Login) export default Login
import { Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { createStyles } from '@material-ui/styles' import { Theme } from '@mui/material'
// eslint-disable-next-line // eslint-disable-next-line
export default (theme: Theme) => export default (theme: Theme) =>
createStyles({ createSxStyles({
title: { title: {
fontSize: '150%', fontSize: '150%',
fontWeight: 'bold', fontWeight: 'bold',
...@@ -30,5 +30,5 @@ export default (theme: Theme) => ...@@ -30,5 +30,5 @@ export default (theme: Theme) =>
width: '100%', width: '100%',
margin: theme.spacing(2), margin: theme.spacing(2),
}, },
usernameTxtField: { marginBottom: 10 }, usernameTxtField: { marginBottom: theme.spacing(2) },
}) })
import React from 'react' import React from 'react'
import { RouteComponentProps } from 'react-router-dom' import { RouteComponentProps } from 'react-router-dom'
import { Typography } from '@material-ui/core' import { createSxStyles } from '@agiliza/theme'
import { createStyles, Theme } from '@material-ui/core/styles' import { Typography } from '@mui/material'
import { withStyles, WithStyles } from '@material-ui/styles' import { Theme, useTheme } from '@mui/material/styles'
const styles = (theme: Theme) => const useStyles = (theme: Theme) =>
createStyles({ createSxStyles({
container: { container: {
paddingLeft: theme.spacing(2), paddingLeft: theme.spacing(2),
}, },
...@@ -15,19 +15,20 @@ const styles = (theme: Theme) => ...@@ -15,19 +15,20 @@ const styles = (theme: Theme) =>
}, },
}) })
type Props = WithStyles<typeof styles> & RouteComponentProps type Props = RouteComponentProps
interface NotFoundProps extends Props {} interface NotFoundProps extends Props {}
function NotFound({ classes }: NotFoundProps) { function NotFound(props: NotFoundProps) {
const styles = useStyles(useTheme())
return ( return (
<div className={classes.container}> <div style={styles.container}>
<Typography variant="h3">404: Página não encontrada</Typography> <Typography variant="h3">404: Página não encontrada</Typography>
<div className={classes.messageBox}> <div style={styles.messageBox}>
<Typography variant="h5">A página pela qual você procurou não existe.</Typography> <Typography variant="h5">A página pela qual você procurou não existe.</Typography>
</div> </div>
</div> </div>
) )
} }
export default /*#__PURE__*/ withStyles(styles)(NotFound) export default /*#__PURE__*/ NotFound
...@@ -4,20 +4,19 @@ import { RG } from '@agiliza/api/domain' ...@@ -4,20 +4,19 @@ import { RG } from '@agiliza/api/domain'
import ImageUpload from '@agiliza/components/organisms/ImageUpload' import ImageUpload from '@agiliza/components/organisms/ImageUpload'
import { maskRG } from '@agiliza/utils/masks' import { maskRG } from '@agiliza/utils/masks'
import { getBase64FromFile } from '@agiliza/utils/method' import { getBase64FromFile } from '@agiliza/utils/method'
import { TextField, TextFieldProps } from '@material-ui/core' import { TextField, TextFieldProps } from '@mui/material'
import { withStyles, WithStyles } from '@material-ui/core/styles' import { useTheme } from '@mui/material/styles'
import styles from './styles' import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles> interface Props {
interface Props extends ExtendedProps {
rg?: RG rg?: RG
onChange: (rg: Partial<RG>) => void onChange: (rg: Partial<RG>) => void
} }
const RGTemplate = (props: Props) => { const RGTemplate = (props: Props) => {
const { classes, rg, onChange } = props const { rg, onChange } = props
const styles = useStyles(useTheme())
const handleChangePhoto = const handleChangePhoto =
(key: keyof Pick<RG, 'front' | 'back'>): React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>['onChange'] => (key: keyof Pick<RG, 'front' | 'back'>): React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>['onChange'] =>
...@@ -36,10 +35,10 @@ const RGTemplate = (props: Props) => { ...@@ -36,10 +35,10 @@ const RGTemplate = (props: Props) => {
} }
return ( return (
<div className={classes.container}> <div style={styles.container}>
<div className={classes.imagesContainer}> <div style={styles.imagesContainer}>
<ImageUpload label="Frente" image={rg?.front} onChangeImage={handleChangePhoto('front')} className={classes.imageUpload} /> <ImageUpload label="Frente" image={rg?.front} onChangeImage={handleChangePhoto('front')} sx={styles.imageUpload} />
<ImageUpload label="Verso" image={rg?.back} onChangeImage={handleChangePhoto('back')} className={classes.imageUpload} /> <ImageUpload label="Verso" image={rg?.back} onChangeImage={handleChangePhoto('back')} sx={styles.imageUpload} />
</div> </div>
<TextField <TextField
variant="outlined" variant="outlined"
...@@ -53,4 +52,4 @@ const RGTemplate = (props: Props) => { ...@@ -53,4 +52,4 @@ const RGTemplate = (props: Props) => {
) )
} }
export default withStyles(styles)(RGTemplate) export default RGTemplate
import { Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { createStyles } from '@material-ui/styles' import { Theme } from '@mui/material/styles'
// eslint-disable-next-line // eslint-disable-next-line
export default (theme: Theme) => { export default (theme: Theme) => {
return createStyles({ return createSxStyles({
container: { display: 'flex', flexDirection: 'column', alignItems: 'center' }, container: { display: 'flex', flexDirection: 'column', alignItems: 'center' },
imagesContainer: { display: 'flex', width: '100%', padding: theme.spacing(1) }, imagesContainer: { display: 'flex', width: '100%', padding: theme.spacing(1) },
imageUpload: { width: '50%', textAlign: 'center' }, imageUpload: { width: '50%', textAlign: 'center' },
......
import { CSSProperties } from '@material-ui/styles/withStyles' import { CSSProperties } from '@mui/system'
export const drawerWidth = 300 export const drawerWidth = '300px'
export const toolbarHeight = 124 export const toolbarHeight = '124px'
export const flexColumn: CSSProperties = { export const flexColumn: CSSProperties = {
display: 'flex', display: 'flex',
......
...@@ -8,9 +8,9 @@ import { render } from 'react-dom' ...@@ -8,9 +8,9 @@ import { render } from 'react-dom'
import { Provider } from 'react-redux' import { Provider } from 'react-redux'
import { browser, SUPPORTED_BROWSERS } from '@agiliza/constants/browser' import { browser, SUPPORTED_BROWSERS } from '@agiliza/constants/browser'
import DateFnsUtils from '@date-io/date-fns' import { LocalizationProvider } from '@mui/lab'
import { MuiThemeProvider } from '@material-ui/core/styles' import AdapterDateFns from '@mui/lab/AdapterDateFns'
import { MuiPickersUtilsProvider } from '@material-ui/pickers' import { ThemeProvider } from '@mui/material/styles'
import { SESSION_KEY } from './api/useCases/shared' import { SESSION_KEY } from './api/useCases/shared'
import ErrorDialog from './components/molecules/ErrorDialog' import ErrorDialog from './components/molecules/ErrorDialog'
...@@ -28,12 +28,12 @@ interface Props {} ...@@ -28,12 +28,12 @@ interface Props {}
const Adm = (props: Props) => { const Adm = (props: Props) => {
return ( return (
<Provider store={store}> <Provider store={store}>
<MuiThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<MuiPickersUtilsProvider utils={DateFnsUtils} locale={ptBR}> <LocalizationProvider dateAdapter={AdapterDateFns} locale={ptBR}>
<Views /> <Views />
<ErrorDialog /> <ErrorDialog />
</MuiPickersUtilsProvider> </LocalizationProvider>
</MuiThemeProvider> </ThemeProvider>
</Provider> </Provider>
) )
} }
......
import red from '@material-ui/core/colors/red' import red from '@mui/material/colors/red'
import { createMuiTheme } from '@material-ui/core/styles' import { createTheme } from '@mui/material/styles'
import { SxProps } from '@mui/system'
export const defaultToobarHeight = 64 export const defaultToobarHeight = 64
export const theme = createMuiTheme({ export const theme = createTheme({
palette: { palette: {
primary: { primary: {
light: '#034da6', light: '#034da6',
main: '#0d3366' main: '#0d3366',
}, },
secondary: { secondary: {
main: '#23a897', main: '#23a897',
contrastText: '#fafafa' contrastText: '#fafafa',
}, },
text: { primary: '#2e2e2e' }, text: { primary: '#2e2e2e' },
error: { error: {
main: red[500] main: red[500],
} },
}, },
mixins: { mixins: {
toolbar: { toolbar: {
minHeight: defaultToobarHeight minHeight: defaultToobarHeight,
} },
}, },
typography: { typography: {
fontSize: 13, fontSize: 13,
fontFamily: "'Rubik', 'Roboto', 'Open Sans', sans-serif" fontFamily: "'Rubik', 'Roboto', 'Open Sans', sans-serif",
}, },
overrides: { components: {
MuiInputBase: { MuiInputBase: {
input: { styleOverrides: {
'&:-webkit-autofill': { input: {
WebkitBoxShadow: '0 0 0 1000px white inset' '&:-webkit-autofill': {
} WebkitBoxShadow: '0 0 0 1000px white inset',
} },
},
},
}, },
MuiTableCell: { MuiTableCell: {
root: { styleOverrides: {
fontFamily: 'Heebo' root: {
} fontFamily: 'Heebo',
},
},
}, },
MuiListItemText: { MuiListItemText: {
primary: { styleOverrides: {
fontFamily: 'Heebo' primary: {
} fontFamily: 'Heebo',
},
},
}, },
MuiDialogContentText: { MuiDialogContentText: {
root: { styleOverrides: {
fontFamily: 'Heebo' root: {
} fontFamily: 'Heebo',
},
},
}, },
MuiListItemIcon: { MuiListItemIcon: {
root: { styleOverrides: {
minWidth: 40 root: {
} minWidth: 40,
} },
} },
},
},
}) })
export const createSxStyles = <T extends { [k: string]: SxProps<typeof theme> }>(obj: T) => obj
...@@ -2,13 +2,12 @@ import cn from 'classnames' ...@@ -2,13 +2,12 @@ import cn from 'classnames'
import React from 'react' import React from 'react'
import { browser, SUPPORTED_BROWSERS } from '@agiliza/constants/browser' import { browser, SUPPORTED_BROWSERS } from '@agiliza/constants/browser'
import { withStyles, WithStyles } from '@material-ui/core/styles' import { Link } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import styles from './styles' import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles> interface Props {}
interface Props extends ExtendedProps {}
const chrome = SUPPORTED_BROWSERS['chrome'].replace(/(>=)/g, '') + '+' const chrome = SUPPORTED_BROWSERS['chrome'].replace(/(>=)/g, '') + '+'
const firefox = SUPPORTED_BROWSERS['firefox'].replace(/(>=)/g, '') + '+' const firefox = SUPPORTED_BROWSERS['firefox'].replace(/(>=)/g, '') + '+'
...@@ -16,33 +15,33 @@ const edge = SUPPORTED_BROWSERS['windows']['edge'].replace(/(>=)/g, '') + '+' ...@@ -16,33 +15,33 @@ const edge = SUPPORTED_BROWSERS['windows']['edge'].replace(/(>=)/g, '') + '+'
const safari = SUPPORTED_BROWSERS['macos']['safari'].replace(/(>=)/g, '') + '+' const safari = SUPPORTED_BROWSERS['macos']['safari'].replace(/(>=)/g, '') + '+'
const BrowserIncompatible = (props: Props) => { const BrowserIncompatible = (props: Props) => {
const { classes } = props const styles = useStyles(useTheme())
return ( return (
<div className={classes.page}> <div style={styles.page}>
<i className={cn('fas fa-exclamation-circle', classes.titleIcon)} /> <i className="fas fa-exclamation-circle" style={styles.titleIcon} />
<h1 className={classes.title}>Navegador não suportado</h1> <h1 style={styles.title}>Navegador não suportado</h1>
<p className={classes.subTitle}>{`Você está usando o ${browser.getBrowserName()} na versão ${browser.getBrowserVersion()}`}</p> <p style={styles.subTitle}>{`Você está usando o ${browser.getBrowserName()} na versão ${browser.getBrowserVersion()}`}</p>
<p className={classes.subTitle}>É recomendado utilizar o {process.env.APP_TITLE} em um dos seguintes navegadores:</p> <p style={styles.subTitle}>É recomendado utilizar o {process.env.APP_TITLE} em um dos seguintes navegadores:</p>
<div className={classes.browserList}> <div style={styles.browserList}>
<a target="#" className={classes.anchorBrowser} href="https://www.google.com/chrome/"> <Link target="#" sx={styles.anchorBrowser} href="https://www.google.com/chrome/">
<i className={cn('fab fa-chrome', classes.icon)} /> <i className={cn('fab fa-chrome', styles.icon)} />
Chrome {chrome} Chrome {chrome}
</a> </Link>
<a target="#" className={classes.anchorBrowser} href="https://www.mozilla.org/en-US/firefox/new/"> <Link target="#" sx={styles.anchorBrowser} href="https://www.mozilla.org/en-US/firefox/new/">
<i className={cn('fab fa-firefox-browser', classes.icon)} /> <i className={cn('fab fa-firefox-browser', styles.icon)} />
Firefox {firefox} Firefox {firefox}
</a> </Link>
<a target="#" className={classes.anchorBrowser} href="https://www.microsoft.com/en-us/edge"> <Link target="#" sx={styles.anchorBrowser} href="https://www.microsoft.com/en-us/edge">
<i className={cn('fab fa-edge', classes.icon)}></i> <i className={cn('fab fa-edge', styles.icon)}></i>
Edge {edge} Edge {edge}
</a> </Link>
<a target="#" className={classes.anchorBrowser} href="https://support.apple.com/downloads/safari"> <Link target="#" sx={styles.anchorBrowser} href="https://support.apple.com/downloads/safari">
<i className={cn('fab fa-safari', classes.icon)}></i> <i className={cn('fab fa-safari', styles.icon)}></i>
Safari {safari} Safari {safari}
</a> </Link>
</div> </div>
</div> </div>
) )
} }
export default withStyles(styles)(BrowserIncompatible) export default BrowserIncompatible
import { Theme } from '@material-ui/core' import { createSxStyles } from '@agiliza/theme'
import { createStyles } from '@material-ui/core/styles' import { Theme } from '@mui/material'
export default (theme: Theme) => { export default (theme: Theme) => {
return createStyles({ return createSxStyles({
page: { page: {
display: 'flex', display: 'flex',
flexDirection: 'column', flexDirection: 'column',
...@@ -16,7 +16,7 @@ export default (theme: Theme) => { ...@@ -16,7 +16,7 @@ export default (theme: Theme) => {
title: { title: {
textAlign: 'center', textAlign: 'center',
marginBottom: '1rem', marginBottom: '1rem',
fontSize: 'xx-large', fontSize: 'xxx-large',
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif', fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
}, },
subTitle: { subTitle: {
......
...@@ -9,9 +9,11 @@ import { StoreState } from '@agiliza/redux' ...@@ -9,9 +9,11 @@ import { StoreState } from '@agiliza/redux'
import { isAuthenticated } from '@agiliza/redux/session/selectors' import { isAuthenticated } from '@agiliza/redux/session/selectors'
import { actions } from '@agiliza/redux/ui/login' import { actions } from '@agiliza/redux/ui/login'
import { isFetching } from '@agiliza/redux/ui/login/selectors' import { isFetching } from '@agiliza/redux/ui/login/selectors'
import InputAdornment from '@material-ui/core/InputAdornment' import AccountCircle from '@mui/icons-material/AccountCircle'
import Typography from '@material-ui/core/Typography' import Box from '@mui/material/Box'
import AccountCircle from '@material-ui/icons/AccountCircle' import InputAdornment from '@mui/material/InputAdornment'
import { useTheme } from '@mui/material/styles'
import Typography from '@mui/material/Typography'
import { useStyles } from './styles' import { useStyles } from './styles'
...@@ -28,7 +30,7 @@ interface Props extends BaseProps { ...@@ -28,7 +30,7 @@ interface Props extends BaseProps {
const Login = (props: Props) => { const Login = (props: Props) => {
const { loginRequest, authenticated, fetching, redirectTo } = props const { loginRequest, authenticated, fetching, redirectTo } = props
const classes = useStyles() const styles = useStyles(useTheme())
const [username, setUsername] = useState('') const [username, setUsername] = useState('')
const [password, setPassword] = useState('') const [password, setPassword] = useState('')
...@@ -42,20 +44,20 @@ const Login = (props: Props) => { ...@@ -42,20 +44,20 @@ const Login = (props: Props) => {
} }
return ( return (
<div className={classes.container}> <div style={styles.container}>
{/* <div className={classes.logo} /> */} {/* <div className={classes.logo} /> */}
<div className={classes.formContainer}> <Box sx={styles.formContainer}>
<Typography align="center" className={classes.title} color="primary"> <Typography align="center" sx={styles.title} color="primary">
{process.env.APP_TITLE} {process.env.APP_TITLE}
</Typography> </Typography>
<form className={classes.form} onKeyDown={(evt) => evt.keyCode === 13 && handleLogin()}> <form style={styles.form} onKeyDown={(evt) => evt.keyCode === 13 && handleLogin()}>
<TextFieldWithIcon <TextFieldWithIcon
autoFocus autoFocus
required required
value={username} value={username}
onChange={(evt) => setUsername(evt.target.value)} onChange={(evt) => setUsername(evt.target.value)}
label="Usuário" label="Usuário"
className={classes.usernameTxtField} sx={styles.usernameTxtField}
InputProps={{ InputProps={{
startAdornment: ( startAdornment: (
<InputAdornment position="start"> <InputAdornment position="start">
...@@ -69,7 +71,7 @@ const Login = (props: Props) => { ...@@ -69,7 +71,7 @@ const Login = (props: Props) => {
<ButtonWithProgress disabled={!username} color="secondary" fetching={fetching} onClick={handleLogin}> <ButtonWithProgress disabled={!username} color="secondary" fetching={fetching} onClick={handleLogin}>
Entrar Entrar
</ButtonWithProgress> </ButtonWithProgress>
</div> </Box>
{/* <PopoverVersion service={service} /> */} {/* <PopoverVersion service={service} /> */}
</div> </div>
) )
......
import { flexColumn } from '@agiliza/constants/styles' import { flexColumn } from '@agiliza/constants/styles'
import { makeStyles, Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { createStyles } from '@material-ui/styles' import { Theme } from '@mui/material/styles'
// eslint-disable-next-line // eslint-disable-next-line
export const useStyles = makeStyles((theme: Theme) => export const useStyles = (theme: Theme) =>
createStyles({ createSxStyles({
title: { title: {
fontSize: '150%', fontSize: '150%',
fontWeight: 'bold', fontWeight: 'bold',
...@@ -41,6 +41,5 @@ export const useStyles = makeStyles((theme: Theme) => ...@@ -41,6 +41,5 @@ export const useStyles = makeStyles((theme: Theme) =>
display: 'flex', display: 'flex',
flexDirection: 'column', flexDirection: 'column',
}, },
usernameTxtField: { marginBottom: 10 }, usernameTxtField: { marginBottom: theme.spacing(2) },
}) })
)
import cn from 'classnames'
import React from 'react' import React from 'react'
import ItemWithIcon from '@agiliza/components/atoms/ItemWithIcon' import ItemWithIcon from '@agiliza/components/atoms/ItemWithIcon'
import List from '@material-ui/core/List' import { AttachMoney as AttachMoneyIcon, ExitToApp } from '@mui/icons-material'
import { AttachMoney as AttachMoneyIcon, ExitToApp } from '@material-ui/icons' import { ListItemProps } from '@mui/material'
import withStyles from '@material-ui/styles/withStyles' import List from '@mui/material/List'
import { useTheme } from '@mui/material/styles'
import { styles } from './styles' import { useStyles } from './styles'
import type { WithStyles } from '@material-ui/styles/withStyles'
import type { RouteComponentProps } from 'react-router-dom' import type { RouteComponentProps } from 'react-router-dom'
import type { Props as DrawerProps } from '@agiliza/components/molecules/Drawer' import type { Props as DrawerProps } from '@agiliza/components/molecules/Drawer'
interface ListItem { interface ListItem {
...@@ -32,10 +31,10 @@ export const mapPathToTitle = (path: string) => { ...@@ -32,10 +31,10 @@ export const mapPathToTitle = (path: string) => {
return drawerListItems.find((dL) => dL.path === path)?.label || '' return drawerListItems.find((dL) => dL.path === path)?.label || ''
} }
type ExtendedTypes = RouteComponentProps & WithStyles<typeof styles> type ExtendedTypes = RouteComponentProps
interface Props extends ExtendedTypes { interface Props extends ExtendedTypes {
listItemClassName?: string sx: ListItemProps['sx']
toggleDrawer: () => void toggleDrawer: () => void
logout: DrawerProps['logout'] logout: DrawerProps['logout']
} }
...@@ -46,30 +45,26 @@ const isCurrentPath = (history: RouteComponentProps['history'], path: string) => ...@@ -46,30 +45,26 @@ const isCurrentPath = (history: RouteComponentProps['history'], path: string) =>
} }
const DrawerItems = (props: Props) => { const DrawerItems = (props: Props) => {
const { listItemClassName, history, classes, toggleDrawer, logout } = props const styles = useStyles(useTheme())
const { sx, history, toggleDrawer, logout } = props
const handleClick = (path: string) => () => { const handleClick = (path: string) => () => {
history.push(path) history.push(path)
toggleDrawer() toggleDrawer()
} }
const listItemComponent = (label: string, path: string, Icon: React.ComponentType) => ( const listItemComponent = (label: string, path: string, Icon: React.ComponentType) => (
<ItemWithIcon <ItemWithIcon key={path} label={label} sx={{ ...sx, ...(isCurrentPath(history, path) ? styles.selected : {}) }} onClick={handleClick(path)}>
key={path}
label={label}
className={cn(listItemClassName, { [classes.selected]: isCurrentPath(history, path) })}
onClick={handleClick(path)}
>
<Icon /> <Icon />
</ItemWithIcon> </ItemWithIcon>
) )
return ( return (
<List className={classes.list}> <List sx={styles.list}>
{drawerListItems.map((item) => listItemComponent(item.label, item.path, item.Icon))} {drawerListItems.map((item) => listItemComponent(item.label, item.path, item.Icon))}
<ItemWithIcon label="Sair" className={listItemClassName} onClick={() => logout()}> <ItemWithIcon label="Sair" sx={sx} onClick={() => logout()}>
<ExitToApp /> <ExitToApp />
</ItemWithIcon> </ItemWithIcon>
</List> </List>
) )
} }
export default withStyles(styles)(DrawerItems) export default DrawerItems
import { drawerWidth } from '@agiliza/constants/styles' import { drawerWidth } from '@agiliza/constants/styles'
import { createStyles, Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material'
export const styles = (theme: Theme) => { export const useStyles = (theme: Theme) =>
return createStyles({ createSxStyles({
selected: { selected: {
backgroundColor: theme.palette.primary.light, backgroundColor: theme.palette.primary.light,
color: theme.palette.primary.contrastText, color: theme.palette.primary.contrastText,
...@@ -37,4 +38,3 @@ export const styles = (theme: Theme) => { ...@@ -37,4 +38,3 @@ export const styles = (theme: Theme) => {
}, },
grow: { flex: 1 }, grow: { flex: 1 },
}) })
}
...@@ -6,20 +6,20 @@ import CircularProgress from '@agiliza/components/molecules/CircularProgress' ...@@ -6,20 +6,20 @@ import CircularProgress from '@agiliza/components/molecules/CircularProgress'
import { actions as drawerActions } from '@agiliza/redux/ui/drawer' import { actions as drawerActions } from '@agiliza/redux/ui/drawer'
import { actions as loginActions } from '@agiliza/redux/ui/login' import { actions as loginActions } from '@agiliza/redux/ui/login'
import { ProposalDataRouteState } from '@agiliza/views/ProposalData/pages/ProposalData' import { ProposalDataRouteState } from '@agiliza/views/ProposalData/pages/ProposalData'
import { Button, ListItem, ListItemIcon, ListItemText, Menu, Typography } from '@material-ui/core' import { AccountCircleOutlined as PersonIcon, MeetingRoom as LogoutIcon } from '@mui/icons-material'
import { withStyles, WithStyles } from '@material-ui/core/styles' import { Button, Link, ListItem, ListItemIcon, ListItemText, Menu, Typography } from '@mui/material'
import { AccountCircleOutlined as PersonIcon, MeetingRoom as LogoutIcon } from '@material-ui/icons' import { useTheme } from '@mui/material/styles'
import connect, { ConnectedProps } from './connect' import connect, { ConnectedProps } from './connect'
import { PATHS } from './DrawerItems' import { PATHS } from './DrawerItems'
import styles from './styles' import useStyles from './styles'
const SimulationCreditLines = lazy(() => import('@agiliza/views/SimulationCreditLines/pages/router')) const SimulationCreditLines = lazy(() => import('@agiliza/views/SimulationCreditLines/pages/router'))
const ProposalData = lazy(() => import('@agiliza/views/ProposalData/pages/ProposalData')) const ProposalData = lazy(() => import('@agiliza/views/ProposalData/pages/ProposalData'))
const Projects = lazy(() => import('@agiliza/views/Projects/pages/router')) const Projects = lazy(() => import('@agiliza/views/Projects/pages/router'))
// const SecurityProfile = lazy(() => import('@curio/ui/dist/views/SecurityProfile')) // const SecurityProfile = lazy(() => import('@curio/ui/dist/views/SecurityProfile'))
type BaseProps = RouteComponentProps & ConnectedProps & WithStyles<typeof styles> type BaseProps = RouteComponentProps & ConnectedProps
interface Props extends BaseProps { interface Props extends BaseProps {
toggleDrawer: typeof drawerActions.toggleDrawer toggleDrawer: typeof drawerActions.toggleDrawer
...@@ -27,7 +27,8 @@ interface Props extends BaseProps { ...@@ -27,7 +27,8 @@ interface Props extends BaseProps {
} }
const Main = (props: Props) => { const Main = (props: Props) => {
const { classes, toggleDrawer, fetchMenu, customer } = props const { toggleDrawer, fetchMenu, customer } = props
const styles = useStyles(useTheme())
const history = useHistory() const history = useHistory()
...@@ -55,20 +56,24 @@ const Main = (props: Props) => { ...@@ -55,20 +56,24 @@ const Main = (props: Props) => {
} }
return ( return (
<div className={classes.pageContainer}> <div style={styles.pageContainer}>
<AppBar <AppBar
onNavClick={toggleDrawer} onNavClick={toggleDrawer}
title={ title={
<div style={{ display: 'flex' }}> <>
<a onClick={() => history.push('/')} className={classes.titleAnchor}> <Link onClick={() => history.push('/')} sx={styles.titleAnchor}>
<Typography className={classes.appTitle}>Agiliza</Typography> <Typography sx={styles.appTitle}>Agiliza</Typography>
</a> </Link>
<div style={{ flex: 1 }} /> <div style={{ flex: 1 }} />
</>
}
actions={
<>
<Button color="inherit" variant="text" onClick={() => history.push(PATHS.proposals)}> <Button color="inherit" variant="text" onClick={() => history.push(PATHS.proposals)}>
Retomar proposta Retomar proposta
</Button> </Button>
{customer && <Button onClick={handleProfileClick} key="1" color="inherit" endIcon={<PersonIcon />} />} {customer && <Button onClick={handleProfileClick} key="1" color="inherit" endIcon={<PersonIcon />} />}
</div> </>
} }
/> />
{/* <Drawer drawerOpen={drawerOpen} toggleDrawer={toggleDrawer} logout={logout} Items={DrawerItems} {...routeProps} /> */} {/* <Drawer drawerOpen={drawerOpen} toggleDrawer={toggleDrawer} logout={logout} Items={DrawerItems} {...routeProps} /> */}
...@@ -100,4 +105,4 @@ const Main = (props: Props) => { ...@@ -100,4 +105,4 @@ const Main = (props: Props) => {
) )
} }
export default connect(withStyles(styles)(Main)) export default connect(Main)
import { createStyles, Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../shared-styles' import sharedStyles from '../shared-styles'
export default (theme: Theme) => { export default (theme: Theme) => {
return createStyles({ return createSxStyles({
...sharedStyles(theme), ...sharedStyles(theme),
pageContainer: { pageContainer: {
height: '100vh', height: '100vh',
...@@ -14,7 +15,7 @@ export default (theme: Theme) => { ...@@ -14,7 +15,7 @@ export default (theme: Theme) => {
paddingBottom: 0, paddingBottom: 0,
justifyContent: 'flex-start', justifyContent: 'flex-start',
}, },
appTitle: { flexGrow: 1, fontSize: '100%', textTransform: 'uppercase' }, appTitle: { flexGrow: 1, fontSize: '100%', textTransform: 'uppercase', color: 'white' },
titleAnchor: { cursor: 'pointer' }, titleAnchor: { cursor: 'pointer', display: { xs: 'none', sm: 'block' } },
}) })
} }
...@@ -3,27 +3,30 @@ import { RouteComponentProps } from 'react-router' ...@@ -3,27 +3,30 @@ import { RouteComponentProps } from 'react-router'
import { Project } from '@agiliza/api/domain/project' import { Project } from '@agiliza/api/domain/project'
import { PATHS } from '@agiliza/views/Main/DrawerItems' import { PATHS } from '@agiliza/views/Main/DrawerItems'
import { Apps as AppsIcon } from '@mui/icons-material'
import { import {
Avatar, Avatar,
Box,
CircularProgress, CircularProgress,
List, List,
ListItem, ListItem,
ListItemAvatar, ListItemAvatar,
ListItemText, ListItemText,
ListSubheader ListSubheader
} from '@material-ui/core' } from '@mui/material'
import { withStyles, WithStyles } from '@material-ui/core/styles' import { useTheme } from '@mui/material/styles'
import { Apps as AppsIcon } from '@material-ui/icons'
import { connected, ConnectedProps } from './connect' import { connected, ConnectedProps } from './connect'
import styles from './styles' import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles> & ConnectedProps & RouteComponentProps type ExtendedProps = ConnectedProps & RouteComponentProps
interface Props extends ExtendedProps {} interface Props extends ExtendedProps {}
const ListProjects = (props: Props) => { const ListProjects = (props: Props) => {
const { classes, fetching, proposals, history } = props const { fetching, proposals, history } = props
const styles = useStyles(useTheme())
useEffect(() => { useEffect(() => {
props.getProjects() props.getProjects()
...@@ -37,9 +40,9 @@ const ListProjects = (props: Props) => { ...@@ -37,9 +40,9 @@ const ListProjects = (props: Props) => {
if (fetching) return <CircularProgress /> if (fetching) return <CircularProgress />
return ( return (
<div className={classes.pageContent}> <Box sx={styles.pageContent}>
<List <List
className={classes.list} sx={styles.list}
subheader={ subheader={
<ListSubheader component="div" id="nested-list-subheader"> <ListSubheader component="div" id="nested-list-subheader">
Projetos Projetos
...@@ -57,8 +60,8 @@ const ListProjects = (props: Props) => { ...@@ -57,8 +60,8 @@ const ListProjects = (props: Props) => {
</ListItem> </ListItem>
))} ))}
</List> </List>
</div> </Box>
) )
} }
export default connected(withStyles(styles)(ListProjects)) export default connected(ListProjects)
import { Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { createStyles } from '@material-ui/styles' import { Theme } from '@mui/material'
import sharedStyles from '../shared-styles' import sharedStyles from '../shared-styles'
// eslint-disable-next-line const styles = (theme: Theme) =>
export default (theme: Theme) => createSxStyles({
createStyles({
...sharedStyles(theme), ...sharedStyles(theme),
list: { width: '100%' }, list: { width: '100%' },
}) })
export default styles
...@@ -3,10 +3,10 @@ import { Route, RouteComponentProps, Switch } from 'react-router' ...@@ -3,10 +3,10 @@ import { Route, RouteComponentProps, Switch } from 'react-router'
import AuthRoute from '@agiliza/components/atoms/AuthRoute' import AuthRoute from '@agiliza/components/atoms/AuthRoute'
import { PATHS } from '@agiliza/views/Main/DrawerItems' import { PATHS } from '@agiliza/views/Main/DrawerItems'
import { CircularProgress } from '@material-ui/core' import { Box, CircularProgress } from '@mui/material'
import { withStyles, WithStyles } from '@material-ui/core/styles' import { useTheme } from '@mui/material/styles'
import styles from './shared-styles' import useStyles from './shared-styles'
export const PROJECTS_PATHS = { export const PROJECTS_PATHS = {
login: PATHS.proposals + '/login', login: PATHS.proposals + '/login',
...@@ -15,23 +15,22 @@ export const PROJECTS_PATHS = { ...@@ -15,23 +15,22 @@ export const PROJECTS_PATHS = {
const ListProjects = lazy(() => import('./ListProjects')) const ListProjects = lazy(() => import('./ListProjects'))
const Login = lazy(() => import('@agiliza/views/Login')) const Login = lazy(() => import('@agiliza/views/Login'))
type ExtendedProps = WithStyles<typeof styles> & RouteComponentProps type ExtendedProps = RouteComponentProps
interface Props extends ExtendedProps {} interface Props extends ExtendedProps {}
const ProposalDataRouter = (props: Props) => { const ProposalDataRouter = (props: Props) => {
const { classes } = props const styles = useStyles(useTheme())
return ( return (
<div className={classes.pageContent}> <Box sx={styles.pageContent}>
<Suspense fallback={<CircularProgress className={classes.circularProgress} />}> <Suspense fallback={<CircularProgress sx={styles.circularProgress} />}>
<Switch> <Switch>
<Route path={PROJECTS_PATHS.login} render={(renderProps) => <Login {...renderProps} redirectTo={PATHS.proposals} />} /> <Route path={PROJECTS_PATHS.login} render={(renderProps) => <Login {...renderProps} redirectTo={PATHS.proposals} />} />
<AuthRoute path={PATHS.proposals} redirectTo={PROJECTS_PATHS.login} component={ListProjects} /> <AuthRoute path={PATHS.proposals} redirectTo={PROJECTS_PATHS.login} component={ListProjects} />
</Switch> </Switch>
</Suspense> </Suspense>
</div> </Box>
) )
} }
export default withStyles(styles)(ProposalDataRouter) export default ProposalDataRouter
import { createSxStyles } from '@agiliza/theme'
import sharedStyles from '@agiliza/views/shared-styles' import sharedStyles from '@agiliza/views/shared-styles'
import { Theme } from '@material-ui/core/styles' import { Theme } from '@mui/material'
import { createStyles } from '@material-ui/styles'
// eslint-disable-next-line const styles = (theme: Theme) =>
export default (theme: Theme) => createSxStyles({
createStyles({
...sharedStyles(theme), ...sharedStyles(theme),
title: { marginBottom: theme.spacing(2) }, title: { marginBottom: theme.spacing(2) },
}) })
export default styles
import React from 'react' import React from 'react'
import { maskCNPJ, maskCPFCNPJ } from '@agiliza/utils/masks' import { maskCNPJ, maskCPFCNPJ } from '@agiliza/utils/masks'
import { TextField, TextFieldProps } from '@material-ui/core' import { TextField, TextFieldProps } from '@mui/material'
type ExtendedProps = Record<string, unknown> & Pick<TextFieldProps, 'value' | 'onChange' | 'disabled'> type ExtendedProps = Record<string, unknown> & Pick<TextFieldProps, 'value' | 'onChange' | 'disabled'>
......
...@@ -3,15 +3,11 @@ import React from 'react' ...@@ -3,15 +3,11 @@ import React from 'react'
import { IPAddress } from '@agiliza/api/domain' import { IPAddress } from '@agiliza/api/domain'
import { maskCEP } from '@agiliza/utils/masks' import { maskCEP } from '@agiliza/utils/masks'
import { extractNumbers } from '@agiliza/utils/method' import { extractNumbers } from '@agiliza/utils/method'
import { TextField, TextFieldProps } from '@material-ui/core' import { TextField, TextFieldProps } from '@mui/material'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { AddressState } from './state' import { AddressState } from './state'
import styles from './styles'
type ExtendedProps = WithStyles<typeof styles> interface Props {
interface Props extends ExtendedProps {
state: AddressState state: AddressState
onChange: (address: Partial<IPAddress>) => void onChange: (address: Partial<IPAddress>) => void
} }
...@@ -35,4 +31,4 @@ const Address = (props: Props) => { ...@@ -35,4 +31,4 @@ const Address = (props: Props) => {
) )
} }
export default withStyles(styles)(Address) export default Address
import { Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { createStyles } from '@material-ui/styles' import { Theme } from '@mui/material/styles'
// eslint-disable-next-line // eslint-disable-next-line
export default (theme: Theme) => { export default (theme: Theme) => {
return createStyles({ return createSxStyles({
form: { form: {
'& .MuiTextField-root': { '& .MuiTextField-root': {
marginBottom: theme.spacing(2), marginBottom: theme.spacing(2),
......
...@@ -2,7 +2,7 @@ import React from 'react' ...@@ -2,7 +2,7 @@ import React from 'react'
import { extractNumbers } from '@agiliza/utils/extractors' import { extractNumbers } from '@agiliza/utils/extractors'
import { formatCurrency } from '@agiliza/utils/formatters' import { formatCurrency } from '@agiliza/utils/formatters'
import { TextField, TextFieldProps } from '@material-ui/core' import { TextField, TextFieldProps } from '@mui/material'
const getTotalPrice = <T extends { price: string; amount: string }>(pva: T) => { const getTotalPrice = <T extends { price: string; amount: string }>(pva: T) => {
const { amount, price } = pva const { amount, price } = pva
......
import React from 'react' import React from 'react'
import { ActionType } from '@agiliza/utils/hooks/state' import { ActionType } from '@agiliza/utils/hooks/state'
import { withStyles, WithStyles } from '@material-ui/core/styles' import { useTheme } from '@mui/material/styles'
import { connected, ConnectedProps } from './connect' import { connected, ConnectedProps } from './connect'
import Form from './Form' import Form from './Form'
import { BDAddressState } from './state' import { BDAddressState } from './state'
import styles from './styles' import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles> & ConnectedProps type ExtendedProps = ConnectedProps
interface Props extends ExtendedProps { interface Props extends ExtendedProps {
state: BDAddressState state: BDAddressState
...@@ -16,15 +16,16 @@ interface Props extends ExtendedProps { ...@@ -16,15 +16,16 @@ interface Props extends ExtendedProps {
} }
const Address = (props: Props) => { const Address = (props: Props) => {
const { classes, context, state, actions } = props const { context, state, actions } = props
const styles = useStyles(useTheme())
return ( return (
<div className={classes.contentContainer}> <div style={styles.contentContainer}>
<div className={classes.content}> <div style={styles.content}>
<Form state={state} actions={actions} context={context} /> <Form state={state} actions={actions} context={context} />
</div> </div>
</div> </div>
) )
} }
export default connected(withStyles(styles)(Address)) export default connected(Address)
...@@ -5,22 +5,21 @@ import ImageUpload from '@agiliza/components/organisms/ImageUpload' ...@@ -5,22 +5,21 @@ import ImageUpload from '@agiliza/components/organisms/ImageUpload'
import AddressTemplate from '@agiliza/components/templates/Address' import AddressTemplate from '@agiliza/components/templates/Address'
import { ActionType } from '@agiliza/utils/hooks/state' import { ActionType } from '@agiliza/utils/hooks/state'
import { getBase64FromFile } from '@agiliza/utils/method' import { getBase64FromFile } from '@agiliza/utils/method'
import { TextField, TextFieldProps } from '@material-ui/core' import { Box, TextField, TextFieldProps } from '@mui/material'
import { withStyles, WithStyles } from '@material-ui/core/styles' import { useTheme } from '@mui/material/styles'
import { BDAddressState } from '../state' import { BDAddressState } from '../state'
import styles from './styles' import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles> interface Props {
interface Props extends ExtendedProps {
state: BDAddressState state: BDAddressState
actions: ActionType<BDAddressState> actions: ActionType<BDAddressState>
context: AuthenticationContext context: AuthenticationContext
} }
const Form = (props: Props) => { const Form = (props: Props) => {
const { classes, state: _state, actions, context } = props const { state: _state, actions, context } = props
const styles = useStyles(useTheme())
const { cep, number, street, city, complement, district, state, referencePoint, proof } = _state const { cep, number, street, city, complement, district, state, referencePoint, proof } = _state
...@@ -39,7 +38,7 @@ const Form = (props: Props) => { ...@@ -39,7 +38,7 @@ const Form = (props: Props) => {
} }
return ( return (
<form className={classes.form}> <Box sx={styles.form} component="form">
<ImageUpload label="Comprovante de residência" image={proof} onChangeImage={handleChangeProof} /> <ImageUpload label="Comprovante de residência" image={proof} onChangeImage={handleChangeProof} />
<AddressTemplate <AddressTemplate
states={context.states} states={context.states}
...@@ -48,8 +47,8 @@ const Form = (props: Props) => { ...@@ -48,8 +47,8 @@ const Form = (props: Props) => {
onChange={(addrs) => actions.update(addrs)} onChange={(addrs) => actions.update(addrs)}
/> />
<TextField variant="outlined" label="Ponto de referência" value={referencePoint} onChange={handleChangeText('referencePoint')} /> <TextField variant="outlined" label="Ponto de referência" value={referencePoint} onChange={handleChangeText('referencePoint')} />
</form> </Box>
) )
} }
export default withStyles(styles)(Form) export default Form
import { Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { createStyles } from '@material-ui/styles' import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles' import sharedStyles from '../styles'
// eslint-disable-next-line // eslint-disable-next-line
export default (theme: Theme) => { export default (theme: Theme) => {
return createStyles({ return createSxStyles({
...sharedStyles(theme), ...sharedStyles(theme),
form: { form: {
'& .MuiTextField-root': { '& .MuiTextField-root': {
......
import { Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { createStyles } from '@material-ui/styles' import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles' import sharedStyles from '../styles'
// eslint-disable-next-line // eslint-disable-next-line
export default (theme: Theme) => { export default (theme: Theme) => {
return createStyles({ return createSxStyles({
...sharedStyles(theme), ...sharedStyles(theme),
}) })
} }
import React from 'react' import React from 'react'
import { RouteComponentProps } from 'react-router' import { RouteComponentProps } from 'react-router'
import { withStyles, WithStyles } from '@material-ui/core/styles' type ExtendedProps = RouteComponentProps
import styles from './styles'
type ExtendedProps = WithStyles<typeof styles> & RouteComponentProps
interface Props extends ExtendedProps {} interface Props extends ExtendedProps {}
const BusinessData = (props: Props) => { const BusinessData = (props: Props) => {
const { classes } = props return <div></div>
return <div className={classes.contentContainer}></div>
} }
export default withStyles(styles)(BusinessData) export default BusinessData
...@@ -6,22 +6,21 @@ import { ActionType } from '@agiliza/utils/hooks/state' ...@@ -6,22 +6,21 @@ import { ActionType } from '@agiliza/utils/hooks/state'
import { getBase64FromFile } from '@agiliza/utils/method' import { getBase64FromFile } from '@agiliza/utils/method'
import CPFCNPJField from '@agiliza/views/ProposalData/components/atoms/CPFCNPJField' import CPFCNPJField from '@agiliza/views/ProposalData/components/atoms/CPFCNPJField'
import { DatePicker, SelectField, SelectFieldProps } from '@curio/components' import { DatePicker, SelectField, SelectFieldProps } from '@curio/components'
import { TextField, TextFieldProps } from '@material-ui/core' import { Box, TextField, TextFieldProps } from '@mui/material'
import { withStyles, WithStyles } from '@material-ui/core/styles' import { useTheme } from '@mui/material/styles'
import { BDIdentificationState } from '../state' import { BDIdentificationState } from '../state'
import styles from './styles' import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles> interface Props {
interface Props extends ExtendedProps {
state: BDIdentificationState state: BDIdentificationState
actions: ActionType<BDIdentificationState> actions: ActionType<BDIdentificationState>
context: ProposalDataContext context: ProposalDataContext
} }
const Form = (props: Props) => { const Form = (props: Props) => {
const { classes, state, actions, context } = props const { state, actions, context } = props
const styles = useStyles(useTheme())
const { const {
cnpj, cnpj,
...@@ -44,8 +43,8 @@ const Form = (props: Props) => { ...@@ -44,8 +43,8 @@ const Form = (props: Props) => {
actions.update({ [key]: evt.target.value }) actions.update({ [key]: evt.target.value })
} }
const handleChangeDate = (type: keyof Pick<BDIdentificationState, 'openingDate'>) => (date: Date | null) => { const handleChangeDate = (type: keyof Pick<BDIdentificationState, 'openingDate'>) => (date: unknown) => {
actions.update({ [type]: date }) actions.update({ [type]: date as Date })
} }
const handleChangeSelect = const handleChangeSelect =
...@@ -68,7 +67,7 @@ const Form = (props: Props) => { ...@@ -68,7 +67,7 @@ const Form = (props: Props) => {
} }
return ( return (
<form className={classes.form}> <Box sx={styles.form}>
<DocumentTemplate document={document} context={context} onChangeImage={handleChangeProof} onChangeDocumentType={handleChangeDocumentType} /> <DocumentTemplate document={document} context={context} onChangeImage={handleChangeProof} onChangeDocumentType={handleChangeDocumentType} />
<CPFCNPJField value={cnpj} onChange={handleChangeText('cnpj')} onlyCPNJ /> <CPFCNPJField value={cnpj} onChange={handleChangeText('cnpj')} onlyCPNJ />
<DatePicker <DatePicker
...@@ -76,8 +75,8 @@ const Form = (props: Props) => { ...@@ -76,8 +75,8 @@ const Form = (props: Props) => {
label="Data da abertura" label="Data da abertura"
value={openingDate} value={openingDate}
onChange={handleChangeDate('openingDate')} onChange={handleChangeDate('openingDate')}
format="dd/MM/yyyy" // format="dd/MM/yyyy"
className={classes.datePicker} sx={styles.datePicker}
/> />
<TextField variant="outlined" label="Inscrição estadual" value={stateRegistration} onChange={handleChangeText('stateRegistration')} /> <TextField variant="outlined" label="Inscrição estadual" value={stateRegistration} onChange={handleChangeText('stateRegistration')} />
<TextField variant="outlined" label="Inscrição municipal" value={cityRegistration} onChange={handleChangeText('cityRegistration')} /> <TextField variant="outlined" label="Inscrição municipal" value={cityRegistration} onChange={handleChangeText('cityRegistration')} />
...@@ -117,8 +116,8 @@ const Form = (props: Props) => { ...@@ -117,8 +116,8 @@ const Form = (props: Props) => {
/> />
<TextField variant="outlined" type="tel" label="Código CNAE" value={codeCNAE} onChange={handleChangeText('codeCNAE')} /> <TextField variant="outlined" type="tel" label="Código CNAE" value={codeCNAE} onChange={handleChangeText('codeCNAE')} />
<TextField variant="outlined" label="Atividade principal" value={mainActivity} onChange={handleChangeText('mainActivity')} /> <TextField variant="outlined" label="Atividade principal" value={mainActivity} onChange={handleChangeText('mainActivity')} />
</form> </Box>
) )
} }
export default withStyles(styles)(Form) export default Form
import { Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { createStyles } from '@material-ui/styles' import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles' import sharedStyles from '../styles'
// eslint-disable-next-line // eslint-disable-next-line
export default (theme: Theme) => { export default (theme: Theme) => {
return createStyles({ return createSxStyles({
...sharedStyles(theme), ...sharedStyles(theme),
form: { form: {
'& .MuiTextField-root': { '& .MuiTextField-root': {
......
import React from 'react' import React from 'react'
import { ActionType } from '@agiliza/utils/hooks/state' import { ActionType } from '@agiliza/utils/hooks/state'
import { withStyles, WithStyles } from '@material-ui/core/styles' import { useTheme } from '@mui/material/styles'
import { connected, ConnectedProps } from './connect' import { connected, ConnectedProps } from './connect'
import Form from './Form' import Form from './Form'
import { BDIdentificationState } from './state' import { BDIdentificationState } from './state'
import styles from './styles' import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles> & ConnectedProps type ExtendedProps = ConnectedProps
interface Props extends ExtendedProps { interface Props extends ExtendedProps {
state: BDIdentificationState state: BDIdentificationState
...@@ -16,15 +16,16 @@ interface Props extends ExtendedProps { ...@@ -16,15 +16,16 @@ interface Props extends ExtendedProps {
} }
const Identification = (props: Props) => { const Identification = (props: Props) => {
const { classes, context, state, actions } = props const { context, state, actions } = props
const styles = useStyles(useTheme())
return ( return (
<div className={classes.contentContainer}> <div style={styles.contentContainer}>
<div className={classes.content}> <div style={styles.content}>
<Form state={state} actions={actions} context={context} /> <Form state={state} actions={actions} context={context} />
</div> </div>
</div> </div>
) )
} }
export default connected(withStyles(styles)(Identification)) export default connected(Identification)
import { Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { createStyles } from '@material-ui/styles' import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles' import sharedStyles from '../styles'
// eslint-disable-next-line // eslint-disable-next-line
export default (theme: Theme) => { export default (theme: Theme) => {
return createStyles({ return createSxStyles({
...sharedStyles(theme), ...sharedStyles(theme),
}) })
} }
...@@ -10,14 +10,14 @@ import { ...@@ -10,14 +10,14 @@ import {
DialogContent, DialogContent,
DialogProps, DialogProps,
DialogTitle DialogTitle
} from '@material-ui/core' } from '@mui/material'
import { withStyles, WithStyles } from '@material-ui/core/styles' import { useTheme } from '@mui/material/styles'
import Form from '../Form' import Form from '../Form'
import { initialState } from '../state' import { initialState } from '../state'
import styles from './styles' import useStyles from './styles'
type ExtendedProps = Pick<DialogProps, 'open'> & WithStyles<typeof styles> type ExtendedProps = Pick<DialogProps, 'open'>
interface Props extends ExtendedProps { interface Props extends ExtendedProps {
onClose: () => void onClose: () => void
...@@ -27,7 +27,8 @@ interface Props extends ExtendedProps { ...@@ -27,7 +27,8 @@ interface Props extends ExtendedProps {
} }
const Dialog = (props: Props) => { const Dialog = (props: Props) => {
const { classes, fetching, open, onClose, onSave, productService } = props const { fetching, open, onClose, onSave, productService } = props
const styles = useStyles(useTheme())
const formState = useFormState('VehicleForm', initialState) const formState = useFormState('VehicleForm', initialState)
...@@ -43,7 +44,7 @@ const Dialog = (props: Props) => { ...@@ -43,7 +44,7 @@ const Dialog = (props: Props) => {
} }
return ( return (
<MUIDialog onClose={onClose} aria-labelledby="simple-dialog-title" open={open} PaperProps={{ className: classes.dialog }}> <MUIDialog onClose={onClose} aria-labelledby="simple-dialog-title" open={open} PaperProps={{ sx: styles.dialog }}>
<DialogTitle>{productService ? 'Editar' : 'Adicionar'} pessoa envolvida</DialogTitle> <DialogTitle>{productService ? 'Editar' : 'Adicionar'} pessoa envolvida</DialogTitle>
<DialogContent> <DialogContent>
<Form {...formState} /> <Form {...formState} />
...@@ -58,4 +59,4 @@ const Dialog = (props: Props) => { ...@@ -58,4 +59,4 @@ const Dialog = (props: Props) => {
) )
} }
export default withStyles(styles)(Dialog) export default Dialog
import { Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { createStyles } from '@material-ui/styles' import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles' import sharedStyles from '../styles'
// eslint-disable-next-line // eslint-disable-next-line
export default (theme: Theme) => { export default (theme: Theme) => {
return createStyles({ return createSxStyles({
...sharedStyles(theme), ...sharedStyles(theme),
dialog: { width: '80%', height: '55%' }, dialog: { width: '80%', height: '55%' },
}) })
......
...@@ -5,21 +5,20 @@ import { ActionType } from '@agiliza/utils/hooks/state' ...@@ -5,21 +5,20 @@ import { ActionType } from '@agiliza/utils/hooks/state'
import PriceAmountInput, { import PriceAmountInput, {
Values Values
} from '@agiliza/views/ProposalData/components/templates/PriceAmountInput' } from '@agiliza/views/ProposalData/components/templates/PriceAmountInput'
import { TextField, TextFieldProps, Typography } from '@material-ui/core' import { Box, TextField, TextFieldProps, Typography } from '@mui/material'
import { withStyles, WithStyles } from '@material-ui/core/styles' import { useTheme } from '@mui/material/styles'
import { BDProductServiceState } from '../state' import { BDProductServiceState } from '../state'
import styles from './styles' import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles> interface Props {
interface Props extends ExtendedProps {
state: BDProductServiceState state: BDProductServiceState
actions: ActionType<BDProductServiceState> actions: ActionType<BDProductServiceState>
} }
const Form = (props: Props) => { const Form = (props: Props) => {
const { classes, state, actions } = props const { state, actions } = props
const styles = useStyles(useTheme())
const { description, unit, stock, monthlySales, variableCosts } = state const { description, unit, stock, monthlySales, variableCosts } = state
...@@ -34,17 +33,17 @@ const Form = (props: Props) => { ...@@ -34,17 +33,17 @@ const Form = (props: Props) => {
} }
return ( return (
<form className={classes.form}> <Box component="form" sx={styles.form}>
<TextField variant="outlined" label="Descrição do produto / serviço" value={description} onChange={handleChangeText('description')} /> <TextField variant="outlined" label="Descrição do produto / serviço" value={description} onChange={handleChangeText('description')} />
<TextField variant="outlined" label="Unidade" value={extractNumbers(unit)} onChange={handleChangeText('unit')} type="tel" /> <TextField variant="outlined" label="Unidade" value={extractNumbers(unit)} onChange={handleChangeText('unit')} type="tel" />
<Typography className={classes.label}>Informações de estoque</Typography> <Typography sx={styles.label}>Informações de estoque</Typography>
<PriceAmountInput values={stock} onChange={handleChangePriceAmount('stock')} /> <PriceAmountInput values={stock} onChange={handleChangePriceAmount('stock')} />
<Typography className={classes.label}>Vendas mensais</Typography> <Typography sx={styles.label}>Vendas mensais</Typography>
<PriceAmountInput values={monthlySales} onChange={handleChangePriceAmount('monthlySales')} /> <PriceAmountInput values={monthlySales} onChange={handleChangePriceAmount('monthlySales')} />
<Typography className={classes.label}>Custos variáveis</Typography> <Typography sx={styles.label}>Custos variáveis</Typography>
<PriceAmountInput values={variableCosts} onChange={handleChangePriceAmount('variableCosts')} /> <PriceAmountInput values={variableCosts} onChange={handleChangePriceAmount('variableCosts')} />
</form> </Box>
) )
} }
export default withStyles(styles)(Form) export default Form
import { Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { createStyles } from '@material-ui/styles' import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles' import sharedStyles from '../styles'
// eslint-disable-next-line // eslint-disable-next-line
export default (theme: Theme) => { export default (theme: Theme) => {
return createStyles({ return createSxStyles({
...sharedStyles(theme), ...sharedStyles(theme),
form: { form: {
'& .MuiTextField-root': { '& .MuiTextField-root': {
......
...@@ -2,16 +2,16 @@ import React, { useState } from 'react' ...@@ -2,16 +2,16 @@ import React, { useState } from 'react'
import { BDProductService } from '@agiliza/api/domain' import { BDProductService } from '@agiliza/api/domain'
import { ActionType } from '@agiliza/utils/hooks/state' import { ActionType } from '@agiliza/utils/hooks/state'
import { Avatar, List, ListItem, ListItemAvatar, ListItemText } from '@material-ui/core' import { Add as AddIcon, Apps as AppsIcon } from '@mui/icons-material'
import { withStyles, WithStyles } from '@material-ui/core/styles' import { Avatar, List, ListItem, ListItemAvatar, ListItemText } from '@mui/material'
import { Add as AddIcon, Apps as AppsIcon } from '@material-ui/icons' import { useTheme } from '@mui/material/styles'
import { connected, ConnectedProps } from './connect' import { connected, ConnectedProps } from './connect'
import Dialog from './Dialog' import Dialog from './Dialog'
import { BDProductServiceState } from './state' import { BDProductServiceState } from './state'
import styles from './styles' import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles> & ConnectedProps type ExtendedProps = ConnectedProps
interface Props extends ExtendedProps { interface Props extends ExtendedProps {
projectId: string projectId: string
...@@ -20,7 +20,8 @@ interface Props extends ExtendedProps { ...@@ -20,7 +20,8 @@ interface Props extends ExtendedProps {
} }
const ProductsServices = (props: Props) => { const ProductsServices = (props: Props) => {
const { classes, fetching, projectId, productsServices } = props const { fetching, projectId, productsServices } = props
const styles = useStyles(useTheme())
const [selectedProductService, setSelectedProductService] = useState<BDProductService | undefined>() const [selectedProductService, setSelectedProductService] = useState<BDProductService | undefined>()
...@@ -51,9 +52,9 @@ const ProductsServices = (props: Props) => { ...@@ -51,9 +52,9 @@ const ProductsServices = (props: Props) => {
return ( return (
<> <>
<div className={classes.contentContainer}> <div style={styles.contentContainer}>
<div className={classes.content}> <div style={styles.content}>
<List className={classes.list}> <List sx={styles.list}>
{productsServices.map((vehicle, i) => ( {productsServices.map((vehicle, i) => (
<ListItem key={i} button onClick={handleClickListItem(vehicle)}> <ListItem key={i} button onClick={handleClickListItem(vehicle)}>
<ListItemAvatar> <ListItemAvatar>
...@@ -67,7 +68,7 @@ const ProductsServices = (props: Props) => { ...@@ -67,7 +68,7 @@ const ProductsServices = (props: Props) => {
</List> </List>
</div> </div>
</div> </div>
<Avatar className={classes.avatarBtnContainer} onClick={handleClickAdd}> <Avatar sx={styles.avatarBtnContainer} onClick={handleClickAdd}>
<AddIcon /> <AddIcon />
</Avatar> </Avatar>
<Dialog fetching={fetching} open={open} onClose={handleClickClose} productService={selectedProductService} onSave={handleSave} /> <Dialog fetching={fetching} open={open} onClose={handleClickClose} productService={selectedProductService} onSave={handleSave} />
...@@ -75,4 +76,4 @@ const ProductsServices = (props: Props) => { ...@@ -75,4 +76,4 @@ const ProductsServices = (props: Props) => {
) )
} }
export default connected(withStyles(styles)(ProductsServices)) export default connected(ProductsServices)
import { Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { createStyles } from '@material-ui/styles' import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles' import sharedStyles from '../styles'
// eslint-disable-next-line // eslint-disable-next-line
export default (theme: Theme) => { export default (theme: Theme) => {
return createStyles({ return createSxStyles({
...sharedStyles(theme), ...sharedStyles(theme),
list: { width: '100%' }, list: { width: '100%' },
avatarBtnContainer: { avatarBtnContainer: {
......
...@@ -7,15 +7,13 @@ import { ActionType } from '@agiliza/utils/hooks/state' ...@@ -7,15 +7,13 @@ import { ActionType } from '@agiliza/utils/hooks/state'
import { maskMonthYear } from '@agiliza/utils/masks' import { maskMonthYear } from '@agiliza/utils/masks'
import { getBase64FromFile } from '@agiliza/utils/method' import { getBase64FromFile } from '@agiliza/utils/method'
import { SelectField, SelectFieldProps } from '@curio/components' import { SelectField, SelectFieldProps } from '@curio/components'
import { TextField, TextFieldProps, Typography } from '@material-ui/core' import { Box, TextField, TextFieldProps, Typography } from '@mui/material'
import { withStyles, WithStyles } from '@material-ui/core/styles' import { useTheme } from '@mui/material/styles'
import { BDStockSalesCostsState } from '../state' import { BDStockSalesCostsState } from '../state'
import styles from './styles' import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles> interface Props {
interface Props extends ExtendedProps {
state: BDStockSalesCostsState state: BDStockSalesCostsState
actions: ActionType<BDStockSalesCostsState> actions: ActionType<BDStockSalesCostsState>
context: ProposalDataContext context: ProposalDataContext
...@@ -23,7 +21,8 @@ interface Props extends ExtendedProps { ...@@ -23,7 +21,8 @@ interface Props extends ExtendedProps {
} }
const Form = (props: Props) => { const Form = (props: Props) => {
const { classes, state, actions, context, productsServices } = props const { state, actions, context, productsServices } = props
const styles = useStyles(useTheme())
const { monthYearReference, salesCommission, document, monthRating } = state const { monthYearReference, salesCommission, document, monthRating } = state
...@@ -63,7 +62,7 @@ const Form = (props: Props) => { ...@@ -63,7 +62,7 @@ const Form = (props: Props) => {
} }
return ( return (
<form className={classes.form}> <Box component="form" sx={styles.form}>
<DocumentTemplate context={context} document={document} onChangeImage={handleChangeImage} onChangeDocumentType={handleChangeDocumentType} /> <DocumentTemplate context={context} document={document} onChangeImage={handleChangeImage} onChangeDocumentType={handleChangeDocumentType} />
{/* <Typography className={classes.label}> {/* <Typography className={classes.label}>
Preencha as informações abaixo, e na tela seguinte informe os produtos/serviços e os respectivos dados referente a estoque, vendas mensais e Preencha as informações abaixo, e na tela seguinte informe os produtos/serviços e os respectivos dados referente a estoque, vendas mensais e
...@@ -87,7 +86,7 @@ const Form = (props: Props) => { ...@@ -87,7 +86,7 @@ const Form = (props: Props) => {
variant="outlined" variant="outlined"
shrink={false} shrink={false}
/> />
<Typography className={classes.label}> <Typography sx={styles.label}>
Após o preenchimento das informações citadas acima, os totais abaixo serão preenchidos automaticamente. Após o preenchimento das informações citadas acima, os totais abaixo serão preenchidos automaticamente.
</Typography> </Typography>
<TextField variant="outlined" disabled label="Total geral estoque" value={formatCurrency(getTotals('stock').toFixed(2)) || ''} /> <TextField variant="outlined" disabled label="Total geral estoque" value={formatCurrency(getTotals('stock').toFixed(2)) || ''} />
...@@ -99,8 +98,8 @@ const Form = (props: Props) => { ...@@ -99,8 +98,8 @@ const Form = (props: Props) => {
value={formatCurrency(getTotalCommission(salesCommission).toFixed(2)) || ''} value={formatCurrency(getTotalCommission(salesCommission).toFixed(2)) || ''}
/> />
<TextField variant="outlined" disabled label="Total geral custos var." value={formatCurrency(getTotals('variableCosts').toFixed(2)) || ''} /> <TextField variant="outlined" disabled label="Total geral custos var." value={formatCurrency(getTotals('variableCosts').toFixed(2)) || ''} />
</form> </Box>
) )
} }
export default withStyles(styles)(Form) export default Form
import { Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { createStyles } from '@material-ui/styles' import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles' import sharedStyles from '../styles'
// eslint-disable-next-line // eslint-disable-next-line
export default (theme: Theme) => { export default (theme: Theme) => {
return createStyles({ return createSxStyles({
...sharedStyles(theme), ...sharedStyles(theme),
form: { form: {
'& .MuiTextField-root': { '& .MuiTextField-root': {
......
import React from 'react' import React from 'react'
import { ActionType } from '@agiliza/utils/hooks/state' import { ActionType } from '@agiliza/utils/hooks/state'
import { withStyles, WithStyles } from '@material-ui/core/styles' import { useTheme } from '@mui/material/styles'
import { connected, ConnectedProps } from './connect' import { connected, ConnectedProps } from './connect'
import Form from './Form' import Form from './Form'
import { BDStockSalesCostsState } from './state' import { BDStockSalesCostsState } from './state'
import styles from './styles' import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles> & ConnectedProps type ExtendedProps = ConnectedProps
interface Props extends ExtendedProps { interface Props extends ExtendedProps {
state: BDStockSalesCostsState state: BDStockSalesCostsState
...@@ -16,15 +16,15 @@ interface Props extends ExtendedProps { ...@@ -16,15 +16,15 @@ interface Props extends ExtendedProps {
} }
const StockSalesCosts = (props: Props) => { const StockSalesCosts = (props: Props) => {
const { classes, context, productsServices, state, actions } = props const { context, productsServices, state, actions } = props
const styles = useStyles(useTheme())
return ( return (
<div className={classes.contentContainer}> <div style={styles.contentContainer}>
<div className={classes.content}> <div style={styles.content}>
<Form state={state} actions={actions} context={context} productsServices={productsServices} /> <Form state={state} actions={actions} context={context} productsServices={productsServices} />
</div> </div>
</div> </div>
) )
} }
export default connected(withStyles(styles)(StockSalesCosts)) export default connected(StockSalesCosts)
import { Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { createStyles } from '@material-ui/styles' import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles' import sharedStyles from '../styles'
// eslint-disable-next-line // eslint-disable-next-line
export default (theme: Theme) => { export default (theme: Theme) => {
return createStyles({ return createSxStyles({
...sharedStyles(theme), ...sharedStyles(theme),
}) })
} }
import { Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { createStyles } from '@material-ui/styles' import { Theme } from '@mui/material/styles'
import sharedStyles from '../shared-styles' import sharedStyles from '../shared-styles'
// eslint-disable-next-line // eslint-disable-next-line
export default (theme: Theme) => export default (theme: Theme) =>
createStyles({ createSxStyles({
...sharedStyles(theme), ...sharedStyles(theme),
cardsContainer: { display: 'flex' }, cardsContainer: { display: 'flex' },
gridItem: { display: 'flex', justifyContent: 'center' }, gridItem: { display: 'flex', justifyContent: 'center' },
......
import React from 'react' import React from 'react'
import { ActionType } from '@agiliza/utils/hooks/state' import { ActionType } from '@agiliza/utils/hooks/state'
import { withStyles, WithStyles } from '@material-ui/core/styles' import { useTheme } from '@mui/material/styles'
import { connected, ConnectedProps } from './connect' import { connected, ConnectedProps } from './connect'
import Form from './Form' import Form from './Form'
import { CDAddressState } from './state' import { CDAddressState } from './state'
import styles from './styles' import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles> & ConnectedProps type ExtendedProps = ConnectedProps
interface Props extends ExtendedProps { interface Props extends ExtendedProps {
state: CDAddressState state: CDAddressState
...@@ -16,15 +16,16 @@ interface Props extends ExtendedProps { ...@@ -16,15 +16,16 @@ interface Props extends ExtendedProps {
} }
const Address = (props: Props) => { const Address = (props: Props) => {
const { classes, context, state, actions } = props const { context, state, actions } = props
const styles = useStyles(useTheme())
return ( return (
<div className={classes.contentContainer}> <div style={styles.contentContainer}>
<div className={classes.content}> <div style={styles.content}>
<Form states={context.states} cities={context.cities} state={state} actions={actions} /> <Form states={context.states} cities={context.cities} state={state} actions={actions} />
</div> </div>
</div> </div>
) )
} }
export default connected(withStyles(styles)(Address)) export default connected(Address)
...@@ -5,14 +5,13 @@ import ImageUpload from '@agiliza/components/organisms/ImageUpload' ...@@ -5,14 +5,13 @@ import ImageUpload from '@agiliza/components/organisms/ImageUpload'
import Address, { AddressState } from '@agiliza/components/templates/Address' import Address, { AddressState } from '@agiliza/components/templates/Address'
import { ActionType } from '@agiliza/utils/hooks/state' import { ActionType } from '@agiliza/utils/hooks/state'
import { getBase64FromFile } from '@agiliza/utils/method' import { getBase64FromFile } from '@agiliza/utils/method'
import { withStyles, WithStyles } from '@material-ui/core/styles' import { Box } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import { CDAddressState } from '../state' import { CDAddressState } from '../state'
import styles from './styles' import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles> interface Props {
interface Props extends ExtendedProps {
states: State[] states: State[]
cities: City[] cities: City[]
state: CDAddressState state: CDAddressState
...@@ -20,7 +19,8 @@ interface Props extends ExtendedProps { ...@@ -20,7 +19,8 @@ interface Props extends ExtendedProps {
} }
const Form = (props: Props) => { const Form = (props: Props) => {
const { classes, state, actions, states, cities } = props const { state, actions, states, cities } = props
const styles = useStyles(useTheme())
const { proof } = state const { proof } = state
...@@ -37,11 +37,11 @@ const Form = (props: Props) => { ...@@ -37,11 +37,11 @@ const Form = (props: Props) => {
} }
return ( return (
<form className={classes.form}> <Box component="form" sx={styles.form}>
<ImageUpload label="Comprovante de residência" image={proof} onChangeImage={handleChangeProof} /> <ImageUpload label="Comprovante de residência" image={proof} onChangeImage={handleChangeProof} />
<Address state={state} onChange={handleChangeAddress} states={states} cities={cities} /> <Address state={state} onChange={handleChangeAddress} states={states} cities={cities} />
</form> </Box>
) )
} }
export default withStyles(styles)(Form) export default Form
import { Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { createStyles } from '@material-ui/styles' import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles' import sharedStyles from '../styles'
// eslint-disable-next-line // eslint-disable-next-line
export default (theme: Theme) => { export default (theme: Theme) => {
return createStyles({ return createSxStyles({
...sharedStyles(theme), ...sharedStyles(theme),
switchCardPhotoContainer: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-evenly' }, switchCardPhotoContainer: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-evenly' },
datePicker: { marginBottom: '0px !important' }, datePicker: { marginBottom: '0px !important' },
......
import { Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { createStyles } from '@material-ui/styles' import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles' import sharedStyles from '../styles'
// eslint-disable-next-line // eslint-disable-next-line
export default (theme: Theme) => { export default (theme: Theme) => {
return createStyles({ return createSxStyles({
...sharedStyles(theme), ...sharedStyles(theme),
}) })
} }
import React from 'react' import React from 'react'
import { withStyles, WithStyles } from '@material-ui/core/styles' interface Props {
import styles from './styles'
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {
activeStep: number activeStep: number
} }
const CustomerData = (props: Props) => { const CustomerData = (props: Props) => {
const { classes } = props return <div />
return <div className={classes.stepContentContainer}>{}</div>
} }
export default withStyles(styles)(CustomerData) export default CustomerData
...@@ -7,21 +7,20 @@ import { ActionType } from '@agiliza/utils/hooks/state' ...@@ -7,21 +7,20 @@ import { ActionType } from '@agiliza/utils/hooks/state'
import { extractNumbers, getBase64FromFile } from '@agiliza/utils/method' import { extractNumbers, getBase64FromFile } from '@agiliza/utils/method'
import { SelectField, SelectFieldProps, Switch } from '@curio/components' import { SelectField, SelectFieldProps, Switch } from '@curio/components'
import { import {
Box,
Checkbox, Checkbox,
CheckboxProps, CheckboxProps,
FormControlLabel, FormControlLabel,
FormGroup, FormGroup,
TextField, TextField,
TextFieldProps TextFieldProps
} from '@material-ui/core' } from '@mui/material'
import { withStyles, WithStyles } from '@material-ui/core/styles' import { useTheme } from '@mui/material/styles'
import { CDHomeState } from '../state' import { CDHomeState } from '../state'
import styles from './styles' import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles> interface Props {
interface Props extends ExtendedProps {
addressContext: AuthenticationContext addressContext: AuthenticationContext
state: CDHomeState state: CDHomeState
actions: ActionType<CDHomeState> actions: ActionType<CDHomeState>
...@@ -29,7 +28,9 @@ interface Props extends ExtendedProps { ...@@ -29,7 +28,9 @@ interface Props extends ExtendedProps {
} }
const Form = (props: Props) => { const Form = (props: Props) => {
const { classes, addressContext, context, state, actions } = props const { addressContext, context, state, actions } = props
const styles = useStyles(useTheme())
const { states, cities } = addressContext const { states, cities } = addressContext
const { resideTime, cityResideTime, address, hasProperty, deed, type, deedRecord, reside, hasOnus } = state const { resideTime, cityResideTime, address, hasProperty, deed, type, deedRecord, reside, hasOnus } = state
...@@ -60,7 +61,7 @@ const Form = (props: Props) => { ...@@ -60,7 +61,7 @@ const Form = (props: Props) => {
} }
return ( return (
<form className={classes.form}> <Box component="form" sx={styles.form}>
<Switch label="Possui imóveis?" value={hasProperty} onChange={(vl) => actions.update({ hasProperty: vl })} required /> <Switch label="Possui imóveis?" value={hasProperty} onChange={(vl) => actions.update({ hasProperty: vl })} required />
{hasProperty ? ( {hasProperty ? (
<> <>
...@@ -83,7 +84,7 @@ const Form = (props: Props) => { ...@@ -83,7 +84,7 @@ const Form = (props: Props) => {
variant="outlined" variant="outlined"
shrink={false} shrink={false}
/> />
<FormGroup row className={classes.formGroup}> <FormGroup row sx={styles.formGroup}>
<FormControlLabel <FormControlLabel
control={<Checkbox name="reside" checked={reside} onChange={handleChangeCheckbox('reside')} />} control={<Checkbox name="reside" checked={reside} onChange={handleChangeCheckbox('reside')} />}
label="Reside no imóvel?" label="Reside no imóvel?"
...@@ -110,8 +111,8 @@ const Form = (props: Props) => { ...@@ -110,8 +111,8 @@ const Form = (props: Props) => {
<AddressTemplate states={states} cities={cities} state={address} onChange={(addrs) => actions.update({ address: addrs as IPAddress })} /> <AddressTemplate states={states} cities={cities} state={address} onChange={(addrs) => actions.update({ address: addrs as IPAddress })} />
</> </>
) : null} ) : null}
</form> </Box>
) )
} }
export default withStyles(styles)(Form) export default Form
import { Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { createStyles } from '@material-ui/styles' import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles' import sharedStyles from '../styles'
// eslint-disable-next-line // eslint-disable-next-line
export default (theme: Theme) => { export default (theme: Theme) => {
return createStyles({ return createSxStyles({
...sharedStyles(theme), ...sharedStyles(theme),
switchCardPhotoContainer: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-evenly' }, switchCardPhotoContainer: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-evenly' },
formGroup: { formGroup: {
......
import React from 'react' import React from 'react'
import { ActionType } from '@agiliza/utils/hooks/state' import { ActionType } from '@agiliza/utils/hooks/state'
import { withStyles, WithStyles } from '@material-ui/core/styles' import { useTheme } from '@mui/material/styles'
import { connected, ConnectedProps } from './connect' import { connected, ConnectedProps } from './connect'
import Form from './Form' import Form from './Form'
import { CDHomeState } from './state' import { CDHomeState } from './state'
import styles from './styles' import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles> & ConnectedProps type ExtendedProps = ConnectedProps
interface Props extends ExtendedProps { interface Props extends ExtendedProps {
state: CDHomeState state: CDHomeState
...@@ -16,15 +16,16 @@ interface Props extends ExtendedProps { ...@@ -16,15 +16,16 @@ interface Props extends ExtendedProps {
} }
const Home = (props: Props) => { const Home = (props: Props) => {
const { classes, context, addressContext, state, actions } = props const { context, addressContext, state, actions } = props
const styles = useStyles(useTheme())
return ( return (
<div className={classes.contentContainer}> <div style={styles.contentContainer}>
<div className={classes.content}> <div style={styles.content}>
<Form state={state} actions={actions} addressContext={addressContext} context={context} /> <Form state={state} actions={actions} addressContext={addressContext} context={context} />
</div> </div>
</div> </div>
) )
} }
export default connected(withStyles(styles)(Home)) export default connected(Home)
import { Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { createStyles } from '@material-ui/styles' import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles' import sharedStyles from '../styles'
// eslint-disable-next-line // eslint-disable-next-line
export default (theme: Theme) => { export default (theme: Theme) => {
return createStyles({ return createSxStyles({
...sharedStyles(theme), ...sharedStyles(theme),
}) })
} }
...@@ -5,22 +5,21 @@ import AccountInputsPhoto from '@agiliza/components/templates/AccountInputsPhoto ...@@ -5,22 +5,21 @@ import AccountInputsPhoto from '@agiliza/components/templates/AccountInputsPhoto
import { ActionType } from '@agiliza/utils/hooks/state' import { ActionType } from '@agiliza/utils/hooks/state'
import CPFCNPJField from '@agiliza/views/ProposalData/components/atoms/CPFCNPJField' import CPFCNPJField from '@agiliza/views/ProposalData/components/atoms/CPFCNPJField'
import { SelectField, SelectFieldProps } from '@curio/components' import { SelectField, SelectFieldProps } from '@curio/components'
import { FormControlLabel, Switch, TextField, TextFieldProps } from '@material-ui/core' import { Box, FormControlLabel, Switch, TextField, TextFieldProps } from '@mui/material'
import { withStyles, WithStyles } from '@material-ui/core/styles' import { useTheme } from '@mui/material/styles'
import { CDIdentificationState } from '../state' import { CDIdentificationState } from '../state'
import styles from './styles' import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles> interface Props {
interface Props extends ExtendedProps {
state: CDIdentificationState state: CDIdentificationState
actions: ActionType<CDIdentificationState> actions: ActionType<CDIdentificationState>
context: ProposalDataContext context: ProposalDataContext
} }
const Form = (props: Props) => { const Form = (props: Props) => {
const { classes, state, actions, context } = props const { state, actions, context } = props
const styles = useStyles(useTheme())
const { cpfcnpj, dataType, name, gender, hasAccount, account } = state const { cpfcnpj, dataType, name, gender, hasAccount, account } = state
...@@ -54,7 +53,7 @@ const Form = (props: Props) => { ...@@ -54,7 +53,7 @@ const Form = (props: Props) => {
const handleChangeValidState = (vldStt: boolean) => {} const handleChangeValidState = (vldStt: boolean) => {}
return ( return (
<form className={classes.form}> <Box component="form" sx={styles.form}>
<SelectField <SelectField
id="framework-select-field" id="framework-select-field"
label="Enquadramento" label="Enquadramento"
...@@ -75,7 +74,7 @@ const Form = (props: Props) => { ...@@ -75,7 +74,7 @@ const Form = (props: Props) => {
variant="outlined" variant="outlined"
shrink={false} shrink={false}
/> />
<div className={classes.switchCardPhotoContainer}> <div style={styles.switchCardPhotoContainer}>
<FormControlLabel <FormControlLabel
label="Possui conta na entidade?" label="Possui conta na entidade?"
control={ control={
...@@ -96,8 +95,8 @@ const Form = (props: Props) => { ...@@ -96,8 +95,8 @@ const Form = (props: Props) => {
/> />
) : null} ) : null}
</div> </div>
</form> </Box>
) )
} }
export default withStyles(styles)(Form) export default Form
import { Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { createStyles } from '@material-ui/styles' import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles' import sharedStyles from '../styles'
// eslint-disable-next-line // eslint-disable-next-line
export default (theme: Theme) => { export default (theme: Theme) => {
return createStyles({ return createSxStyles({
...sharedStyles(theme), ...sharedStyles(theme),
switchCardPhotoContainer: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-evenly' }, switchCardPhotoContainer: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-evenly' },
}) })
......
import React from 'react' import React from 'react'
import { ActionType } from '@agiliza/utils/hooks/state' import { ActionType } from '@agiliza/utils/hooks/state'
import { withStyles, WithStyles } from '@material-ui/core/styles' import { useTheme } from '@mui/material/styles'
import { connected, ConnectedProps } from './connect' import { connected, ConnectedProps } from './connect'
import Form from './Form' import Form from './Form'
import { CDIdentificationState } from './state' import { CDIdentificationState } from './state'
import styles from './styles' import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles> & ConnectedProps type ExtendedProps = ConnectedProps
interface Props extends ExtendedProps { interface Props extends ExtendedProps {
state: CDIdentificationState state: CDIdentificationState
...@@ -16,16 +16,16 @@ interface Props extends ExtendedProps { ...@@ -16,16 +16,16 @@ interface Props extends ExtendedProps {
} }
const Identification = (props: Props) => { const Identification = (props: Props) => {
const { classes, context, state, actions } = props const { context, state, actions } = props
const styles = useStyles(useTheme())
return ( return (
<div className={classes.contentContainer}> <div style={styles.contentContainer}>
<div className={classes.content}> <div style={styles.content}>
<Form context={context} state={state} actions={actions} /> <Form context={context} state={state} actions={actions} />
</div> </div>
</div> </div>
) )
} }
export default connected(withStyles(styles)(Identification)) export default connected(Identification)
import { Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { createStyles } from '@material-ui/styles' import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles' import sharedStyles from '../styles'
// eslint-disable-next-line // eslint-disable-next-line
export default (theme: Theme) => { export default (theme: Theme) => {
return createStyles({ return createSxStyles({
...sharedStyles(theme), ...sharedStyles(theme),
}) })
} }
...@@ -6,22 +6,21 @@ import RGTemplate from '@agiliza/components/templates/RGTemplate' ...@@ -6,22 +6,21 @@ import RGTemplate from '@agiliza/components/templates/RGTemplate'
import { ActionType } from '@agiliza/utils/hooks/state' import { ActionType } from '@agiliza/utils/hooks/state'
import { maskLandline } from '@agiliza/utils/masks' import { maskLandline } from '@agiliza/utils/masks'
import { DatePicker, SelectField, SelectFieldProps, Switch } from '@curio/components' import { DatePicker, SelectField, SelectFieldProps, Switch } from '@curio/components'
import { TextField, TextFieldProps } from '@material-ui/core' import { Box, TextField, TextFieldProps } from '@mui/material'
import { withStyles, WithStyles } from '@material-ui/core/styles' import { useTheme } from '@mui/material/styles'
import { CDPersonalDataState } from '../state' import { CDPersonalDataState } from '../state'
import styles from './styles' import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles> interface Props {
interface Props extends ExtendedProps {
state: CDPersonalDataState state: CDPersonalDataState
actions: ActionType<CDPersonalDataState> actions: ActionType<CDPersonalDataState>
context: ProposalDataContext context: ProposalDataContext
} }
const Form = (props: Props) => { const Form = (props: Props) => {
const { classes, state, actions, context } = props const { state, actions, context } = props
const styles = useStyles(useTheme())
const { const {
birthday, birthday,
...@@ -39,8 +38,8 @@ const Form = (props: Props) => { ...@@ -39,8 +38,8 @@ const Form = (props: Props) => {
landline, landline,
} = state } = state
const handleChangeDate = (type: keyof Pick<CDPersonalDataState, 'birthday'>) => (date: Date | null) => { const handleChangeDate = (type: keyof Pick<CDPersonalDataState, 'birthday'>) => (date: unknown) => {
actions.update({ [type]: date }) actions.update({ [type]: date as Date })
} }
const handleChangeText = const handleChangeText =
...@@ -60,15 +59,8 @@ const Form = (props: Props) => { ...@@ -60,15 +59,8 @@ const Form = (props: Props) => {
} }
return ( return (
<form className={classes.form}> <Box component="form" sx={styles.form}>
<DatePicker <DatePicker id="birthday" label="Data de nascimento" value={birthday} onChange={handleChangeDate('birthday')} sx={styles.datePicker} />
id="birthday"
label="Data de nascimento"
value={birthday}
onChange={handleChangeDate('birthday')}
format="dd/MM/yyyy"
className={classes.datePicker}
/>
<RGTemplate rg={rg} onChange={handleChangeRG} /> <RGTemplate rg={rg} onChange={handleChangeRG} />
<Switch label="Usuário CRAS?" required value={userCRAS} onChange={(value) => actions.update({ userCRAS: value })} /> <Switch label="Usuário CRAS?" required value={userCRAS} onChange={(value) => actions.update({ userCRAS: value })} />
<TextField variant="outlined" label="Nome da mãe" value={mothersName} onChange={handleChangeText('mothersName')} /> <TextField variant="outlined" label="Nome da mãe" value={mothersName} onChange={handleChangeText('mothersName')} />
...@@ -103,8 +95,8 @@ const Form = (props: Props) => { ...@@ -103,8 +95,8 @@ const Form = (props: Props) => {
onChange={handleChangeText('landline')} onChange={handleChangeText('landline')}
inputProps={{ maxLength: 14 }} inputProps={{ maxLength: 14 }}
/> />
</form> </Box>
) )
} }
export default withStyles(styles)(Form) export default Form
import { Theme } from '@material-ui/core/styles' import { createSxStyles } from '@agiliza/theme'
import { createStyles } from '@material-ui/styles' import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles' import sharedStyles from '../styles'
// eslint-disable-next-line // eslint-disable-next-line
export default (theme: Theme) => { export default (theme: Theme) => {
return createStyles({ return createSxStyles({
...sharedStyles(theme), ...sharedStyles(theme),
switchCardPhotoContainer: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-evenly' }, switchCardPhotoContainer: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-evenly' },
......
import React from 'react' import React from 'react'
import { ActionType } from '@agiliza/utils/hooks/state' import { ActionType } from '@agiliza/utils/hooks/state'
import { withStyles, WithStyles } from '@material-ui/core/styles' import { useTheme } from '@mui/material/styles'
import { connected, ConnectedProps } from './connect' import { connected, ConnectedProps } from './connect'
import Form from './Form' import Form from './Form'
import { CDPersonalDataState } from './state' import { CDPersonalDataState } from './state'
import styles from './styles' import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles> & ConnectedProps type ExtendedProps = ConnectedProps
interface Props extends ExtendedProps { interface Props extends ExtendedProps {
state: CDPersonalDataState state: CDPersonalDataState
...@@ -16,15 +16,16 @@ interface Props extends ExtendedProps { ...@@ -16,15 +16,16 @@ interface Props extends ExtendedProps {
} }
const PersonalData = (props: Props) => { const PersonalData = (props: Props) => {
const { classes, context, state, actions } = props const { context, state, actions } = props
const styles = useStyles(useTheme())
return ( return (
<div className={classes.contentContainer}> <div style={styles.contentContainer}>
<div className={classes.content}> <div style={styles.content}>
<Form context={context} state={state} actions={actions} /> <Form context={context} state={state} actions={actions} />
</div> </div>
</div> </div>
) )
} }
export default connected(withStyles(styles)(PersonalData)) export default connected(PersonalData)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment