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"
"@dynamo:registry" "https://nexus.dev.evologica.com.br/repository/npm"
\ No newline at end of file
......@@ -21,8 +21,8 @@
[
"babel-plugin-import",
{
"libraryName": "@material-ui/core",
"libraryDirectory": "esm",
"libraryName": "@mui/material",
"libraryDirectory": "",
"camel2DashComponentName": false
},
"core"
......@@ -30,20 +30,20 @@
[
"babel-plugin-import",
{
"libraryName": "@material-ui/lab",
"libraryDirectory": "esm",
"libraryName": "@mui/icons-material",
"libraryDirectory": "",
"camel2DashComponentName": false
},
"lab"
"icons"
],
[
"babel-plugin-import",
{
"libraryName": "@material-ui/icons",
"libraryDirectory": "esm",
"libraryName": "@mui/lab",
"libraryDirectory": "",
"camel2DashComponentName": false
},
"icons"
"lab"
],
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-proposal-nullish-coalescing-operator",
......
......@@ -80,17 +80,19 @@
},
"dependencies": {
"@curio/client": "1.3.3",
"@curio/components": "^0.1.6",
"@curio/components": "^1.0.3",
"@curio/ui": "^0.1.0",
"@date-io/date-fns": "^1.0.0",
"@dynamo/components": "0.70.1",
"@dynamo/curio": "0.70.1",
"@dynamo/material-ui": "0.70.1",
"@material-ui/core": "4.11.4",
"@material-ui/icons": "^4.11.2",
"@material-ui/lab": "4.0.0-alpha.58",
"@material-ui/pickers": "^3.3.10",
"@emotion/react": "^11.4.1",
"@emotion/styled": "^11.3.0",
"@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",
"@types/react-swipeable-views": "^0.13.1",
"@types/react-swipeable-views-utils": "^0.13.3",
......@@ -103,8 +105,8 @@
"deepmerge": "^4.2.2",
"normalizr": "^3.6.1",
"p-min-delay": "^4.0.0",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"react": "^17.0.0",
"react-dom": "^17.0.0",
"react-loading-skeleton": "^2.0.1",
"react-redux": "^7.2.0",
"react-router": "5.2.0",
......
......@@ -21,3 +21,12 @@ export interface CreditInstallment extends Entity {
export interface CreditGracePeriod extends Entity {
description: string
}
interface OutputGetVisitContext {
gracePeriods: CreditGracePeriod
}
export interface GetVisitContext {
Input: void
Output: OutputGetVisitContext
}
import React from 'react'
import { Button, LinearProgress } from '@material-ui/core'
import { ButtonProps } from '@material-ui/core/Button'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { Button, LinearProgress } from '@mui/material'
import { ButtonProps } from '@mui/material/Button'
import { styles } from './styles'
type ExtendedTypes = WithStyles<typeof styles> &
Pick<ButtonProps, 'disabled' | 'onClick' | 'type' | 'children' | 'className' | 'color' | 'size' | 'variant'>
type ExtendedTypes = Pick<ButtonProps, 'disabled' | 'onClick' | 'type' | 'children' | 'sx' | 'color' | 'size' | 'variant'>
interface Props extends ExtendedTypes {
fetching?: boolean
}
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 (
<Button className={className} disabled={disabled || fetching} onClick={onClick} variant={variant} color={color} type={type} size={size}>
{fetching && <LinearProgress className={classes.progress} />}
<Button sx={sx} disabled={disabled || fetching} onClick={onClick} variant={variant} color={color} type={type} size={size}>
{fetching && <LinearProgress sx={styles.progress} />}
{children}
</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) => {
return createStyles({
progress: {
bottom: 0,
margin: 0,
width: '100%',
position: 'absolute'
}
})
}
export const styles = createSxStyles({
progress: {
bottom: 0,
margin: 0,
width: '100%',
position: 'absolute',
},
})
import React from 'react'
import ListItem from '@material-ui/core/ListItem'
import ListItemIcon from '@material-ui/core/ListItemIcon'
import ListItemText from '@material-ui/core/ListItemText'
import ListItem, { ListItemProps } from '@mui/material/ListItem'
import ListItemIcon from '@mui/material/ListItemIcon'
import ListItemText from '@mui/material/ListItemText'
interface Props {
label: string
className?: string
sx?: ListItemProps['sx']
children: React.ReactElement
onClick?: () => void
}
const ItemWithIcon = (props: Props) => {
const { className, label, children, onClick } = props
const { sx, label, children, onClick } = props
return (
<ListItem button className={className} onClick={onClick}>
<ListItem button sx={sx} onClick={onClick}>
<ListItemIcon>{children}</ListItemIcon>
<ListItemText primary={label} />
</ListItem>
......
import React, { useState } from 'react'
import InputAdornment from '@material-ui/core/InputAdornment'
import TextField, { TextFieldProps } from '@material-ui/core/TextField'
import Visibility from '@material-ui/icons/Visibility'
import VisibilityOff from '@material-ui/icons/VisibilityOff'
import withStyles, { WithStyles } from '@material-ui/styles/withStyles'
import Visibility from '@mui/icons-material/Visibility'
import VisibilityOff from '@mui/icons-material/VisibilityOff'
import InputAdornment from '@mui/material/InputAdornment'
import TextField, { TextFieldProps } from '@mui/material/TextField'
import styles from './styles'
type BaseProps = WithStyles<typeof styles> &
Pick<TextFieldProps, 'value' | 'onChange' | 'required' | 'label' | 'type' | 'className' | 'InputProps' | 'autoFocus' | 'inputProps'>
type BaseProps = Pick<TextFieldProps, 'value' | 'onChange' | 'required' | 'label' | 'type' | 'sx' | 'InputProps' | 'autoFocus' | 'inputProps'>
interface Props extends BaseProps {}
const TextFieldWithIcon = (props: Props) => {
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 (
<TextField
autoFocus={autoFocus}
......@@ -23,14 +21,14 @@ const TextFieldWithIcon = (props: Props) => {
value={value}
onChange={onChange}
label={label}
className={className}
sx={sx}
variant="outlined"
type={type === 'password' ? (isPasswordVisible ? undefined : type) : type}
InputProps={
InputProps || {
startAdornment:
type === 'password' ? (
<InputAdornment position="start" onClick={() => setIsPasswordVisible(!isPasswordVisible)} className={classes.inputAdorment}>
<InputAdornment position="start" onClick={() => setIsPasswordVisible(!isPasswordVisible)} sx={styles.inputAdorment}>
{isPasswordVisible ? <Visibility /> : <VisibilityOff />}
</InputAdornment>
) : null,
......@@ -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) =>
createStyles({
inputAdorment: {
cursor: 'pointer'
}
})
export default createSxStyles({
inputAdorment: {
cursor: 'pointer',
},
})
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'
......@@ -8,14 +10,15 @@ export interface ToolbarProps {
title?: React.ReactNode
actions?: React.ReactNode
nav?: React.ReactNode
sx?: MuiToolbarProps['sx']
}
export function Toolbar({ nav, title, actions }: ToolbarProps) {
const classes = useStyles()
export function Toolbar({ nav, title, actions, sx }: ToolbarProps) {
const styles = useStyles(useTheme())
return (
<MuiToolbar>
<div className={classes.nav}>{nav}</div>
{title ? <div className={classes.grow}>{title}</div> : <div className={classes.grow} />}
<Box sx={styles.nav}>{nav}</Box>
{title ? <Box sx={styles.grow}>{title}</Box> : <Box sx={styles.grow} />}
{actions}
</MuiToolbar>
)
......
import cn from 'classnames'
import deepmerge from 'deepmerge'
import React, { useState } from 'react'
import { Collapse, CollapseProps, Fade } from '@material-ui/core'
import MuiAppBar, { AppBarProps as MuiAppBarProps } from '@material-ui/core/AppBar'
import { createStyles, makeStyles, Theme } from '@material-ui/core/styles'
import { createSxStyles } from '@agiliza/theme'
import { Box, Collapse, CollapseProps, Fade } from '@mui/material'
import MuiAppBar, { AppBarProps as MuiAppBarProps } from '@mui/material/AppBar'
import { Theme, useTheme } from '@mui/material/styles'
import { Toolbar, ToolbarProps } from './Toolbar'
const useStyles = makeStyles((theme: Theme) =>
createStyles({
const useStyles = (theme: Theme) =>
createSxStyles({
appBar: {
// position: 'fixed',
...theme.mixins.toolbar,
......@@ -21,21 +22,19 @@ const useStyles = makeStyles((theme: Theme) =>
width: '100%',
},
})
)
type BaseType = Omit<ToolbarProps, 'classes' | 'nav'>
export interface AppBarProps extends BaseType {
className?: string
position?: MuiAppBarProps['position']
children?: React.ReactNode
onNavClick?(event: React.MouseEvent<HTMLButtonElement, MouseEvent>): void
style?: MuiAppBarProps['style']
}
const AppBar = ({ className, position = 'static', actions, title, children, onNavClick, style }: AppBarProps) => {
const classes = useStyles()
const AppBar = ({ sx, position = 'static', actions, title, children, onNavClick, style }: AppBarProps) => {
const [fadeIn, setFadeIn] = useState(false)
const styles = useStyles(useTheme())
const onCollapse: CollapseProps['onEntered'] = (el, isAppearing) => {
setFadeIn(isAppearing)
......@@ -48,13 +47,13 @@ const AppBar = ({ className, position = 'static', actions, title, children, onNa
// ) : null
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}*/ />
{children && (
<Collapse appear enter in onEntered={onCollapse} timeout={400}>
<div>
<Fade in={fadeIn} enter timeout={600}>
<div className={classes.content}>{children}</div>
<Box sx={styles.content}>{children}</Box>
</Fade>
</div>
</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) =>
createStyles({
export const useStyles = (theme: Theme) =>
createSxStyles({
grow: {
flexGrow: 1,
},
......@@ -9,4 +10,3 @@ export const useStyles = makeStyles((theme: Theme) =>
marginRight: theme.spacing(2),
},
})
)
import cn from 'classnames'
import deepmerge from 'deepmerge'
import React from 'react'
import CircularProgressMUI from '@material-ui/core/CircularProgress'
import Container from '@material-ui/core/Container'
import Box from '@mui/material/Box'
import CircularProgressMUI from '@mui/material/CircularProgress'
import { useStyles } from './styles'
import { styles } from './styles'
interface Props {
className?: string
......@@ -12,13 +12,10 @@ interface Props {
}
const CircularProgress = (props: Props) => {
const classes = useStyles()
return (
<Container
className={cn(classes.container, { [classes.allContainer]: props.root })}
>
<Box sx={deepmerge(styles.container, props.root ? styles.allContainer : {})}>
<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) =>
createStyles({
container: {
display: 'flex',
flex: 1,
justifyContent: 'center',
alignItems: 'center'
},
allContainer: {
height: '100vh'
}
})
)
export const styles = createSxStyles({
container: {
display: 'flex',
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
allContainer: {
height: '100vh',
},
})
import React from 'react'
import IconButton from '@material-ui/core/IconButton'
import ListItemText from '@material-ui/core/ListItemText'
import Menu from '@material-ui/core/Menu'
import MenuItem from '@material-ui/core/MenuItem'
import { MoreVert as ContextIconVertical } from '@material-ui/icons'
import { MoreVert as ContextIconVertical } from '@mui/icons-material'
import IconButton from '@mui/material/IconButton'
import ListItemText from '@mui/material/ListItemText'
import Menu from '@mui/material/Menu'
import MenuItem from '@mui/material/MenuItem'
export interface ContextItem {
icon?: React.ReactElement
......@@ -38,23 +39,10 @@ export default function ContextButton({ menuId, disabled, menuItems, className,
return (
<>
<IconButton
disabled={disabled}
className={className}
aria-controls={menuId}
aria-haspopup="true"
onClick={handleClick}
>
<IconButton disabled={disabled} className={className} aria-controls={menuId} aria-haspopup="true" onClick={handleClick}>
<ContextIconVertical />
</IconButton>
<Menu
id={menuId}
anchorEl={anchorEl}
keepMounted
open={Boolean(anchorEl)}
onClose={handleClose}
className={menuClassName}
>
<Menu id={menuId} anchorEl={anchorEl} keepMounted open={Boolean(anchorEl)} onClose={handleClose} className={menuClassName}>
{menuItems.map((item, index) => (
<MenuItem key={index} onClick={(e) => handleItemClick(e, item)}>
{/* <ListItemIcon>{item.icon}</ListItemIcon> */}
......
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 { IconButton } from '@material-ui/core'
import Dialog from '@material-ui/core/Dialog'
import DialogActions from '@material-ui/core/DialogActions'
// import Toolbar from '@material-ui/core/Toolbar'
// import IconButton from '@material-ui/core/IconButton'
import DialogContent from '@material-ui/core/DialogContent'
import DialogTitle from '@material-ui/core/DialogTitle'
import Slide from '@material-ui/core/Slide'
import { TransitionProps } from '@material-ui/core/transitions/transition'
import CloseIcon from '@material-ui/icons/Close'
import CloseIcon from '@mui/icons-material/Close'
import { IconButton } from '@mui/material'
import Dialog from '@mui/material/Dialog'
import DialogActions from '@mui/material/DialogActions'
// import Toolbar from '@mui/material/Toolbar'
// import IconButton from '@mui/material/IconButton'
import DialogContent from '@mui/material/DialogContent'
import DialogTitle from '@mui/material/DialogTitle'
import Slide from '@mui/material/Slide'
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(
props: TransitionProps & { children?: React.ReactElement<any, any> },
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) =>
createStyles({
createSxStyles({
appBar: { position: 'relative' },
title: {
marginLeft: theme.spacing(2),
flex: 1
}
flex: 1,
},
})
import cn from 'classnames'
import deepmerge from 'deepmerge'
import React from 'react'
import { RouteComponentProps } from 'react-router'
import logo from '@agiliza/public/images/logo.svg'
import { actions as loginActions } from '@agiliza/redux/ui/login'
import Divider from '@material-ui/core/Divider'
import MUIDrawer from '@material-ui/core/Drawer'
import { ListItemProps } from '@mui/material'
import Divider from '@mui/material/Divider'
import MUIDrawer from '@mui/material/Drawer'
import { useTheme } from '@mui/material/styles'
import { useStyles } from './styles'
type ExtendedTypes = RouteComponentProps
interface DrawerItemsProps extends ExtendedTypes {
listItemClassName?: string
sx: ListItemProps['sx']
toggleDrawer: () => void
logout: Props['logout']
}
......@@ -28,30 +30,29 @@ export interface Props extends BaseProps {
const Drawer = (props: Props) => {
const { drawerOpen, toggleDrawer, Items, logout, ...routeProps } = props
const classes = useStyles()
const styles = useStyles(useTheme())
return (
<MUIDrawer
variant="temporary"
open={drawerOpen}
className={cn(classes.drawer, {
[classes.drawerOpen]: drawerOpen,
[classes.drawerClose]: !drawerOpen,
})}
classes={{
paper: cn(classes.drawer, {
[classes.drawerOpen]: drawerOpen,
[classes.drawerClose]: !drawerOpen,
}),
sx={deepmerge(styles.drawer, drawerOpen ? styles.drawerOpen : styles.drawerClose)}
// classes={{
// paper: cn(classes.drawer, {
// [classes.drawerOpen]: drawerOpen,
// [classes.drawerClose]: !drawerOpen,
// }),
// }}
PaperProps={{
sx: deepmerge(styles.drawer, drawerOpen ? styles.drawerOpen : styles.drawerClose),
}}
onBackdropClick={() => toggleDrawer()}
>
<div className={classes.header}>
<img src={logo} className={classes.headerLogo} alt="Camedics Logo" />
<div style={styles.header}>
<img src={logo} style={styles.headerLogo} alt="Camedics Logo" />
</div>
<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} /> */}
{/* <div className={classes.grow} /> */}
{/* <Divider /> */}
......
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 hover = '&:hover'
return createStyles({
return createSxStyles({
grow: {
flexGrow: 1,
},
......@@ -87,4 +88,4 @@ export const useStyles = makeStyles((theme: Theme) => {
},
headerLogo: { width: 100, height: 'auto' },
})
})
}
......@@ -4,15 +4,12 @@ import { bindActionCreators, Dispatch } from 'redux'
import { StoreState } from '@agiliza/redux'
import { actions as errorActions, selectors, State as ErrorState } from '@agiliza/redux/ui/error'
import Button from '@material-ui/core/Button'
import Dialog from '@material-ui/core/Dialog'
import DialogActions from '@material-ui/core/DialogActions'
import DialogContent from '@material-ui/core/DialogContent'
import DialogContentText from '@material-ui/core/DialogContentText'
import DialogTitle from '@material-ui/core/DialogTitle'
import { withStyles } from '@material-ui/styles'
import { styles } from './styles'
import Button from '@mui/material/Button'
import Dialog from '@mui/material/Dialog'
import DialogActions from '@mui/material/DialogActions'
import DialogContent from '@mui/material/DialogContent'
import DialogContentText from '@mui/material/DialogContentText'
import DialogTitle from '@mui/material/DialogTitle'
interface Props {
error: ErrorState['error']
......@@ -60,4 +57,4 @@ const mapDispatchToProps = (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 Popover from '@material-ui/core/Popover'
import Typography from '@material-ui/core/Typography'
import InfoIcon from '@material-ui/icons/InfoRounded'
import { WithStyles, withStyles } from '@material-ui/styles'
import InfoIcon from '@mui/icons-material/InfoRounded'
import Popover from '@mui/material/Popover'
import { useTheme } from '@mui/material/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 {
key: string
......@@ -16,10 +16,11 @@ interface PopItem {
}
const PopoverVersion = (props: Props) => {
const { classes } = props
const [popItems] = useState<PopItem[]>([])
const [anchor, setAnchor] = useState<HTMLDivElement | null>(null)
const styles = useStyles(useTheme())
// useEffect(() => {
// let items: PopItem[] = [{ key: 'Versão', value: VERSION }]
// if (service) {
......@@ -35,16 +36,16 @@ const PopoverVersion = (props: Props) => {
const createPopItems = (items: PopItem[]) =>
items.map((item, i) => (
<Typography className={classes.msg} color="textPrimary" key={i}>
<Typography sx={styles.msg} color="textPrimary" key={i} component="span">
{`${item.key}: `}
{<span style={{ textDecoration: item.underline ? 'underline' : undefined }}>{item.value || ''}</span>}
</Typography>
))
return (
<div className={classes.root}>
<div style={styles.root}>
<div onClick={(evt) => setAnchor(evt.currentTarget)}>
<InfoIcon className={classes.infoBtn} color="primary" />
<InfoIcon sx={styles.infoBtn} color="primary" />
</div>
<Popover
id="version-popover"
......@@ -60,9 +61,9 @@ const PopoverVersion = (props: Props) => {
horizontal: 'right',
}}
>
<div className={classes.popoverContent}>{createPopItems(popItems)}</div>
<div style={styles.popoverContent}>{createPopItems(popItems)}</div>
</Popover>
</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) =>
createStyles({
export const useStyles = (theme: Theme) =>
createSxStyles({
root: { position: 'fixed', bottom: theme.spacing(5), right: theme.spacing(5) },
popoverContent: { padding: theme.spacing(1.5) },
msg: {
......
import cn from 'classnames'
import deepmerge from 'deepmerge'
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) => ({
card: {
// backgroundColor: '#fafafa',
height: 100,
width: 175,
padding: theme.spacing(1),
border: '1px solid #dfdfdf',
borderRadius: '10px',
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
// color: theme.palette.grey[500],
transform: 'scale(1)',
transition: theme.transitions.create(['color', 'border', 'transform'], {
duration: theme.transitions.duration.short,
}),
'&:hover': {
transform: 'scale(1.03)',
color: theme.palette.primary.main,
borderColor: theme.palette.primary.main,
cursor: 'pointer',
border: `1px solid ${theme.palette.primary.main}`,
const useStyles = (theme: Theme) =>
createSxStyles({
card: {
// backgroundColor: '#fafafa',
height: '100px',
width: '175px',
padding: theme.spacing(1),
border: '1px solid #dfdfdf',
borderRadius: '10px',
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
// color: theme.palette.grey[500],
transform: 'scale(1)',
transition: theme.transitions.create(['color', 'border', 'transform'], {
duration: theme.transitions.duration.short,
}),
'&:hover': {
transform: 'scale(1.03)',
color: theme.palette.primary.main,
borderColor: theme.palette.primary.main,
cursor: 'pointer',
border: `1px solid ${theme.palette.primary.main}`,
},
},
},
cardIcon: {
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
},
cardDescription: {
textAlign: 'center',
},
}))
cardIcon: {
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
},
cardDescription: {
textAlign: 'center',
},
})
export interface DashboardCardProps {
label: string
icon: React.ReactNode
className?: string
style?: React.CSSProperties
onClick?(): void
}
function DashboardCard(props: DashboardCardProps) {
const classes = useStyles()
const styles = useStyles(useTheme())
return (
<div onClick={props.onClick} className={cn(classes.card, props.className)}>
<div className={classes.cardIcon}>{props.icon}</div>
<div className={classes.cardDescription}>{props.label}</div>
<div onClick={props.onClick} style={deepmerge(styles.card, props.style || {})}>
<div style={styles.cardIcon}>{props.icon}</div>
<div style={styles.cardDescription}>{props.label}</div>
</div>
)
}
......
import cn from 'classnames'
import deepmerge from 'deepmerge'
import React from 'react'
import { Button } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { PhotoCamera as PhotoCameraIcon } from '@material-ui/icons'
import { PhotoCamera as PhotoCameraIcon } from '@mui/icons-material'
import { Button, ButtonProps } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {
interface Props {
image?: string
onChangeImage: React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>['onChange']
label: string
imageStyle?: React.HTMLAttributes<HTMLDivElement>['style']
className?: string
buttonClassName?: string
style?: React.CSSProperties
sx?: ButtonProps['sx']
}
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 (
<div className={cn(className, classes.container)}>
<Button variant="text" component="label" className={cn(classes.photoBtn, buttonClassName)} classes={{ label: classes.photoLabelBtn }}>
<div style={deepmerge(style || {}, styles.container)}>
{/* <Button variant="text" sx={deepmerge(styles.photoBtn, sx || {})} > */}
<Button variant="text" component="label" sx={deepmerge(styles.photoBtn, sx || {})}>
{image ? (
<div className={classes.card} style={imageStyle}>
<img src={'data:image/png;base64,' + image} className={classes.media} />
<div style={deepmerge(styles.card, imageStyle)}>
<img src={'data:image/png;base64,' + image} style={styles.media} />
</div>
) : (
<PhotoCameraIcon />
......@@ -44,4 +46,4 @@ const ImageUpload = (props: Props) => {
)
}
export default withStyles(styles)(ImageUpload)
export default ImageUpload
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
export default (theme: Theme) =>
createSxStyles({
container: { width: '100%', textAlign: 'center', marginTop: theme.spacing(1), marginBottom: theme.spacing(1) },
photoBtn: { width: '100%' },
photoLabelBtn: { display: 'flex', flexDirection: 'column', height: '280px', alignItems: 'center', flexGrow: 1 },
photoBtn: { width: '100%', '&.MuiButton-text': { display: 'flex', flexDirection: 'column', height: '280px', alignItems: 'center', flexGrow: 1 } },
card: { width: '100%', maxWidth: '100%', height: '100%', textAlign: 'center' },
media: {
height: '230px',
......@@ -15,4 +14,3 @@ export default (theme: Theme) => {
// paddingTop: '56.25%', // 16:9
},
})
}
import React from 'react'
import { maskPhone } from '@agiliza/utils/masks'
import { TextField, TextFieldProps } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { TextField, TextFieldProps } from '@mui/material'
import styles from './styles'
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {
interface Props {
value?: string
onChange: TextFieldProps['onChange']
label?: string
......@@ -19,4 +14,4 @@ const PhoneField = (props: Props) => {
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 { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({})
}
export default createSxStyles({})
import React from 'react'
import { SvgIcon } from '@material-ui/core'
import { SvgIcon } from '@mui/material'
interface Props {}
......
import React from 'react'
import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'
import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'
interface Props extends SvgIconProps {}
......
import React from 'react'
import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'
import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'
interface Props extends SvgIconProps {}
......
import React from 'react'
import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'
import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'
interface Props extends SvgIconProps {}
......
import React from 'react'
import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'
import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'
interface Props extends SvgIconProps {}
......@@ -9,7 +10,7 @@ export default (props: Props) => {
{...props}
style={{
width: 21,
height: 21
height: 21,
}}
viewBox="0 0 21 21"
>
......
import React from 'react'
import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon'
import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'
interface Props extends SvgIconProps {}
......@@ -9,7 +10,7 @@ export default (props: Props) => {
{...props}
style={{
width: 21,
height: 21
height: 21,
}}
viewBox="0 0 21 21"
>
......
......@@ -3,14 +3,11 @@ import React from 'react'
import { BanestesAccount } from '@agiliza/api/domain'
import ImageUpload from '@agiliza/components/organisms/ImageUpload'
import { extractNumbers, getBase64FromFile } from '@agiliza/utils/method'
import { TextField, TextFieldProps } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { TextField, TextFieldProps } from '@mui/material'
import styles from './styles'
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {
interface Props {
values: BanestesAccount
onChanges: {
account: (type: keyof BanestesAccount) => TextFieldProps['onChange']
......@@ -20,7 +17,7 @@ interface Props extends ExtendedProps {
}
const AccountInputsPhoto = (props: Props) => {
const { classes, values, onChanges } = props
const { values, onChanges } = props
const { agencyNumber, cardPicture, number } = values
const handleChangeField = (type: keyof BanestesAccount): TextFieldProps['onChange'] => onChanges.account(type)
......@@ -34,8 +31,8 @@ const AccountInputsPhoto = (props: Props) => {
}
return (
<div className={classes.accountInputsPhotoContainer}>
<div className={classes.accountInputsContainer}>
<div style={styles.accountInputsPhotoContainer}>
<div style={styles.accountInputsContainer}>
<TextField
label="Número da agência"
value={extractNumbers(agencyNumber) || ''}
......@@ -49,4 +46,4 @@ const AccountInputsPhoto = (props: Props) => {
)
}
export default withStyles(styles)(AccountInputsPhoto)
export default AccountInputsPhoto
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
accountInputsPhotoContainer: { width: '100%', height: '100%' },
accountInputsContainer: { height: '100%' },
photoBtn: { minWidth: '50%' },
photoLabelBtn: { display: 'flex', flexDirection: 'column', height: '280px', alignItems: 'center', flexGrow: 1 },
card: { width: 'auto', height: 'auto' },
media: {
height: '250px',
width: 'auto',
// paddingTop: '56.25%', // 16:9
},
})
}
export default createSxStyles({
accountInputsPhotoContainer: { width: '100%', height: '100%' },
accountInputsContainer: { height: '100%' },
photoBtn: { minWidth: '50%' },
photoLabelBtn: { display: 'flex', flexDirection: 'column', height: '280px', alignItems: 'center', flexGrow: 1 },
card: { width: 'auto', height: 'auto' },
media: {
height: '250px',
width: 'auto',
// paddingTop: '56.25%', // 16:9
},
})
......@@ -3,15 +3,13 @@ import React, { useMemo } from 'react'
import { City, State } from '@agiliza/api/domain'
import { maskCEP } from '@agiliza/utils/masks'
import { SelectField, SelectFieldProps } from '@curio/components'
import { TextField, TextFieldProps } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { TextField, TextFieldProps } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import { AddressState } from './state'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {
interface Props {
states: State[]
cities: City[]
state: AddressState
......@@ -19,7 +17,8 @@ interface Props extends ExtendedProps {
}
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
......@@ -54,7 +53,8 @@ const Address = (props: Props) => {
onChange={handleChangeSelect('state')}
items={states.map((st) => ({ label: st.name, value: st.id }))}
shrink={false}
className={classes.selectField}
// sx={classes.selectField}
sx={styles.selectField}
/>
<SelectField
id="state-select"
......@@ -65,11 +65,11 @@ const Address = (props: Props) => {
onChange={handleChangeSelect('city')}
items={availableCities.map((st) => ({ label: st.name, value: st.id }))}
shrink={false}
className={classes.selectField}
sx={styles.selectField}
/>
<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 { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material'
// eslint-disable-next-line
export default (theme: Theme) =>
createStyles({
createSxStyles({
form: { display: 'flex', flexDirection: 'column' },
selectField: { marginBottom: theme.spacing(2) },
})
......@@ -5,16 +5,14 @@ import PhoneField from '@agiliza/components/organisms/PhoneField'
import { useErrorValidator } from '@agiliza/utils/hooks/errorValidation'
import { ActionType } from '@agiliza/utils/hooks/state'
import CPFCNPJField from '@agiliza/views/ProposalData/components/atoms/CPFCNPJField'
import { TextField, TextFieldProps } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { TextField, TextFieldProps } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import AddressForm, { AddressState } from '../Address'
import { initState, State as FirstAccessState } from './state'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {
interface Props {
states: State[]
cities: City[]
state: FirstAccessState
......@@ -22,12 +20,14 @@ interface Props extends ExtendedProps {
}
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 { actions: errorActions } = useErrorValidator(initState)
const styles = useStyles(useTheme())
const handleChange =
(key: keyof FirstAccessState): TextFieldProps['onChange'] =>
(evt) => {
......@@ -39,7 +39,7 @@ const FirstAccess = (props: Props) => {
}
return (
<form className={classes.form}>
<form style={styles.form}>
<CPFCNPJField value={cpf} onChange={handleChange('cpf')} onlyCPF disabled />
<TextField variant="outlined" label="Nome" value={name} onChange={handleChange('name')} />
<TextField variant="outlined" label="Email" value={email} onChange={handleChange('email')} />
......@@ -49,4 +49,4 @@ const FirstAccess = (props: Props) => {
)
}
export default withStyles(styles)(FirstAccess)
export default FirstAccess
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
// eslint-disable-next-line
export default (theme: Theme) =>
createStyles({
createSxStyles({
form: {
display: 'flex',
flexDirection: 'column',
......
import React from 'react'
import TextFieldWithIcon from '@agiliza/components/atoms/TextFieldWithIcon'
import { InputAdornment, TextFieldProps } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { AccountCircle } from '@material-ui/icons'
import { AccountCircle } from '@mui/icons-material'
import { InputAdornment, TextFieldProps } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {
interface Props {
username: string
password: string
onChange(type: 'username' | 'password'): TextFieldProps['onChange']
}
const Login = (props: Props) => {
const { classes, username, password, onChange } = props
const styles = useStyles(useTheme())
const { username, password, onChange } = props
return (
<form className={classes.form}>
<form style={styles.form}>
<TextFieldWithIcon
autoFocus
required
value={username}
onChange={onChange('username')}
label="CPF"
className={classes.usernameTxtField}
sx={styles.usernameTxtField}
inputProps={{ maxLength: 14 }}
InputProps={{
startAdornment: (
......@@ -41,4 +40,4 @@ const Login = (props: Props) => {
)
}
export default withStyles(styles)(Login)
export default Login
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material'
// eslint-disable-next-line
export default (theme: Theme) =>
createStyles({
createSxStyles({
title: {
fontSize: '150%',
fontWeight: 'bold',
......@@ -30,5 +30,5 @@ export default (theme: Theme) =>
width: '100%',
margin: theme.spacing(2),
},
usernameTxtField: { marginBottom: 10 },
usernameTxtField: { marginBottom: theme.spacing(2) },
})
import React from 'react'
import { RouteComponentProps } from 'react-router-dom'
import { Typography } from '@material-ui/core'
import { createStyles, Theme } from '@material-ui/core/styles'
import { withStyles, WithStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Typography } from '@mui/material'
import { Theme, useTheme } from '@mui/material/styles'
const styles = (theme: Theme) =>
createStyles({
const useStyles = (theme: Theme) =>
createSxStyles({
container: {
paddingLeft: theme.spacing(2),
},
......@@ -15,19 +15,20 @@ const styles = (theme: Theme) =>
},
})
type Props = WithStyles<typeof styles> & RouteComponentProps
type Props = RouteComponentProps
interface NotFoundProps extends Props {}
function NotFound({ classes }: NotFoundProps) {
function NotFound(props: NotFoundProps) {
const styles = useStyles(useTheme())
return (
<div className={classes.container}>
<div style={styles.container}>
<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>
</div>
</div>
)
}
export default /*#__PURE__*/ withStyles(styles)(NotFound)
export default /*#__PURE__*/ NotFound
......@@ -4,20 +4,19 @@ import { RG } from '@agiliza/api/domain'
import ImageUpload from '@agiliza/components/organisms/ImageUpload'
import { maskRG } from '@agiliza/utils/masks'
import { getBase64FromFile } from '@agiliza/utils/method'
import { TextField, TextFieldProps } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { TextField, TextFieldProps } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {
interface Props {
rg?: RG
onChange: (rg: Partial<RG>) => void
}
const RGTemplate = (props: Props) => {
const { classes, rg, onChange } = props
const { rg, onChange } = props
const styles = useStyles(useTheme())
const handleChangePhoto =
(key: keyof Pick<RG, 'front' | 'back'>): React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>['onChange'] =>
......@@ -36,10 +35,10 @@ const RGTemplate = (props: Props) => {
}
return (
<div className={classes.container}>
<div className={classes.imagesContainer}>
<ImageUpload label="Frente" image={rg?.front} onChangeImage={handleChangePhoto('front')} className={classes.imageUpload} />
<ImageUpload label="Verso" image={rg?.back} onChangeImage={handleChangePhoto('back')} className={classes.imageUpload} />
<div style={styles.container}>
<div style={styles.imagesContainer}>
<ImageUpload label="Frente" image={rg?.front} onChangeImage={handleChangePhoto('front')} sx={styles.imageUpload} />
<ImageUpload label="Verso" image={rg?.back} onChangeImage={handleChangePhoto('back')} sx={styles.imageUpload} />
</div>
<TextField
variant="outlined"
......@@ -53,4 +52,4 @@ const RGTemplate = (props: Props) => {
)
}
export default withStyles(styles)(RGTemplate)
export default RGTemplate
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
container: { display: 'flex', flexDirection: 'column', alignItems: 'center' },
imagesContainer: { display: 'flex', width: '100%', padding: theme.spacing(1) },
imageUpload: { width: '50%', textAlign: 'center' },
......
import { CSSProperties } from '@material-ui/styles/withStyles'
import { CSSProperties } from '@mui/system'
export const drawerWidth = 300
export const toolbarHeight = 124
export const drawerWidth = '300px'
export const toolbarHeight = '124px'
export const flexColumn: CSSProperties = {
display: 'flex',
......
......@@ -8,9 +8,9 @@ import { render } from 'react-dom'
import { Provider } from 'react-redux'
import { browser, SUPPORTED_BROWSERS } from '@agiliza/constants/browser'
import DateFnsUtils from '@date-io/date-fns'
import { MuiThemeProvider } from '@material-ui/core/styles'
import { MuiPickersUtilsProvider } from '@material-ui/pickers'
import { LocalizationProvider } from '@mui/lab'
import AdapterDateFns from '@mui/lab/AdapterDateFns'
import { ThemeProvider } from '@mui/material/styles'
import { SESSION_KEY } from './api/useCases/shared'
import ErrorDialog from './components/molecules/ErrorDialog'
......@@ -28,12 +28,12 @@ interface Props {}
const Adm = (props: Props) => {
return (
<Provider store={store}>
<MuiThemeProvider theme={theme}>
<MuiPickersUtilsProvider utils={DateFnsUtils} locale={ptBR}>
<ThemeProvider theme={theme}>
<LocalizationProvider dateAdapter={AdapterDateFns} locale={ptBR}>
<Views />
<ErrorDialog />
</MuiPickersUtilsProvider>
</MuiThemeProvider>
</LocalizationProvider>
</ThemeProvider>
</Provider>
)
}
......
import red from '@material-ui/core/colors/red'
import { createMuiTheme } from '@material-ui/core/styles'
import red from '@mui/material/colors/red'
import { createTheme } from '@mui/material/styles'
import { SxProps } from '@mui/system'
export const defaultToobarHeight = 64
export const theme = createMuiTheme({
export const theme = createTheme({
palette: {
primary: {
light: '#034da6',
main: '#0d3366'
main: '#0d3366',
},
secondary: {
main: '#23a897',
contrastText: '#fafafa'
contrastText: '#fafafa',
},
text: { primary: '#2e2e2e' },
error: {
main: red[500]
}
main: red[500],
},
},
mixins: {
toolbar: {
minHeight: defaultToobarHeight
}
minHeight: defaultToobarHeight,
},
},
typography: {
fontSize: 13,
fontFamily: "'Rubik', 'Roboto', 'Open Sans', sans-serif"
fontFamily: "'Rubik', 'Roboto', 'Open Sans', sans-serif",
},
overrides: {
components: {
MuiInputBase: {
input: {
'&:-webkit-autofill': {
WebkitBoxShadow: '0 0 0 1000px white inset'
}
}
styleOverrides: {
input: {
'&:-webkit-autofill': {
WebkitBoxShadow: '0 0 0 1000px white inset',
},
},
},
},
MuiTableCell: {
root: {
fontFamily: 'Heebo'
}
styleOverrides: {
root: {
fontFamily: 'Heebo',
},
},
},
MuiListItemText: {
primary: {
fontFamily: 'Heebo'
}
styleOverrides: {
primary: {
fontFamily: 'Heebo',
},
},
},
MuiDialogContentText: {
root: {
fontFamily: 'Heebo'
}
styleOverrides: {
root: {
fontFamily: 'Heebo',
},
},
},
MuiListItemIcon: {
root: {
minWidth: 40
}
}
}
styleOverrides: {
root: {
minWidth: 40,
},
},
},
},
})
export const createSxStyles = <T extends { [k: string]: SxProps<typeof theme> }>(obj: T) => obj
......@@ -2,13 +2,12 @@ import cn from 'classnames'
import React from 'react'
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 extends ExtendedProps {}
interface Props {}
const chrome = SUPPORTED_BROWSERS['chrome'].replace(/(>=)/g, '') + '+'
const firefox = SUPPORTED_BROWSERS['firefox'].replace(/(>=)/g, '') + '+'
......@@ -16,33 +15,33 @@ const edge = SUPPORTED_BROWSERS['windows']['edge'].replace(/(>=)/g, '') + '+'
const safari = SUPPORTED_BROWSERS['macos']['safari'].replace(/(>=)/g, '') + '+'
const BrowserIncompatible = (props: Props) => {
const { classes } = props
const styles = useStyles(useTheme())
return (
<div className={classes.page}>
<i className={cn('fas fa-exclamation-circle', classes.titleIcon)} />
<h1 className={classes.title}>Navegador não suportado</h1>
<p className={classes.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>
<div className={classes.browserList}>
<a target="#" className={classes.anchorBrowser} href="https://www.google.com/chrome/">
<i className={cn('fab fa-chrome', classes.icon)} />
<div style={styles.page}>
<i className="fas fa-exclamation-circle" style={styles.titleIcon} />
<h1 style={styles.title}>Navegador não suportado</h1>
<p style={styles.subTitle}>{`Você está usando o ${browser.getBrowserName()} na versão ${browser.getBrowserVersion()}`}</p>
<p style={styles.subTitle}>É recomendado utilizar o {process.env.APP_TITLE} em um dos seguintes navegadores:</p>
<div style={styles.browserList}>
<Link target="#" sx={styles.anchorBrowser} href="https://www.google.com/chrome/">
<i className={cn('fab fa-chrome', styles.icon)} />
Chrome {chrome}
</a>
<a target="#" className={classes.anchorBrowser} href="https://www.mozilla.org/en-US/firefox/new/">
<i className={cn('fab fa-firefox-browser', classes.icon)} />
</Link>
<Link target="#" sx={styles.anchorBrowser} href="https://www.mozilla.org/en-US/firefox/new/">
<i className={cn('fab fa-firefox-browser', styles.icon)} />
Firefox {firefox}
</a>
<a target="#" className={classes.anchorBrowser} href="https://www.microsoft.com/en-us/edge">
<i className={cn('fab fa-edge', classes.icon)}></i>
</Link>
<Link target="#" sx={styles.anchorBrowser} href="https://www.microsoft.com/en-us/edge">
<i className={cn('fab fa-edge', styles.icon)}></i>
Edge {edge}
</a>
<a target="#" className={classes.anchorBrowser} href="https://support.apple.com/downloads/safari">
<i className={cn('fab fa-safari', classes.icon)}></i>
</Link>
<Link target="#" sx={styles.anchorBrowser} href="https://support.apple.com/downloads/safari">
<i className={cn('fab fa-safari', styles.icon)}></i>
Safari {safari}
</a>
</Link>
</div>
</div>
)
}
export default withStyles(styles)(BrowserIncompatible)
export default BrowserIncompatible
import { Theme } from '@material-ui/core'
import { createStyles } from '@material-ui/core/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material'
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
page: {
display: 'flex',
flexDirection: 'column',
......@@ -16,7 +16,7 @@ export default (theme: Theme) => {
title: {
textAlign: 'center',
marginBottom: '1rem',
fontSize: 'xx-large',
fontSize: 'xxx-large',
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
},
subTitle: {
......
......@@ -9,9 +9,11 @@ import { StoreState } from '@agiliza/redux'
import { isAuthenticated } from '@agiliza/redux/session/selectors'
import { actions } from '@agiliza/redux/ui/login'
import { isFetching } from '@agiliza/redux/ui/login/selectors'
import InputAdornment from '@material-ui/core/InputAdornment'
import Typography from '@material-ui/core/Typography'
import AccountCircle from '@material-ui/icons/AccountCircle'
import AccountCircle from '@mui/icons-material/AccountCircle'
import Box from '@mui/material/Box'
import InputAdornment from '@mui/material/InputAdornment'
import { useTheme } from '@mui/material/styles'
import Typography from '@mui/material/Typography'
import { useStyles } from './styles'
......@@ -28,7 +30,7 @@ interface Props extends BaseProps {
const Login = (props: Props) => {
const { loginRequest, authenticated, fetching, redirectTo } = props
const classes = useStyles()
const styles = useStyles(useTheme())
const [username, setUsername] = useState('')
const [password, setPassword] = useState('')
......@@ -42,20 +44,20 @@ const Login = (props: Props) => {
}
return (
<div className={classes.container}>
<div style={styles.container}>
{/* <div className={classes.logo} /> */}
<div className={classes.formContainer}>
<Typography align="center" className={classes.title} color="primary">
<Box sx={styles.formContainer}>
<Typography align="center" sx={styles.title} color="primary">
{process.env.APP_TITLE}
</Typography>
<form className={classes.form} onKeyDown={(evt) => evt.keyCode === 13 && handleLogin()}>
<form style={styles.form} onKeyDown={(evt) => evt.keyCode === 13 && handleLogin()}>
<TextFieldWithIcon
autoFocus
required
value={username}
onChange={(evt) => setUsername(evt.target.value)}
label="Usuário"
className={classes.usernameTxtField}
sx={styles.usernameTxtField}
InputProps={{
startAdornment: (
<InputAdornment position="start">
......@@ -69,7 +71,7 @@ const Login = (props: Props) => {
<ButtonWithProgress disabled={!username} color="secondary" fetching={fetching} onClick={handleLogin}>
Entrar
</ButtonWithProgress>
</div>
</Box>
{/* <PopoverVersion service={service} /> */}
</div>
)
......
import { flexColumn } from '@agiliza/constants/styles'
import { makeStyles, Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
// eslint-disable-next-line
export const useStyles = makeStyles((theme: Theme) =>
createStyles({
export const useStyles = (theme: Theme) =>
createSxStyles({
title: {
fontSize: '150%',
fontWeight: 'bold',
......@@ -41,6 +41,5 @@ export const useStyles = makeStyles((theme: Theme) =>
display: 'flex',
flexDirection: 'column',
},
usernameTxtField: { marginBottom: 10 },
usernameTxtField: { marginBottom: theme.spacing(2) },
})
)
import cn from 'classnames'
import React from 'react'
import ItemWithIcon from '@agiliza/components/atoms/ItemWithIcon'
import List from '@material-ui/core/List'
import { AttachMoney as AttachMoneyIcon, ExitToApp } from '@material-ui/icons'
import withStyles from '@material-ui/styles/withStyles'
import { AttachMoney as AttachMoneyIcon, ExitToApp } from '@mui/icons-material'
import { ListItemProps } from '@mui/material'
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 { Props as DrawerProps } from '@agiliza/components/molecules/Drawer'
interface ListItem {
......@@ -32,10 +31,10 @@ export const mapPathToTitle = (path: string) => {
return drawerListItems.find((dL) => dL.path === path)?.label || ''
}
type ExtendedTypes = RouteComponentProps & WithStyles<typeof styles>
type ExtendedTypes = RouteComponentProps
interface Props extends ExtendedTypes {
listItemClassName?: string
sx: ListItemProps['sx']
toggleDrawer: () => void
logout: DrawerProps['logout']
}
......@@ -46,30 +45,26 @@ const isCurrentPath = (history: RouteComponentProps['history'], path: string) =>
}
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) => () => {
history.push(path)
toggleDrawer()
}
const listItemComponent = (label: string, path: string, Icon: React.ComponentType) => (
<ItemWithIcon
key={path}
label={label}
className={cn(listItemClassName, { [classes.selected]: isCurrentPath(history, path) })}
onClick={handleClick(path)}
>
<ItemWithIcon key={path} label={label} sx={{ ...sx, ...(isCurrentPath(history, path) ? styles.selected : {}) }} onClick={handleClick(path)}>
<Icon />
</ItemWithIcon>
)
return (
<List className={classes.list}>
<List sx={styles.list}>
{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 />
</ItemWithIcon>
</List>
)
}
export default withStyles(styles)(DrawerItems)
export default DrawerItems
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) => {
return createStyles({
export const useStyles = (theme: Theme) =>
createSxStyles({
selected: {
backgroundColor: theme.palette.primary.light,
color: theme.palette.primary.contrastText,
......@@ -37,4 +38,3 @@ export const styles = (theme: Theme) => {
},
grow: { flex: 1 },
})
}
......@@ -6,20 +6,20 @@ import CircularProgress from '@agiliza/components/molecules/CircularProgress'
import { actions as drawerActions } from '@agiliza/redux/ui/drawer'
import { actions as loginActions } from '@agiliza/redux/ui/login'
import { ProposalDataRouteState } from '@agiliza/views/ProposalData/pages/ProposalData'
import { Button, ListItem, ListItemIcon, ListItemText, Menu, Typography } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { AccountCircleOutlined as PersonIcon, MeetingRoom as LogoutIcon } from '@material-ui/icons'
import { AccountCircleOutlined as PersonIcon, MeetingRoom as LogoutIcon } from '@mui/icons-material'
import { Button, Link, ListItem, ListItemIcon, ListItemText, Menu, Typography } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import connect, { ConnectedProps } from './connect'
import { PATHS } from './DrawerItems'
import styles from './styles'
import useStyles from './styles'
const SimulationCreditLines = lazy(() => import('@agiliza/views/SimulationCreditLines/pages/router'))
const ProposalData = lazy(() => import('@agiliza/views/ProposalData/pages/ProposalData'))
const Projects = lazy(() => import('@agiliza/views/Projects/pages/router'))
// const SecurityProfile = lazy(() => import('@curio/ui/dist/views/SecurityProfile'))
type BaseProps = RouteComponentProps & ConnectedProps & WithStyles<typeof styles>
type BaseProps = RouteComponentProps & ConnectedProps
interface Props extends BaseProps {
toggleDrawer: typeof drawerActions.toggleDrawer
......@@ -27,7 +27,8 @@ interface Props extends BaseProps {
}
const Main = (props: Props) => {
const { classes, toggleDrawer, fetchMenu, customer } = props
const { toggleDrawer, fetchMenu, customer } = props
const styles = useStyles(useTheme())
const history = useHistory()
......@@ -55,20 +56,24 @@ const Main = (props: Props) => {
}
return (
<div className={classes.pageContainer}>
<div style={styles.pageContainer}>
<AppBar
onNavClick={toggleDrawer}
title={
<div style={{ display: 'flex' }}>
<a onClick={() => history.push('/')} className={classes.titleAnchor}>
<Typography className={classes.appTitle}>Agiliza</Typography>
</a>
<>
<Link onClick={() => history.push('/')} sx={styles.titleAnchor}>
<Typography sx={styles.appTitle}>Agiliza</Typography>
</Link>
<div style={{ flex: 1 }} />
</>
}
actions={
<>
<Button color="inherit" variant="text" onClick={() => history.push(PATHS.proposals)}>
Retomar proposta
</Button>
{customer && <Button onClick={handleProfileClick} key="1" color="inherit" endIcon={<PersonIcon />} />}
</div>
</>
}
/>
{/* <Drawer drawerOpen={drawerOpen} toggleDrawer={toggleDrawer} logout={logout} Items={DrawerItems} {...routeProps} /> */}
......@@ -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'
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
pageContainer: {
height: '100vh',
......@@ -14,7 +15,7 @@ export default (theme: Theme) => {
paddingBottom: 0,
justifyContent: 'flex-start',
},
appTitle: { flexGrow: 1, fontSize: '100%', textTransform: 'uppercase' },
titleAnchor: { cursor: 'pointer' },
appTitle: { flexGrow: 1, fontSize: '100%', textTransform: 'uppercase', color: 'white' },
titleAnchor: { cursor: 'pointer', display: { xs: 'none', sm: 'block' } },
})
}
......@@ -3,27 +3,30 @@ import { RouteComponentProps } from 'react-router'
import { Project } from '@agiliza/api/domain/project'
import { PATHS } from '@agiliza/views/Main/DrawerItems'
import { Apps as AppsIcon } from '@mui/icons-material'
import {
Avatar,
Box,
CircularProgress,
List,
ListItem,
ListItemAvatar,
ListItemText,
ListSubheader
} from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { Apps as AppsIcon } from '@material-ui/icons'
} from '@mui/material'
import { useTheme } from '@mui/material/styles'
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 {}
const ListProjects = (props: Props) => {
const { classes, fetching, proposals, history } = props
const { fetching, proposals, history } = props
const styles = useStyles(useTheme())
useEffect(() => {
props.getProjects()
......@@ -37,9 +40,9 @@ const ListProjects = (props: Props) => {
if (fetching) return <CircularProgress />
return (
<div className={classes.pageContent}>
<Box sx={styles.pageContent}>
<List
className={classes.list}
sx={styles.list}
subheader={
<ListSubheader component="div" id="nested-list-subheader">
Projetos
......@@ -57,8 +60,8 @@ const ListProjects = (props: Props) => {
</ListItem>
))}
</List>
</div>
</Box>
)
}
export default connected(withStyles(styles)(ListProjects))
export default connected(ListProjects)
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material'
import sharedStyles from '../shared-styles'
// eslint-disable-next-line
export default (theme: Theme) =>
createStyles({
const styles = (theme: Theme) =>
createSxStyles({
...sharedStyles(theme),
list: { width: '100%' },
})
export default styles
......@@ -3,10 +3,10 @@ import { Route, RouteComponentProps, Switch } from 'react-router'
import AuthRoute from '@agiliza/components/atoms/AuthRoute'
import { PATHS } from '@agiliza/views/Main/DrawerItems'
import { CircularProgress } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { Box, CircularProgress } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import styles from './shared-styles'
import useStyles from './shared-styles'
export const PROJECTS_PATHS = {
login: PATHS.proposals + '/login',
......@@ -15,23 +15,22 @@ export const PROJECTS_PATHS = {
const ListProjects = lazy(() => import('./ListProjects'))
const Login = lazy(() => import('@agiliza/views/Login'))
type ExtendedProps = WithStyles<typeof styles> & RouteComponentProps
type ExtendedProps = RouteComponentProps
interface Props extends ExtendedProps {}
const ProposalDataRouter = (props: Props) => {
const { classes } = props
const styles = useStyles(useTheme())
return (
<div className={classes.pageContent}>
<Suspense fallback={<CircularProgress className={classes.circularProgress} />}>
<Box sx={styles.pageContent}>
<Suspense fallback={<CircularProgress sx={styles.circularProgress} />}>
<Switch>
<Route path={PROJECTS_PATHS.login} render={(renderProps) => <Login {...renderProps} redirectTo={PATHS.proposals} />} />
<AuthRoute path={PATHS.proposals} redirectTo={PROJECTS_PATHS.login} component={ListProjects} />
</Switch>
</Suspense>
</div>
</Box>
)
}
export default withStyles(styles)(ProposalDataRouter)
export default ProposalDataRouter
import { createSxStyles } from '@agiliza/theme'
import sharedStyles from '@agiliza/views/shared-styles'
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { Theme } from '@mui/material'
// eslint-disable-next-line
export default (theme: Theme) =>
createStyles({
const styles = (theme: Theme) =>
createSxStyles({
...sharedStyles(theme),
title: { marginBottom: theme.spacing(2) },
})
export default styles
import React from 'react'
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'>
......
......@@ -3,15 +3,11 @@ import React from 'react'
import { IPAddress } from '@agiliza/api/domain'
import { maskCEP } from '@agiliza/utils/masks'
import { extractNumbers } from '@agiliza/utils/method'
import { TextField, TextFieldProps } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { TextField, TextFieldProps } from '@mui/material'
import { AddressState } from './state'
import styles from './styles'
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {
interface Props {
state: AddressState
onChange: (address: Partial<IPAddress>) => void
}
......@@ -35,4 +31,4 @@ const Address = (props: Props) => {
)
}
export default withStyles(styles)(Address)
export default Address
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
form: {
'& .MuiTextField-root': {
marginBottom: theme.spacing(2),
......
......@@ -2,7 +2,7 @@ import React from 'react'
import { extractNumbers } from '@agiliza/utils/extractors'
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 { amount, price } = pva
......
import React from 'react'
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 Form from './Form'
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 {
state: BDAddressState
......@@ -16,15 +16,16 @@ interface Props extends ExtendedProps {
}
const Address = (props: Props) => {
const { classes, context, state, actions } = props
const { context, state, actions } = props
const styles = useStyles(useTheme())
return (
<div className={classes.contentContainer}>
<div className={classes.content}>
<div style={styles.contentContainer}>
<div style={styles.content}>
<Form state={state} actions={actions} context={context} />
</div>
</div>
)
}
export default connected(withStyles(styles)(Address))
export default connected(Address)
......@@ -5,22 +5,21 @@ import ImageUpload from '@agiliza/components/organisms/ImageUpload'
import AddressTemplate from '@agiliza/components/templates/Address'
import { ActionType } from '@agiliza/utils/hooks/state'
import { getBase64FromFile } from '@agiliza/utils/method'
import { TextField, TextFieldProps } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { Box, TextField, TextFieldProps } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import { BDAddressState } from '../state'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {
interface Props {
state: BDAddressState
actions: ActionType<BDAddressState>
context: AuthenticationContext
}
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
......@@ -39,7 +38,7 @@ const Form = (props: Props) => {
}
return (
<form className={classes.form}>
<Box sx={styles.form} component="form">
<ImageUpload label="Comprovante de residência" image={proof} onChangeImage={handleChangeProof} />
<AddressTemplate
states={context.states}
......@@ -48,8 +47,8 @@ const Form = (props: Props) => {
onChange={(addrs) => actions.update(addrs)}
/>
<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 { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
form: {
'& .MuiTextField-root': {
......
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
})
}
import React from 'react'
import { RouteComponentProps } from 'react-router'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import styles from './styles'
type ExtendedProps = WithStyles<typeof styles> & RouteComponentProps
type ExtendedProps = RouteComponentProps
interface Props extends ExtendedProps {}
const BusinessData = (props: Props) => {
const { classes } = props
return <div className={classes.contentContainer}></div>
return <div></div>
}
export default withStyles(styles)(BusinessData)
export default BusinessData
......@@ -6,22 +6,21 @@ import { ActionType } from '@agiliza/utils/hooks/state'
import { getBase64FromFile } from '@agiliza/utils/method'
import CPFCNPJField from '@agiliza/views/ProposalData/components/atoms/CPFCNPJField'
import { DatePicker, SelectField, SelectFieldProps } from '@curio/components'
import { TextField, TextFieldProps } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { Box, TextField, TextFieldProps } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import { BDIdentificationState } from '../state'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {
interface Props {
state: BDIdentificationState
actions: ActionType<BDIdentificationState>
context: ProposalDataContext
}
const Form = (props: Props) => {
const { classes, state, actions, context } = props
const { state, actions, context } = props
const styles = useStyles(useTheme())
const {
cnpj,
......@@ -44,8 +43,8 @@ const Form = (props: Props) => {
actions.update({ [key]: evt.target.value })
}
const handleChangeDate = (type: keyof Pick<BDIdentificationState, 'openingDate'>) => (date: Date | null) => {
actions.update({ [type]: date })
const handleChangeDate = (type: keyof Pick<BDIdentificationState, 'openingDate'>) => (date: unknown) => {
actions.update({ [type]: date as Date })
}
const handleChangeSelect =
......@@ -68,7 +67,7 @@ const Form = (props: Props) => {
}
return (
<form className={classes.form}>
<Box sx={styles.form}>
<DocumentTemplate document={document} context={context} onChangeImage={handleChangeProof} onChangeDocumentType={handleChangeDocumentType} />
<CPFCNPJField value={cnpj} onChange={handleChangeText('cnpj')} onlyCPNJ />
<DatePicker
......@@ -76,8 +75,8 @@ const Form = (props: Props) => {
label="Data da abertura"
value={openingDate}
onChange={handleChangeDate('openingDate')}
format="dd/MM/yyyy"
className={classes.datePicker}
// format="dd/MM/yyyy"
sx={styles.datePicker}
/>
<TextField variant="outlined" label="Inscrição estadual" value={stateRegistration} onChange={handleChangeText('stateRegistration')} />
<TextField variant="outlined" label="Inscrição municipal" value={cityRegistration} onChange={handleChangeText('cityRegistration')} />
......@@ -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" 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 { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
form: {
'& .MuiTextField-root': {
......
import React from 'react'
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 Form from './Form'
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 {
state: BDIdentificationState
......@@ -16,15 +16,16 @@ interface Props extends ExtendedProps {
}
const Identification = (props: Props) => {
const { classes, context, state, actions } = props
const { context, state, actions } = props
const styles = useStyles(useTheme())
return (
<div className={classes.contentContainer}>
<div className={classes.content}>
<div style={styles.contentContainer}>
<div style={styles.content}>
<Form state={state} actions={actions} context={context} />
</div>
</div>
)
}
export default connected(withStyles(styles)(Identification))
export default connected(Identification)
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
})
}
......@@ -10,14 +10,14 @@ import {
DialogContent,
DialogProps,
DialogTitle
} from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
} from '@mui/material'
import { useTheme } from '@mui/material/styles'
import Form from '../Form'
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 {
onClose: () => void
......@@ -27,7 +27,8 @@ interface Props extends ExtendedProps {
}
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)
......@@ -43,7 +44,7 @@ const Dialog = (props: Props) => {
}
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>
<DialogContent>
<Form {...formState} />
......@@ -58,4 +59,4 @@ const Dialog = (props: Props) => {
)
}
export default withStyles(styles)(Dialog)
export default Dialog
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
dialog: { width: '80%', height: '55%' },
})
......
......@@ -5,21 +5,20 @@ import { ActionType } from '@agiliza/utils/hooks/state'
import PriceAmountInput, {
Values
} from '@agiliza/views/ProposalData/components/templates/PriceAmountInput'
import { TextField, TextFieldProps, Typography } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { Box, TextField, TextFieldProps, Typography } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import { BDProductServiceState } from '../state'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {
interface Props {
state: BDProductServiceState
actions: ActionType<BDProductServiceState>
}
const Form = (props: Props) => {
const { classes, state, actions } = props
const { state, actions } = props
const styles = useStyles(useTheme())
const { description, unit, stock, monthlySales, variableCosts } = state
......@@ -34,17 +33,17 @@ const Form = (props: Props) => {
}
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="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')} />
<Typography className={classes.label}>Vendas mensais</Typography>
<Typography sx={styles.label}>Vendas mensais</Typography>
<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')} />
</form>
</Box>
)
}
export default withStyles(styles)(Form)
export default Form
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
form: {
'& .MuiTextField-root': {
......
......@@ -2,16 +2,16 @@ import React, { useState } from 'react'
import { BDProductService } from '@agiliza/api/domain'
import { ActionType } from '@agiliza/utils/hooks/state'
import { Avatar, List, ListItem, ListItemAvatar, ListItemText } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { Add as AddIcon, Apps as AppsIcon } from '@material-ui/icons'
import { Add as AddIcon, Apps as AppsIcon } from '@mui/icons-material'
import { Avatar, List, ListItem, ListItemAvatar, ListItemText } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import { connected, ConnectedProps } from './connect'
import Dialog from './Dialog'
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 {
projectId: string
......@@ -20,7 +20,8 @@ interface Props extends ExtendedProps {
}
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>()
......@@ -51,9 +52,9 @@ const ProductsServices = (props: Props) => {
return (
<>
<div className={classes.contentContainer}>
<div className={classes.content}>
<List className={classes.list}>
<div style={styles.contentContainer}>
<div style={styles.content}>
<List sx={styles.list}>
{productsServices.map((vehicle, i) => (
<ListItem key={i} button onClick={handleClickListItem(vehicle)}>
<ListItemAvatar>
......@@ -67,7 +68,7 @@ const ProductsServices = (props: Props) => {
</List>
</div>
</div>
<Avatar className={classes.avatarBtnContainer} onClick={handleClickAdd}>
<Avatar sx={styles.avatarBtnContainer} onClick={handleClickAdd}>
<AddIcon />
</Avatar>
<Dialog fetching={fetching} open={open} onClose={handleClickClose} productService={selectedProductService} onSave={handleSave} />
......@@ -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 { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
list: { width: '100%' },
avatarBtnContainer: {
......
......@@ -7,15 +7,13 @@ import { ActionType } from '@agiliza/utils/hooks/state'
import { maskMonthYear } from '@agiliza/utils/masks'
import { getBase64FromFile } from '@agiliza/utils/method'
import { SelectField, SelectFieldProps } from '@curio/components'
import { TextField, TextFieldProps, Typography } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { Box, TextField, TextFieldProps, Typography } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import { BDStockSalesCostsState } from '../state'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {
interface Props {
state: BDStockSalesCostsState
actions: ActionType<BDStockSalesCostsState>
context: ProposalDataContext
......@@ -23,7 +21,8 @@ interface Props extends ExtendedProps {
}
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
......@@ -63,7 +62,7 @@ const Form = (props: Props) => {
}
return (
<form className={classes.form}>
<Box component="form" sx={styles.form}>
<DocumentTemplate context={context} document={document} onChangeImage={handleChangeImage} onChangeDocumentType={handleChangeDocumentType} />
{/* <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
......@@ -87,7 +86,7 @@ const Form = (props: Props) => {
variant="outlined"
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.
</Typography>
<TextField variant="outlined" disabled label="Total geral estoque" value={formatCurrency(getTotals('stock').toFixed(2)) || ''} />
......@@ -99,8 +98,8 @@ const Form = (props: Props) => {
value={formatCurrency(getTotalCommission(salesCommission).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 { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
form: {
'& .MuiTextField-root': {
......
import React from 'react'
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 Form from './Form'
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 {
state: BDStockSalesCostsState
......@@ -16,15 +16,15 @@ interface Props extends ExtendedProps {
}
const StockSalesCosts = (props: Props) => {
const { classes, context, productsServices, state, actions } = props
const { context, productsServices, state, actions } = props
const styles = useStyles(useTheme())
return (
<div className={classes.contentContainer}>
<div className={classes.content}>
<div style={styles.contentContainer}>
<div style={styles.content}>
<Form state={state} actions={actions} context={context} productsServices={productsServices} />
</div>
</div>
)
}
export default connected(withStyles(styles)(StockSalesCosts))
export default connected(StockSalesCosts)
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
})
}
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../shared-styles'
// eslint-disable-next-line
export default (theme: Theme) =>
createStyles({
createSxStyles({
...sharedStyles(theme),
cardsContainer: { display: 'flex' },
gridItem: { display: 'flex', justifyContent: 'center' },
......
import React from 'react'
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 Form from './Form'
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 {
state: CDAddressState
......@@ -16,15 +16,16 @@ interface Props extends ExtendedProps {
}
const Address = (props: Props) => {
const { classes, context, state, actions } = props
const { context, state, actions } = props
const styles = useStyles(useTheme())
return (
<div className={classes.contentContainer}>
<div className={classes.content}>
<div style={styles.contentContainer}>
<div style={styles.content}>
<Form states={context.states} cities={context.cities} state={state} actions={actions} />
</div>
</div>
)
}
export default connected(withStyles(styles)(Address))
export default connected(Address)
......@@ -5,14 +5,13 @@ import ImageUpload from '@agiliza/components/organisms/ImageUpload'
import Address, { AddressState } from '@agiliza/components/templates/Address'
import { ActionType } from '@agiliza/utils/hooks/state'
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 styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {
interface Props {
states: State[]
cities: City[]
state: CDAddressState
......@@ -20,7 +19,8 @@ interface Props extends ExtendedProps {
}
const Form = (props: Props) => {
const { classes, state, actions, states, cities } = props
const { state, actions, states, cities } = props
const styles = useStyles(useTheme())
const { proof } = state
......@@ -37,11 +37,11 @@ const Form = (props: Props) => {
}
return (
<form className={classes.form}>
<Box component="form" sx={styles.form}>
<ImageUpload label="Comprovante de residência" image={proof} onChangeImage={handleChangeProof} />
<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 { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
switchCardPhotoContainer: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-evenly' },
datePicker: { marginBottom: '0px !important' },
......
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
})
}
import React from 'react'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import styles from './styles'
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {
interface Props {
activeStep: number
}
const CustomerData = (props: Props) => {
const { classes } = props
return <div className={classes.stepContentContainer}>{}</div>
return <div />
}
export default withStyles(styles)(CustomerData)
export default CustomerData
......@@ -7,21 +7,20 @@ import { ActionType } from '@agiliza/utils/hooks/state'
import { extractNumbers, getBase64FromFile } from '@agiliza/utils/method'
import { SelectField, SelectFieldProps, Switch } from '@curio/components'
import {
Box,
Checkbox,
CheckboxProps,
FormControlLabel,
FormGroup,
TextField,
TextFieldProps
} from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
} from '@mui/material'
import { useTheme } from '@mui/material/styles'
import { CDHomeState } from '../state'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {
interface Props {
addressContext: AuthenticationContext
state: CDHomeState
actions: ActionType<CDHomeState>
......@@ -29,7 +28,9 @@ interface Props extends ExtendedProps {
}
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 { resideTime, cityResideTime, address, hasProperty, deed, type, deedRecord, reside, hasOnus } = state
......@@ -60,7 +61,7 @@ const Form = (props: Props) => {
}
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 />
{hasProperty ? (
<>
......@@ -83,7 +84,7 @@ const Form = (props: Props) => {
variant="outlined"
shrink={false}
/>
<FormGroup row className={classes.formGroup}>
<FormGroup row sx={styles.formGroup}>
<FormControlLabel
control={<Checkbox name="reside" checked={reside} onChange={handleChangeCheckbox('reside')} />}
label="Reside no imóvel?"
......@@ -110,8 +111,8 @@ const Form = (props: Props) => {
<AddressTemplate states={states} cities={cities} state={address} onChange={(addrs) => actions.update({ address: addrs as IPAddress })} />
</>
) : null}
</form>
</Box>
)
}
export default withStyles(styles)(Form)
export default Form
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
switchCardPhotoContainer: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-evenly' },
formGroup: {
......
import React from 'react'
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 Form from './Form'
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 {
state: CDHomeState
......@@ -16,15 +16,16 @@ interface Props extends ExtendedProps {
}
const Home = (props: Props) => {
const { classes, context, addressContext, state, actions } = props
const { context, addressContext, state, actions } = props
const styles = useStyles(useTheme())
return (
<div className={classes.contentContainer}>
<div className={classes.content}>
<div style={styles.contentContainer}>
<div style={styles.content}>
<Form state={state} actions={actions} addressContext={addressContext} context={context} />
</div>
</div>
)
}
export default connected(withStyles(styles)(Home))
export default connected(Home)
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
})
}
......@@ -5,22 +5,21 @@ import AccountInputsPhoto from '@agiliza/components/templates/AccountInputsPhoto
import { ActionType } from '@agiliza/utils/hooks/state'
import CPFCNPJField from '@agiliza/views/ProposalData/components/atoms/CPFCNPJField'
import { SelectField, SelectFieldProps } from '@curio/components'
import { FormControlLabel, Switch, TextField, TextFieldProps } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { Box, FormControlLabel, Switch, TextField, TextFieldProps } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import { CDIdentificationState } from '../state'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {
interface Props {
state: CDIdentificationState
actions: ActionType<CDIdentificationState>
context: ProposalDataContext
}
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
......@@ -54,7 +53,7 @@ const Form = (props: Props) => {
const handleChangeValidState = (vldStt: boolean) => {}
return (
<form className={classes.form}>
<Box component="form" sx={styles.form}>
<SelectField
id="framework-select-field"
label="Enquadramento"
......@@ -75,7 +74,7 @@ const Form = (props: Props) => {
variant="outlined"
shrink={false}
/>
<div className={classes.switchCardPhotoContainer}>
<div style={styles.switchCardPhotoContainer}>
<FormControlLabel
label="Possui conta na entidade?"
control={
......@@ -96,8 +95,8 @@ const Form = (props: Props) => {
/>
) : null}
</div>
</form>
</Box>
)
}
export default withStyles(styles)(Form)
export default Form
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
switchCardPhotoContainer: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-evenly' },
})
......
import React from 'react'
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 Form from './Form'
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 {
state: CDIdentificationState
......@@ -16,16 +16,16 @@ interface Props extends ExtendedProps {
}
const Identification = (props: Props) => {
const { classes, context, state, actions } = props
const { context, state, actions } = props
const styles = useStyles(useTheme())
return (
<div className={classes.contentContainer}>
<div className={classes.content}>
<div style={styles.contentContainer}>
<div style={styles.content}>
<Form context={context} state={state} actions={actions} />
</div>
</div>
)
}
export default connected(withStyles(styles)(Identification))
export default connected(Identification)
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
})
}
......@@ -6,22 +6,21 @@ import RGTemplate from '@agiliza/components/templates/RGTemplate'
import { ActionType } from '@agiliza/utils/hooks/state'
import { maskLandline } from '@agiliza/utils/masks'
import { DatePicker, SelectField, SelectFieldProps, Switch } from '@curio/components'
import { TextField, TextFieldProps } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { Box, TextField, TextFieldProps } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import { CDPersonalDataState } from '../state'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {
interface Props {
state: CDPersonalDataState
actions: ActionType<CDPersonalDataState>
context: ProposalDataContext
}
const Form = (props: Props) => {
const { classes, state, actions, context } = props
const { state, actions, context } = props
const styles = useStyles(useTheme())
const {
birthday,
......@@ -39,8 +38,8 @@ const Form = (props: Props) => {
landline,
} = state
const handleChangeDate = (type: keyof Pick<CDPersonalDataState, 'birthday'>) => (date: Date | null) => {
actions.update({ [type]: date })
const handleChangeDate = (type: keyof Pick<CDPersonalDataState, 'birthday'>) => (date: unknown) => {
actions.update({ [type]: date as Date })
}
const handleChangeText =
......@@ -60,15 +59,8 @@ const Form = (props: Props) => {
}
return (
<form className={classes.form}>
<DatePicker
id="birthday"
label="Data de nascimento"
value={birthday}
onChange={handleChangeDate('birthday')}
format="dd/MM/yyyy"
className={classes.datePicker}
/>
<Box component="form" sx={styles.form}>
<DatePicker id="birthday" label="Data de nascimento" value={birthday} onChange={handleChangeDate('birthday')} sx={styles.datePicker} />
<RGTemplate rg={rg} onChange={handleChangeRG} />
<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')} />
......@@ -103,8 +95,8 @@ const Form = (props: Props) => {
onChange={handleChangeText('landline')}
inputProps={{ maxLength: 14 }}
/>
</form>
</Box>
)
}
export default withStyles(styles)(Form)
export default Form
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
switchCardPhotoContainer: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-evenly' },
......
import React from 'react'
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 Form from './Form'
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 {
state: CDPersonalDataState
......@@ -16,15 +16,16 @@ interface Props extends ExtendedProps {
}
const PersonalData = (props: Props) => {
const { classes, context, state, actions } = props
const { context, state, actions } = props
const styles = useStyles(useTheme())
return (
<div className={classes.contentContainer}>
<div className={classes.content}>
<div style={styles.contentContainer}>
<div style={styles.content}>
<Form context={context} state={state} actions={actions} />
</div>
</div>
)
}
export default connected(withStyles(styles)(PersonalData))
export default connected(PersonalData)
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
})
}
......@@ -10,14 +10,14 @@ import {
DialogContent,
DialogProps,
DialogTitle
} from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
} from '@mui/material'
import { useTheme } from '@mui/material/styles'
import Form from '../Form'
import { CDReferenceState, 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 {
state: CDReferenceState
......@@ -30,7 +30,8 @@ interface Props extends ExtendedProps {
}
const Dialog = (props: Props) => {
const { classes, fetching, open, onClose, onSave, reference, context, state, actions } = props
const { fetching, open, onClose, onSave, reference, context, state, actions } = props
const styles = useStyles(useTheme())
useEffect(() => {
if (reference) actions.update(reference)
......@@ -42,7 +43,7 @@ const Dialog = (props: Props) => {
}
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>{reference ? 'Editar' : 'Adicionar'} pessoa envolvida</DialogTitle>
<DialogContent>
<Form state={state} actions={actions} context={context} />
......@@ -57,4 +58,4 @@ const Dialog = (props: Props) => {
)
}
export default withStyles(styles)(Dialog)
export default Dialog
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
dialog: { width: '80%', height: '55%' },
})
......
......@@ -6,23 +6,21 @@ import PhoneField from '@agiliza/components/organisms/PhoneField'
import { ActionType } from '@agiliza/utils/hooks/state'
import { getBase64FromFile } from '@agiliza/utils/method'
import { SelectField, SelectFieldProps } from '@curio/components'
import { TextField, TextFieldProps } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { Box, TextField, TextFieldProps } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import { CDReferenceState } from '../state'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {
interface Props {
state: CDReferenceState
actions: ActionType<CDReferenceState>
context: ProposalDataContext
}
const Form = (props: Props) => {
const { classes, state, actions, context } = props
const { state, actions, context } = props
const styles = useStyles(useTheme())
const { name, telephone, photo, type, extraInfo, concept } = state
const handleChangeText =
......@@ -46,7 +44,7 @@ const Form = (props: Props) => {
}
return (
<form className={classes.form}>
<Box component="form" sx={styles.form}>
<ImageUpload label="Foto da referência" image={photo} onChangeImage={handleChangePhoto} />
<SelectField
id="type-select"
......@@ -62,8 +60,8 @@ const Form = (props: Props) => {
<PhoneField value={telephone} onChange={handleChangeText('telephone')} />
<TextField variant="outlined" label="Outras informações" value={extraInfo} onChange={handleChangeText('extraInfo')} />
<TextField variant="outlined" label="Conceito" value={concept} onChange={handleChangeText('concept')} />
</form>
</Box>
)
}
export default withStyles(styles)(Form)
export default Form
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
switchCardPhotoContainer: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-evenly' },
......
......@@ -2,16 +2,16 @@ import React, { useEffect, useState } from 'react'
import { Reference } from '@agiliza/api/domain/proposalData/involvedPeople/reference'
import { ActionType } from '@agiliza/utils/hooks/state'
import { Avatar, List, ListItem, ListItemAvatar, ListItemText } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { Add as AddIcon, EmojiEmotions as EmojiEmotionsIcon } from '@material-ui/icons'
import { Add as AddIcon, EmojiEmotions as EmojiEmotionsIcon } from '@mui/icons-material'
import { Avatar, List, ListItem, ListItemAvatar, ListItemText } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import { connected, ConnectedProps } from './connect'
import Dialog from './Dialog'
import { CDReferenceState } from './state'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles> & ConnectedProps
type ExtendedProps = ConnectedProps
interface Props extends ExtendedProps {
state: CDReferenceState
......@@ -21,9 +21,8 @@ interface Props extends ExtendedProps {
}
const References = (props: Props) => {
const { classes, fetching, context, state, actions, references, projectId, personId } = props
console.log(personId)
const { fetching, context, state, actions, references, projectId, personId } = props
const styles = useStyles(useTheme())
const [selectedReference, setSelectedReference] = useState<Reference | undefined>()
......@@ -71,9 +70,9 @@ const References = (props: Props) => {
return (
<>
<div className={classes.contentContainer}>
<div className={classes.content}>
<List className={classes.list}>
<div style={styles.contentContainer}>
<div style={styles.content}>
<List sx={styles.list}>
{references.map((reference, i) => (
<ListItem key={i} button onClick={handleClickListItem(reference)}>
<ListItemAvatar>
......@@ -87,7 +86,7 @@ const References = (props: Props) => {
</List>
</div>
</div>
<Avatar className={classes.avatarBtnContainer} onClick={handleClickAdd}>
<Avatar sx={styles.avatarBtnContainer} onClick={handleClickAdd}>
<AddIcon />
</Avatar>
<Dialog
......@@ -104,4 +103,4 @@ const References = (props: Props) => {
)
}
export default connected(withStyles(styles)(References))
export default connected(References)
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
list: { width: '100%' },
avatarBtnContainer: {
......
......@@ -9,27 +9,26 @@ import { ActionType } from '@agiliza/utils/hooks/state'
import { getBase64FromFile } from '@agiliza/utils/method'
import CPFCNPJField from '@agiliza/views/ProposalData/components/atoms/CPFCNPJField'
import { DatePicker } from '@curio/components'
import { TextField, TextFieldProps } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { Box, TextField, TextFieldProps } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import { CustomerSourceIncomeState } from '../state'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {
interface Props {
state: CustomerSourceIncomeState
actions: ActionType<CustomerSourceIncomeState>
context: AuthenticationContext
}
const Form = (props: Props) => {
const { classes, state, actions, context } = props
const { state, actions, context } = props
const styles = useStyles(useTheme())
const { cnpj, admissionDate, companyName, proofAddress, mobile, netIncome, address } = state
const handleChangeDate = (type: keyof Pick<CustomerSourceIncomeState, 'admissionDate'>) => (date: Date | null) => {
actions.update({ [type]: date })
const handleChangeDate = (type: keyof Pick<CustomerSourceIncomeState, 'admissionDate'>) => (date: unknown) => {
actions.update({ [type]: date as Date })
}
const handleChangeText =
......@@ -51,7 +50,7 @@ const Form = (props: Props) => {
}
return (
<form className={classes.form}>
<Box component="form" sx={styles.form}>
<TextField variant="outlined" label="Razão social" value={companyName} onChange={handleChangeText('companyName')} />
<CPFCNPJField value={cnpj} onChange={handleChangeText('cnpj')} onlyCPNJ />
<DatePicker
......@@ -59,15 +58,14 @@ const Form = (props: Props) => {
label="Data de admissão"
value={admissionDate}
onChange={handleChangeDate('admissionDate')}
format="dd/MM/yyyy"
className={classes.datePicker}
sx={styles.datePicker}
/>
<ImageUpload label="Comprovante" image={proofAddress} onChangeImage={handleChangeProof} />
<PhoneField value={mobile} onChange={handleChangeText('mobile')} />
<TextField variant="outlined" label="Renda líquida" value={formatCurrency(netIncome)} onChange={handleChangeText('netIncome')} />
<Address state={address} onChange={handleChangeAddress} states={context.states} cities={context.cities} />
</form>
</Box>
)
}
export default withStyles(styles)(Form)
export default Form
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
switchCardPhotoContainer: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-evenly' },
......
import React from 'react'
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 Form from './Form'
import { CustomerSourceIncomeState } from './state'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles> & ConnectedProps
type ExtendedProps = ConnectedProps
interface Props extends ExtendedProps {
state: CustomerSourceIncomeState
......@@ -16,15 +16,16 @@ interface Props extends ExtendedProps {
}
const SourceIncome = (props: Props) => {
const { classes, context, state, actions } = props
const { context, state, actions } = props
const styles = useStyles(useTheme())
return (
<div className={classes.contentContainer}>
<div className={classes.content}>
<div style={styles.contentContainer}>
<div style={styles.content}>
<Form state={state} actions={actions} context={context} />
</div>
</div>
)
}
export default connected(withStyles(styles)(SourceIncome))
export default connected(SourceIncome)
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
})
}
......@@ -9,21 +9,20 @@ import { maskLandline } from '@agiliza/utils/masks'
import { getBase64FromFile } from '@agiliza/utils/method'
import CPFCNPJField from '@agiliza/views/ProposalData/components/atoms/CPFCNPJField'
import { DatePicker } from '@curio/components'
import { TextField, TextFieldProps, Typography } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { Box, TextField, TextFieldProps, Typography } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import { CDSpousePersonalDataState } from '../../SpouseData/state'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {
interface Props {
state: CDSpousePersonalDataState
actions: ActionType<CDSpousePersonalDataState>
}
const Form = (props: Props) => {
const { classes, state, actions } = props
const { state, actions } = props
const styles = useStyles(useTheme())
const { mobile, landline, primaryEmail, secundaryEmail, workplace } = state
......@@ -47,17 +46,17 @@ const Form = (props: Props) => {
actions.update({ workplace: { [key]: evt.target.value } })
}
const handleChangeDate = (key: keyof Pick<Workplace, 'admissionDate'>) => (date: Date | null) => {
actions.update({ workplace: { [key]: date } })
const handleChangeDate = (key: keyof Pick<Workplace, 'admissionDate'>) => (date: unknown) => {
actions.update({ workplace: { [key]: date as Date } })
}
return (
<form className={classes.form}>
<Box component="form" sx={styles.form}>
<PhoneField label="Telefone celular" value={mobile} onChange={handleChangeText('mobile')} />
<TextField variant="outlined" label="Telefone fixo" value={maskLandline(landline)} onChange={handleChangeText('landline')} />
<TextField variant="outlined" label="Email primário" value={primaryEmail} onChange={handleChangeText('primaryEmail')} />
<TextField variant="outlined" label="Email secundário" value={secundaryEmail} onChange={handleChangeText('secundaryEmail')} />
<Typography className={classes.workplaceTitle} variant="h6">
<Typography sx={styles.workplaceTitle} variant="h6">
Local de trabalho
</Typography>
<TextField variant="outlined" label="Razão social" value={workplace?.workplaceName || ''} onChange={handleChangeWorkplace('workplaceName')} />
......@@ -68,8 +67,7 @@ const Form = (props: Props) => {
label="Data de admissão"
value={workplace?.admissionDate}
onChange={handleChangeDate('admissionDate')}
format="dd/MM/yyyy"
className={classes.datePicker}
sx={styles.datePicker}
/>
<PhoneField value={workplace?.phone} onChange={handleChangeWorkplace('phone')} />
<TextField
......@@ -79,8 +77,8 @@ const Form = (props: Props) => {
onChange={handleChangeWorkplace('netIncome')}
/>
<TextField variant="outlined" label="Cargo ou função" value={workplace?.role} onChange={handleChangeWorkplace('role')} />
</form>
</Box>
)
}
export default withStyles(styles)(Form)
export default Form
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
switchCardPhotoContainer: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-evenly' },
......
import React from 'react'
import { ActionType } from '@agiliza/utils/hooks/state'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { useTheme } from '@mui/material/styles'
import { CDSpousePersonalDataState } from '../SpouseData/state'
import Form from './Form'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {
interface Props {
state: CDSpousePersonalDataState
actions: ActionType<CDSpousePersonalDataState>
}
const SpouseAdditionalData = (props: Props) => {
const { classes, state, actions } = props
const { state, actions } = props
const styles = useStyles(useTheme())
return (
<div className={classes.contentContainer}>
<div className={classes.content}>
<div style={styles.contentContainer}>
<div style={styles.content}>
<Form state={state} actions={actions} />
</div>
</div>
)
}
export default withStyles(styles)(SpouseAdditionalData)
export default SpouseAdditionalData
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
})
}
......@@ -7,22 +7,21 @@ import { ActionType } from '@agiliza/utils/hooks/state'
import { extractNumbers, getBase64FromFile } from '@agiliza/utils/method'
import CPFCNPJField from '@agiliza/views/ProposalData/components/atoms/CPFCNPJField'
import { DatePicker, SelectField, SelectFieldProps, Switch } from '@curio/components'
import { TextField, TextFieldProps } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { Box, TextField, TextFieldProps } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import { CDSpousePersonalDataState } from '../state'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {
interface Props {
state: CDSpousePersonalDataState
actions: ActionType<CDSpousePersonalDataState>
context: ProposalDataContext
}
const Form = (props: Props) => {
const { classes, state, actions, context } = props
const { state, actions, context } = props
const styles = useStyles(useTheme())
const {
cpf,
......@@ -40,8 +39,8 @@ const Form = (props: Props) => {
dependents,
} = state
const handleChangeDate = (type: keyof Pick<CDSpousePersonalDataState, 'birthday'>) => (date: Date | null) => {
actions.update({ [type]: date })
const handleChangeDate = (type: keyof Pick<CDSpousePersonalDataState, 'birthday'>) => (date: unknown) => {
actions.update({ [type]: date as Date })
}
const handleChangeText =
......@@ -69,19 +68,12 @@ const Form = (props: Props) => {
}
return (
<form className={classes.form}>
<Box component="form" sx={styles.form}>
<CPFCNPJField value={cpf} onChange={handleChangeText('cpf')} onlyCPF />
<ImageUpload label="Certidão de casamento" image={marriageCertificate} onChangeImage={handleChangeProof} />
<TextField variant="outlined" label="Nome" value={name} onChange={handleChangeText('name')} />
<RGTemplate rg={rg} onChange={handleChangeRG} />
<DatePicker
id="admission-date"
label="Data de nascimento"
value={birthday}
onChange={handleChangeDate('birthday')}
format="dd/MM/yyyy"
className={classes.datePicker}
/>
<DatePicker id="admission-date" label="Data de nascimento" value={birthday} onChange={handleChangeDate('birthday')} sx={styles.datePicker} />
<Switch label="Usuário CRAS?" required value={userCRAS} onChange={(value) => actions.update({ userCRAS: value })} />
<TextField variant="outlined" label="Nome mãe" value={mothersName} onChange={handleChangeText('mothersName')} />
<TextField variant="outlined" label="Nome pai" value={fathersName} onChange={handleChangeText('fathersName')} />
......@@ -111,8 +103,8 @@ const Form = (props: Props) => {
onChange={handleChangeText('participationPercentage')}
/>
<TextField variant="outlined" label="Dependentes" value={extractNumbers(dependents)} onChange={handleChangeText('dependents')} />
</form>
</Box>
)
}
export default withStyles(styles)(Form)
export default Form
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
switchCardPhotoContainer: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-evenly' },
......
import React from 'react'
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 Form from './Form'
import { CDSpousePersonalDataState } from './state'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles> & ConnectedProps
type ExtendedProps = ConnectedProps
interface Props extends ExtendedProps {
state: CDSpousePersonalDataState
......@@ -16,15 +16,16 @@ interface Props extends ExtendedProps {
}
const SpouseData = (props: Props) => {
const { classes, context, state, actions } = props
const { context, state, actions } = props
const styles = useStyles(useTheme())
return (
<div className={classes.contentContainer}>
<div className={classes.content}>
<div style={styles.contentContainer}>
<div style={styles.content}>
<Form state={state} actions={actions} context={context} />
</div>
</div>
)
}
export default connected(withStyles(styles)(SpouseData))
export default connected(SpouseData)
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
})
}
......@@ -10,14 +10,14 @@ import {
DialogContent,
DialogProps,
DialogTitle
} from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
} from '@mui/material'
import { useTheme } from '@mui/material/styles'
import Form from '../Form'
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 {
onClose: () => void
......@@ -27,7 +27,8 @@ interface Props extends ExtendedProps {
}
const Dialog = (props: Props) => {
const { classes, fetching, open, onClose, onSave, vehicle } = props
const { fetching, open, onClose, onSave, vehicle } = props
const styles = useStyles(useTheme())
const formState = useFormState('VehicleForm', initialState)
......@@ -43,7 +44,7 @@ const Dialog = (props: Props) => {
}
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>{vehicle ? 'Editar' : 'Adicionar'} pessoa envolvida</DialogTitle>
<DialogContent>
<Form {...formState} />
......@@ -58,4 +59,4 @@ const Dialog = (props: Props) => {
)
}
export default withStyles(styles)(Dialog)
export default Dialog
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
dialog: { width: '80%', height: '55%' },
})
......
......@@ -6,27 +6,27 @@ import { ActionType } from '@agiliza/utils/hooks/state'
import { maskLicensePlate } from '@agiliza/utils/masks'
import { getBase64FromFile } from '@agiliza/utils/method'
import {
Box,
Checkbox,
CheckboxProps,
FormControlLabel,
FormGroup,
TextField,
TextFieldProps
} from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
} from '@mui/material'
import { useTheme } from '@mui/material/styles'
import { CDVehicleState } from '../state'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {
interface Props {
state: CDVehicleState
actions: ActionType<CDVehicleState>
}
const Form = (props: Props) => {
const { classes, state, actions } = props
const { state, actions } = props
const styles = useStyles(useTheme())
const { document, brand, licensePlate, model, year, marketValue, hasOnus, hasInsurance } = state
......@@ -51,7 +51,7 @@ const Form = (props: Props) => {
}
return (
<form className={classes.form}>
<Box component="form" sx={styles.form}>
<ImageUpload label="Documento do veículo" image={document} onChangeImage={handleChangeImage} />
<TextField variant="outlined" label="Modelo" value={model} onChange={handleChangeText('model')} />
<TextField variant="outlined" label="Marca" value={brand} onChange={handleChangeText('brand')} />
......@@ -64,15 +64,15 @@ const Form = (props: Props) => {
/>
<TextField variant="outlined" label="Ano" value={year} onChange={handleChangeText('year')} />
<TextField variant="outlined" label="Valor de mercado" value={formatCurrency(marketValue)} onChange={handleChangeText('marketValue')} />
<FormGroup row className={classes.formGroup}>
<FormGroup row sx={styles.formGroup}>
<FormControlLabel label="Possui ônus?" control={<Checkbox name="reside" checked={hasOnus} onChange={handleChangeCheckbox('hasOnus')} />} />
<FormControlLabel
label="Possui seguro?"
control={<Checkbox name="reside" checked={hasInsurance} onChange={handleChangeCheckbox('hasInsurance')} />}
/>
</FormGroup>
</form>
</Box>
)
}
export default withStyles(styles)(Form)
export default Form
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
switchCardPhotoContainer: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-evenly' },
datePicker: { marginBottom: '0px !important' },
......
......@@ -2,16 +2,16 @@ import React, { useState } from 'react'
import { Vehicle } from '@agiliza/api/domain'
import { ActionType } from '@agiliza/utils/hooks/state'
import { Avatar, List, ListItem, ListItemAvatar, ListItemText } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { Add as AddIcon, DriveEta as DriveEtaIcon } from '@material-ui/icons'
import { Add as AddIcon, DriveEta as DriveEtaIcon } from '@mui/icons-material'
import { Avatar, List, ListItem, ListItemAvatar, ListItemText } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import { connected, ConnectedProps } from './conect'
import Dialog from './Dialog'
import { CDVehicleState } from './state'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles> & ConnectedProps
type ExtendedProps = ConnectedProps
interface Props extends ExtendedProps {
projectId: string
......@@ -21,7 +21,8 @@ interface Props extends ExtendedProps {
}
const Vehicles = (props: Props) => {
const { classes, fetching, projectId, personId, vehicles } = props
const { fetching, projectId, personId, vehicles } = props
const styles = useStyles(useTheme())
const [selectedVehicle, setSelectedVehicle] = useState<Vehicle | undefined>()
......@@ -66,9 +67,9 @@ const Vehicles = (props: Props) => {
return (
<>
<div className={classes.contentContainer}>
<div className={classes.content}>
<List className={classes.list}>
<div style={styles.contentContainer}>
<div style={styles.content}>
<List sx={styles.list}>
{vehicles.map((vehicle, i) => (
<ListItem key={i} button onClick={handleClickListItem(vehicle)}>
<ListItemAvatar>
......@@ -82,7 +83,7 @@ const Vehicles = (props: Props) => {
</List>
</div>
</div>
<Avatar className={classes.avatarBtnContainer} onClick={handleClickAdd}>
<Avatar sx={styles.avatarBtnContainer} onClick={handleClickAdd}>
<AddIcon />
</Avatar>
<Dialog fetching={fetching} open={open} onClose={handleClickClose} vehicle={selectedVehicle} onSave={handleSave} />
......@@ -90,4 +91,4 @@ const Vehicles = (props: Props) => {
)
}
export default connected(withStyles(styles)(Vehicles))
export default connected(Vehicles)
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
list: { width: '100%' },
avatarBtnContainer: {
......
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../shared-styles'
// eslint-disable-next-line
export default (theme: Theme) =>
createStyles({
createSxStyles({
...sharedStyles(theme),
form: {
'& .MuiTextField-root': {
......
......@@ -9,14 +9,14 @@ import {
DialogContent,
DialogProps,
DialogTitle
} from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
} from '@mui/material'
import { useTheme } from '@mui/material/styles'
import Customer from '../Customer'
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 {
person?: InvolvedPerson
......@@ -26,7 +26,8 @@ interface Props extends ExtendedProps {
}
const AddUpdateDialog = (props: Props) => {
const { classes, open, onClose, type, person, onSave } = props
const { open, onClose, type, person, onSave } = props
const styles = useStyles(useTheme())
const { actions, state } = useFormState('involvedPersonForm', initialState)
......@@ -51,7 +52,7 @@ const AddUpdateDialog = (props: Props) => {
}
return (
<Dialog onClose={onClose} aria-labelledby="simple-dialog-title" open={open} PaperProps={{ className: classes.dialog }}>
<Dialog onClose={onClose} aria-labelledby="simple-dialog-title" open={open} PaperProps={{ sx: styles.dialog }}>
<DialogTitle>{person ? 'Editar' : 'Adicionar'} pessoa envolvida</DialogTitle>
<DialogContent>{type && renderForm(type)}</DialogContent>
<DialogActions>
......@@ -62,4 +63,4 @@ const AddUpdateDialog = (props: Props) => {
)
}
export default withStyles(styles)(AddUpdateDialog)
export default AddUpdateDialog
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
dialog: { height: '80%', width: '60%' },
})
......
......@@ -6,21 +6,20 @@ import AccountInputsPhoto from '@agiliza/components/templates/AccountInputsPhoto
import { ActionType } from '@agiliza/utils/hooks/state'
import CPFCNPJField from '@agiliza/views/ProposalData/components/atoms/CPFCNPJField'
import { SelectField, SelectFieldProps } from '@curio/components'
import { FormControlLabel, Switch, TextField, TextFieldProps } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { Box, FormControlLabel, Switch, TextField, TextFieldProps } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import { IPIdentificationState } from '../AddUpdateDialog/state'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {
interface Props {
state: IPIdentificationState
actions: ActionType<IPIdentificationState>
}
const Customer = (props: Props) => {
const { classes, state, actions } = props
const { state, actions } = props
const styles = useStyles(useTheme())
const { cpfcnpj, dataType, name, gender, hasAccount, account } = state
......@@ -54,7 +53,7 @@ const Customer = (props: Props) => {
const handleChangeValidState = (vldStt: boolean) => {}
return (
<form className={classes.form}>
<Box component="form" sx={styles.form}>
<SelectField
id="framework-select-field"
label="Enquadramento"
......@@ -75,7 +74,7 @@ const Customer = (props: Props) => {
variant="outlined"
shrink={false}
/>
<div className={classes.switchCardPhotoContainer}>
<div style={styles.switchCardPhotoContainer}>
<FormControlLabel
label="Possui conta no Banestes?"
control={
......@@ -96,8 +95,8 @@ const Customer = (props: Props) => {
/>
) : null}
</div>
</form>
</Box>
)
}
export default withStyles(styles)(Customer)
export default Customer
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
form: {
'& .MuiTextField-root': {
......
......@@ -4,20 +4,18 @@ import { people } from '@agiliza/__mocks__/proposalData/involvedPeople'
import { InvolvedPerson, InvolvedPersonType } from '@agiliza/api/domain'
import { INVOLVED_PERSON_IDS, INVOLVED_PERSON_NAMES } from '@agiliza/constants/involvedPeople'
import { maskCPFCNPJ } from '@agiliza/utils/masks'
import { Avatar, List, ListItem, ListItemAvatar, ListItemText, Typography } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { Add as AddIcon, Person as PersonIcon } from '@material-ui/icons'
import { Add as AddIcon, Person as PersonIcon } from '@mui/icons-material'
import { Avatar, List, ListItem, ListItemAvatar, ListItemText, Typography } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import AddUpdateDialog from './AddUpdateDialog'
import SelectTypeDialog from './SelectTypeDialog'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {}
interface Props {}
const Identification = (props: Props) => {
const { classes } = props
const styles = useStyles(useTheme())
const [open, setOpen] = useState({ type: false, form: false })
const [type, setType] = useState<InvolvedPersonType | ''>('')
......@@ -43,10 +41,10 @@ const Identification = (props: Props) => {
return (
<>
<div className={classes.contentContainer}>
<div className={classes.content}>
<Typography className={classes.title}>Identicação</Typography>
<List className={classes.list}>
<div style={styles.contentContainer}>
<div style={styles.content}>
<Typography sx={styles.title}>Identicação</Typography>
<List sx={styles.list}>
{people.map((person, i) => (
<ListItem key={i} button onClick={handleClickListItem(person)}>
<ListItemAvatar>
......@@ -64,7 +62,7 @@ const Identification = (props: Props) => {
</div>
</div>
<Avatar
className={classes.avatarBtnContainer}
sx={styles.avatarBtnContainer}
onClick={handleClickAdd}
// rounded
// Component={TouchableOpacity}
......@@ -83,4 +81,4 @@ const Identification = (props: Props) => {
)
}
export default withStyles(styles)(Identification)
export default Identification
import React from 'react'
import { InvolvedPersonType } from '@agiliza/api/domain'
import { Dialog, DialogProps, List, ListItem, ListItemText } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { Dialog, DialogProps, List, ListItem, ListItemText } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = Pick<DialogProps, 'open' | 'onClose'> & WithStyles<typeof styles>
type ExtendedProps = Pick<DialogProps, 'open' | 'onClose'>
interface Props extends ExtendedProps {
onSelectType(type: InvolvedPersonType): () => void
}
const SelectTypeDialog = (props: Props) => {
const { classes, open, onClose, onSelectType } = props
const { open, onClose, onSelectType } = props
const styles = useStyles(useTheme())
return (
<Dialog onClose={onClose} aria-labelledby="simple-dialog-title" open={open} PaperProps={{ className: classes.dialog }}>
<Dialog onClose={onClose} aria-labelledby="simple-dialog-title" open={open} PaperProps={{ sx: styles.dialog }}>
<List>
<ListItem button onClick={onSelectType('CUSTOMER')}>
<ListItemText primary="Cliente" className={classes.listItemText} />
<ListItemText primary="Cliente" sx={styles.listItemText} />
</ListItem>
<ListItem button onClick={onSelectType('GUARANTOR')}>
<ListItemText primary="Avalista" className={classes.listItemText} />
<ListItemText primary="Avalista" sx={styles.listItemText} />
</ListItem>
<ListItem button>
<ListItemText primary="Sócio" onClick={onSelectType('PARTNER')} className={classes.listItemText} />
<ListItemText primary="Sócio" onClick={onSelectType('PARTNER')} sx={styles.listItemText} />
</ListItem>
</List>
</Dialog>
)
}
export default withStyles(styles)(SelectTypeDialog)
export default SelectTypeDialog
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
return createStyles({
return createSxStyles({
...sharedStyles(theme),
dialog: { width: '20%' },
listItemText: { textAlign: 'center' },
......
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) => {
const width = '100%'
return createStyles({
return createSxStyles({
...sharedStyles(theme),
list: { width },
avatarBtnContainer: {
......
import React, { ChangeEvent, useState } from 'react'
import React, { useState } from 'react'
import { Tab } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import {
AccountBox as AccountBoxIcon,
CheckBox as CheckBoxIcon,
......@@ -11,11 +9,13 @@ import {
List as ListIcon,
LocalAtm as LocalAtmIcon,
ZoomOutMap as ZoomOutMapIcon
} from '@material-ui/icons'
import { TabContext, TabList, TabPanel } from '@material-ui/lab'
} from '@mui/icons-material'
import { TabContext, TabList, TabListProps, TabPanel } from '@mui/lab'
import { Tab } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import Identification from './Identification'
import styles from './styles'
import useStyles from './styles'
export const involvedPeopleItems = [
{ label: 'Identificação', icon: <AccountBoxIcon />, component: <Identification /> },
......@@ -28,34 +28,25 @@ export const involvedPeopleItems = [
{ label: 'Moradia', icon: <HomeIcon />, component: <div>Moradia</div> },
]
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {}
interface Props {}
const InvolvedPeople = (props: Props) => {
const { classes } = props
const styles = useStyles(useTheme())
const [tab, setTab] = useState('0')
const handleChange = (evt: ChangeEvent<Record<string, unknown>>, newValue: number) => {
const handleChange: TabListProps['onChange'] = (evt, newValue) => {
setTab(newValue.toString())
}
return (
<div className={classes.contentContainer}>
<div style={styles.contentContainer}>
<TabContext value={tab}>
<TabList
orientation="vertical"
variant="scrollable"
value={tab}
onChange={handleChange}
aria-label="Vertical tabs example"
className={classes.tabs}
>
<TabList orientation="vertical" variant="scrollable" value={tab} onChange={handleChange} aria-label="Vertical tabs example" sx={styles.tabs}>
{involvedPeopleItems.map(({ component, ...tb }, i) => (
<Tab wrapped key={i} {...tb} value={i.toString()} />
))}
</TabList>
<div className={classes.content}>
<div style={styles.content}>
{involvedPeopleItems.map((tb, i) => (
<TabPanel key={i} value={i.toString()}>
{tb.component}
......@@ -67,4 +58,4 @@ const InvolvedPeople = (props: Props) => {
)
}
export default withStyles(styles)(InvolvedPeople)
export default InvolvedPeople
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../shared-styles'
// eslint-disable-next-line
export default (theme: Theme) =>
createStyles({
createSxStyles({
...sharedStyles(theme),
contentContainer: { display: 'flex', flexDirection: 'column', alignItems: 'center', flexGrow: 1, overflowY: 'auto' },
content: {
......
......@@ -5,8 +5,6 @@ import ButtonWithProgress from '@agiliza/components/atoms/ButtonWithProgress'
import { useFormState } from '@agiliza/utils/hooks/state'
import { entries } from '@agiliza/utils/method'
import { CREDIT_LINES_PATHS } from '@agiliza/views/SimulationCreditLines/pages/router'
import { Button, CircularProgress, MobileStepper, Typography } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import {
AccountBox as AccountBoxIcon,
Apartment as ApartmentIcon,
......@@ -22,7 +20,9 @@ import {
List as ListIcon,
LocalAtm as LocalAtmIcon,
ZoomOutMap as ZoomOutMapIcon
} from '@material-ui/icons'
} from '@mui/icons-material'
import { Button, CircularProgress, MobileStepper, Typography } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import BDAddress, { initialState as bdAddressInitState } from './BusinessData/Address'
import BDIdentification, {
......@@ -44,7 +44,7 @@ import SourceIncome, { initialState as cdSourceIncomeInitState } from './Custome
import SpouseAdditionalData from './CustomerData/SpouseAdditionalData'
import SpouseData, { initialState as cdSpouseDataInitState } from './CustomerData/SpouseData'
import Vehicles, { initialState as cdVehicleInitState } from './CustomerData/Vehicles'
import styles from './shared-styles'
import useStyles from './shared-styles'
export const PROPOSAL_DATA_PATHS = {
selectOption: '/selecionarOpcao',
......@@ -56,12 +56,14 @@ export interface ProposalDataRouteState {
proposalId: string
}
type ExtendedProps = WithStyles<typeof styles> & RouteComponentProps & ConnectedProps
type ExtendedProps = RouteComponentProps & ConnectedProps
interface Props extends ExtendedProps {}
const ProposalData = (props: Props) => {
const { classes, history, fetching, proposalId, personId, customerData, businessData } = props
const { history, fetching, proposalId, personId, customerData, businessData } = props
const styles = useStyles(useTheme())
const [activeStep, setActiveStep] = useState(0)
useEffect(() => {
......@@ -325,16 +327,16 @@ const ProposalData = (props: Props) => {
}
return (
<div className={classes.pageContent}>
<Typography className={classes.pageTitle} variant="h5">
<div style={styles.pageContent}>
<Typography sx={styles.pageTitle} variant="h5">
{mapActiveStepToTitle()}
</Typography>
<Typography className={classes.pageSubtitle}>{proposalDataItems[activeStep].label}</Typography>
<div className={classes.stepContentContainer}>
{fetching ? <CircularProgress className={classes.circularProgress} /> : proposalDataItems[activeStep].component}
<Typography sx={styles.pageSubtitle}>{proposalDataItems[activeStep].label}</Typography>
<div style={styles.stepContentContainer}>
{fetching ? <CircularProgress style={styles.circularProgress} /> : proposalDataItems[activeStep].component}
</div>
<div className={classes.stepperContainer}>
{/* <Stepper activeStep={activeStep} alternativeLabel className={classes.stepper}> */}
<div style={styles.stepperContainer}>
{/* <Stepper activeStep={activeStep} alternativeLabel style={styles.stepper}> */}
{/* {propostalDataItems.map((iPI, i) => (
<Step key={i}>
<StepLabel>{iPI.label}</StepLabel>
......@@ -347,7 +349,7 @@ const ProposalData = (props: Props) => {
activeStep={activeStep}
style={{ width: '100%' }}
nextButton={
<ButtonWithProgress fetching={fetching} variant="text" size="large" onClick={handleNext} className={classes.stepperBtn}>
<ButtonWithProgress fetching={fetching} variant="text" size="large" onClick={handleNext} sx={styles.stepperBtn}>
{activeStep === steps - 1 ? (
'Finalizar'
) : (
......@@ -359,7 +361,7 @@ const ProposalData = (props: Props) => {
</ButtonWithProgress>
}
backButton={
<Button size="large" onClick={handleBack} disabled={activeStep === 0} className={classes.stepperBtn}>
<Button size="large" onClick={handleBack} disabled={activeStep === 0} style={styles.stepperBtn}>
<KeyboardArrowLeftIcon />
Anterior
</Button>
......@@ -371,4 +373,4 @@ const ProposalData = (props: Props) => {
)
}
export default connected(withStyles(styles)(ProposalData))
export default connected(ProposalData)
import React from 'react'
import { Avatar, ListItem, ListItemAvatar, ListItemText } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { Avatar, ListItem, ListItemAvatar, ListItemText } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {
interface Props {
label: string
icon: JSX.Element
onClick?: () => void
}
const GridItem = (props: Props) => {
const { classes, icon, label, onClick } = props
const { icon, label, onClick } = props
const styles = useStyles(useTheme())
return (
<ListItem button onClick={onClick} className={classes.listItem}>
<ListItem button onClick={onClick} sx={styles.listItem}>
<ListItemAvatar>
<Avatar className={classes.avatar}>{icon}</Avatar>
<Avatar sx={styles.avatar}>{icon}</Avatar>
</ListItemAvatar>
<ListItemText primary={label} />
</ListItem>
......@@ -29,4 +28,4 @@ const GridItem = (props: Props) => {
)
}
export default withStyles(styles)(GridItem)
export default GridItem
import React from 'react'
import { RouteComponentProps } from 'react-router'
import { List } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import {
CheckBox as CheckBoxIcon,
Description as DescriptionIcon,
......@@ -11,42 +9,45 @@ import {
ThumbUp as ThumbUpIcon,
TrendingUp as TrendingUpIcon,
VisibilityOff as VisibilityOffIcon
} from '@material-ui/icons'
} from '@mui/icons-material'
import { List } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import { PROPOSAL_DATA_PATHS } from '../ProposalData'
import ListItem from './ListItem'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles> & RouteComponentProps
type ExtendedProps = RouteComponentProps
interface Props extends ExtendedProps {}
const SelectOption = (props: Props) => {
const { classes, history } = props
const { history } = props
const styles = useStyles(useTheme())
return (
<div className={classes.contentContainer}>
<div className={classes.content}>
<List component="nav" className={classes.list}>
<div style={styles.contentContainer}>
<div style={styles.content}>
<List component="nav" sx={styles.list}>
<ListItem
label="Pessoas envolvidas"
icon={<PersonIcon className={classes.listItemIcon} />}
icon={<PersonIcon sx={styles.listItemIcon} />}
onClick={() => history.push(PROPOSAL_DATA_PATHS.involvedPeople)}
/>
<ListItem
label="Dados de negócio"
icon={<SettingsIcon className={classes.listItemIcon} />}
icon={<SettingsIcon sx={styles.listItemIcon} />}
onClick={() => history.push(PROPOSAL_DATA_PATHS.businessData)}
/>
<ListItem label="LSE" icon={<TrendingUpIcon className={classes.listItemIcon} />} />
<ListItem label="Solicitação" icon={<ThumbUpIcon className={classes.listItemIcon} />} />
<ListItem label="Parecer" icon={<VisibilityOffIcon className={classes.listItemIcon} />} />
<ListItem label="Resumo" icon={<DescriptionIcon className={classes.listItemIcon} />} />
<ListItem label="Checklist do Projeto" icon={<CheckBoxIcon className={classes.listItemIcon} />} />
<ListItem label="LSE" icon={<TrendingUpIcon sx={styles.listItemIcon} />} />
<ListItem label="Solicitação" icon={<ThumbUpIcon sx={styles.listItemIcon} />} />
<ListItem label="Parecer" icon={<VisibilityOffIcon sx={styles.listItemIcon} />} />
<ListItem label="Resumo" icon={<DescriptionIcon sx={styles.listItemIcon} />} />
<ListItem label="Checklist do Projeto" icon={<CheckBoxIcon sx={styles.listItemIcon} />} />
</List>
</div>
</div>
)
}
export default withStyles(styles)(SelectOption)
export default SelectOption
import { grey } from '@material-ui/core/colors'
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { grey } from '@mui/material/colors'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../shared-styles'
// eslint-disable-next-line
export default (theme: Theme) =>
createStyles({
createSxStyles({
...sharedStyles(theme),
contentContainer: { display: 'flex', justifyContent: 'center', width: '100%', height: '100%' },
content: { display: 'flex', flexDirection: 'column', width: '100%' },
......
......@@ -3,8 +3,8 @@ import { Redirect, Route, RouteComponentProps, Switch } from 'react-router'
import { entries } from '@agiliza/utils/method'
import { PATHS } from '@agiliza/views/Main/DrawerItems'
import { Breadcrumbs, CircularProgress, Link } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { Breadcrumbs, CircularProgress, Link } from '@mui/material'
import { withStyles, WithStyles } from '@mui/material/styles'
import styles from './shared-styles'
......
import { createSxStyles } from '@agiliza/theme'
import sharedStyles from '@agiliza/views/shared-styles'
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { Theme } from '@mui/material/styles'
// eslint-disable-next-line
export default (theme: Theme) =>
createStyles({
createSxStyles({
...sharedStyles(theme),
title: { marginBottom: theme.spacing(2) },
link: { cursor: 'pointer' },
......
......@@ -6,7 +6,9 @@ import { SimulationCategory } from '@agiliza/api/domain'
import { extractCurrency, extractNumbers } from '@agiliza/utils/extractors'
import { formatCurrency } from '@agiliza/utils/formatters'
import { SelectField } from '@curio/components'
import { Refresh as RefreshIcon } from '@mui/icons-material'
import {
Autocomplete,
Button,
CircularProgress,
IconButton,
......@@ -14,24 +16,23 @@ import {
TextareaAutosize,
TextField,
Typography
} from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { Refresh as RefreshIcon } from '@material-ui/icons'
import { Autocomplete } from '@material-ui/lab'
} from '@mui/material'
import { useTheme } from '@mui/material/styles'
import { CREDIT_LINES_PATHS, SimulationRouteState } from '../router'
import { connected, ConnectedProps } from './connect'
import SliderField from './SliderField'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles> & RouteComponentProps & ConnectedProps
type ExtendedProps = RouteComponentProps & ConnectedProps
interface Props extends ExtendedProps {
fetching: boolean
}
const CreditLinesList = (props: Props) => {
const { classes, fetching, simulationCategories } = props
const { fetching, simulationCategories } = props
const styles = useStyles(useTheme())
useEffect(() => {
props.fetchSimulationCategories()
......@@ -63,18 +64,18 @@ const CreditLinesList = (props: Props) => {
}
return (
<div className={classes.pageContent}>
<div className={classes.contentContainer}>
<div className={classes.content}>
<Typography variant="h5" className={classes.title}>
<div style={styles.pageContent}>
<div style={styles.contentContainer}>
<div style={styles.content}>
<Typography variant="h5" sx={styles.title}>
Escolha a melhor opção para sua empresa e clique em simular!
</Typography>
<Autocomplete<SimulationCategory>
id="credit-lines"
className={classes.creditLinesAutocomplete}
sx={styles.creditLinesAutocomplete}
options={simulationCategories}
getOptionLabel={(option) => option.description}
getOptionSelected={(opt, val) => opt.id === selectedSimulCategory?.id}
isOptionEqualToValue={(opt, val) => opt.id === selectedSimulCategory?.id}
noOptionsText="Nenhum motivo encontrado..."
value={selectedSimulCategory}
onChange={(_, opt) => {
......@@ -124,7 +125,7 @@ const CreditLinesList = (props: Props) => {
}}
/>
<TextField
className={classes.description}
sx={styles.description}
label="Descrição"
value={selectedSimulCategory?.fullDescription || ''}
rows={5}
......@@ -145,10 +146,10 @@ const CreditLinesList = (props: Props) => {
onChange={(vl) => setDestination(vl)}
items={destinations.map((st) => ({ label: st.description, value: st.id }))}
shrink={false}
className={classes.destinationsSelect}
sx={styles.destinationsSelect}
/>
<SliderField
className={classes.sliderField}
sx={styles.sliderField}
title="De quanto você precisa?"
// sliderProps={{
// min: 0,
......@@ -178,7 +179,7 @@ const CreditLinesList = (props: Props) => {
}}
/>
<SliderField
className={classes.sliderField}
sx={styles.sliderField}
title="Quantos meses para pagar?"
sliderProps={{
min: 0,
......@@ -208,7 +209,7 @@ const CreditLinesList = (props: Props) => {
}}
/>
<SliderField
className={classes.sliderField}
sx={styles.sliderField}
title="Quantos meses de carência?"
sliderProps={{
min: 0,
......@@ -235,7 +236,7 @@ const CreditLinesList = (props: Props) => {
setGraceMonths(graceMonthsValue <= selectedSimulCategory.maxGraceMonths ? graceMonthsValue : selectedSimulCategory.maxGraceMonths)
}}
/>
<div className={classes.btnContainer}>
<div style={styles.btnContainer}>
<Button disabled={!selectedSimulCategory} variant="contained" color="secondary" onClick={handleSimulate}>
Simular
</Button>
......@@ -246,4 +247,4 @@ const CreditLinesList = (props: Props) => {
)
}
export default connected(withStyles(styles)(CreditLinesList))
export default connected(CreditLinesList)
import React from 'react'
import { Slider, SliderProps, TextField, TextFieldProps, Typography } from '@material-ui/core'
import {
Box,
BoxProps,
Slider,
SliderProps,
TextField,
TextFieldProps,
Typography
} from '@mui/material'
type ExtendedProps = Record<string, unknown>
......@@ -8,21 +16,21 @@ interface Props extends ExtendedProps {
title: string
valueField: string
sliderProps?: Pick<SliderProps, 'min' | 'max' | 'marks' | 'step'> & {
onChange: (event: React.ChangeEvent<Record<string, unknown>>, value: number | number[]) => void
onChange: SliderProps['onChange']
value: number
}
disabled: boolean
onChangeField: TextFieldProps['onChange']
onBlurField: TextFieldProps['onBlur']
className?: string
suffix?: string
sx?: BoxProps['sx']
}
const SliderField = (props: Props) => {
const { className, title, valueField, disabled, onChangeField, onBlurField, suffix, sliderProps } = props
const { sx, title, valueField, disabled, onChangeField, onBlurField, suffix, sliderProps } = props
const { step = 1 } = sliderProps || { step: 1 }
return (
<div className={className}>
<Box component="div" sx={sx}>
<Typography gutterBottom>{title}</Typography>
{sliderProps && <Slider {...sliderProps} disabled={disabled} step={step} />}
<TextField
......@@ -32,8 +40,9 @@ const SliderField = (props: Props) => {
onChange={onChangeField}
onBlur={onBlurField}
InputProps={{ endAdornment: suffix && <Typography>{suffix}</Typography> }}
variant="standard"
/>
</div>
</Box>
)
}
......
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../shared-styles'
// eslint-disable-next-line
export default (theme: Theme) =>
createStyles({
createSxStyles({
...sharedStyles(theme),
contentContainer: { display: 'flex', justifyContent: 'center', width: '100%', overflowY: 'auto' },
content: { display: 'flex', flexDirection: 'column', alignItems: 'center', width: '50%' },
......
import React from 'react'
import { RouteComponentProps } from 'react-router'
import { Button, Typography } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { Button, Typography } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import { connected, ConnectedProps } from './connect'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles> & RouteComponentProps & ConnectedProps
type ExtendedProps = RouteComponentProps & ConnectedProps
interface Props extends ExtendedProps {}
const FinishSimulation = (props: Props) => {
const { classes, history } = props
const { history } = props
const styles = useStyles(useTheme())
const handleClick = () => {
props.reset()
history.push('/')
}
return (
<div className={classes.pageContent}>
<div className={classes.titleContainer}>
<div style={styles.pageContent}>
<div style={styles.titleContainer}>
<Typography variant="h4">Sua proposta foi submetida com sucesso!</Typography>
<Typography variant="h6">Agora é só aguardar que entraremos em contato!</Typography>
</div>
......@@ -31,4 +32,4 @@ const FinishSimulation = (props: Props) => {
)
}
export default connected(withStyles(styles)(FinishSimulation))
export default connected(FinishSimulation)
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material/styles'
import sharedStyles from '../shared-styles'
// eslint-disable-next-line
export default (theme: Theme) =>
createStyles({
createSxStyles({
...sharedStyles(theme),
pageContent: { ...sharedStyles(theme).pageContent, height: '70%', alignItems: 'center', justifyContent: 'center' },
titleContainer: {
......
......@@ -5,15 +5,15 @@ import { SubProduct } from '@agiliza/api/domain'
import { AMORTIZATIONS } from '@agiliza/constants/amortization'
import { formatCurrency } from '@agiliza/utils/formatters'
import { SelectField } from '@curio/components'
import { Button, Grid } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { Box, Button, Grid } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import { connected, ConnectedProps } from './connect'
import GridLine from './GridLine'
import InstallmentsDialog from './InstallmentsDialog'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles> & ConnectedProps
type ExtendedProps = ConnectedProps
interface Props extends ExtendedProps {
subproduct?: SubProduct
......@@ -21,7 +21,8 @@ interface Props extends ExtendedProps {
}
const CreditLinesInfo = (props: Props) => {
const { classes, subproducts, subproduct, onChangeSubproduct } = props
const styles = useStyles(useTheme())
const { subproducts, subproduct, onChangeSubproduct } = props
// const [selectedSP, setSelectedSP] = useState<SubProduct | undefined>()
const [open, setOpen] = useState(false)
......@@ -31,11 +32,11 @@ const CreditLinesInfo = (props: Props) => {
}, [subproducts])
return (
<div className={classes.contentContainer}>
<div className={classes.content}>
<Box sx={styles.contentContainer}>
<Box sx={styles.content}>
<SelectField
id="subproducts"
className={classes.selectField}
sx={styles.selectField}
label="Opções de Subproduto"
items={subproducts.map((sp) => ({ label: sp.description || '', value: sp.id }))}
value={subproduct?.id || ''}
......@@ -45,7 +46,7 @@ const CreditLinesInfo = (props: Props) => {
}}
shrink={false}
/>
<Grid container className={classes.gridContainer}>
<Grid container sx={styles.gridContainer}>
<GridLine label="Número de parcelas" value={subproduct?.maxAmountInstallment || ''} />
{/* <GridLine label="Valor das parcelas" value={formatCurrency(subproduct?.amount.toFixed(2))} /> */}
<GridLine label="Taxa de juros" value={subproduct?.fee ? `${subproduct?.fee} %` : ''} />
......@@ -65,9 +66,9 @@ const CreditLinesInfo = (props: Props) => {
Exibir opções de parcelamento
</Button>
<InstallmentsDialog open={open} onClose={() => setOpen(false)} installmentOptions={subproduct?.installementOptions} />
</div>
</div>
</Box>
</Box>
)
}
export default connected(withStyles(styles)(CreditLinesInfo))
export default connected(CreditLinesInfo)
import React from 'react'
import { Grid, Typography } from '@material-ui/core'
import { Grid, Typography } from '@mui/material'
type ExtendedProps = Record<string, unknown>
......
......@@ -11,12 +11,12 @@ import {
DialogTitle,
Grid,
Typography
} from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
} from '@mui/material'
import { useTheme } from '@mui/material/styles'
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 {
onClose: () => void
......@@ -24,21 +24,22 @@ interface Props extends ExtendedProps {
}
const InstallmentsDialog = (props: Props) => {
const { classes, open, onClose, installmentOptions } = props
const styles = useStyles(useTheme())
const { open, onClose, installmentOptions } = props
return (
<Dialog onClose={onClose} aria-labelledby="simple-dialog-title" open={open} PaperProps={{ className: classes.dialog }}>
<Dialog onClose={onClose} aria-labelledby="simple-dialog-title" open={open} PaperProps={{ sx: styles.dialog }}>
<DialogTitle>Tipos de parcelamento</DialogTitle>
<DialogContent>
<Grid container className={classes.gridContainer}>
<Grid container sx={styles.gridContainer}>
<Grid item xs={6}>
<Typography className={classes.gridHeaderText}>Número de parcelas</Typography>
<Typography sx={styles.gridHeaderText}>Número de parcelas</Typography>
</Grid>
<Grid item xs={3}>
<Typography className={classes.gridHeaderText}>Valor parcela</Typography>
<Typography sx={styles.gridHeaderText}>Valor parcela</Typography>
</Grid>
<Grid item xs={3}>
<Typography className={classes.gridHeaderText}>Valor total</Typography>
<Typography sx={styles.gridHeaderText}>Valor total</Typography>
</Grid>
</Grid>
{installmentOptions?.map((iO) => (
......@@ -65,4 +66,4 @@ const InstallmentsDialog = (props: Props) => {
)
}
export default withStyles(styles)(InstallmentsDialog)
export default InstallmentsDialog
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) =>
createStyles({
...sharedStyles(theme),
createSxStyles({
...sharedStyles,
gridContainer: { marginBottom: theme.spacing(1) },
dialog: { height: '45%', width: '65%' },
gridHeaderText: { fontWeight: 'bold' },
......
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) =>
createStyles({
const styles = (theme: Theme) =>
createSxStyles({
...sharedStyles(theme),
gridContainer: { marginBottom: theme.spacing(2) },
gridItem: { whiteSpace: 'nowrap' },
selectField: { marginBottom: theme.spacing(2) },
})
export default styles
......@@ -4,24 +4,25 @@ import { RouteComponentProps } from 'react-router'
import { SubProduct } from '@agiliza/api/domain'
import { extractNumbers } from '@agiliza/utils/method'
import { PATHS } from '@agiliza/views/Main/DrawerItems'
import { Button, Step, StepLabel, Stepper } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import {
KeyboardArrowLeft as KeyboardArrowLeftIcon,
KeyboardArrowRight as KeyboardArrowRightIcon
} from '@material-ui/icons'
} from '@mui/icons-material'
import { Box, Button, Step, StepLabel, Stepper } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import { connected, ConnectedProps } from './connect'
import CreditLinesInfo from './CreditLinesInfo'
import styles from './styles'
import useStyles from './styles'
import UserForm from './UserForm'
type ExtendedProps = WithStyles<typeof styles> & RouteComponentProps & ConnectedProps
type ExtendedProps = RouteComponentProps & ConnectedProps
interface Props extends ExtendedProps {}
const Simulation = (props: Props) => {
const { classes, customer, simulationData, ...routerProps } = props
const { customer, simulationData, ...routerProps } = props
const styles = useStyles(useTheme())
const { history } = routerProps
// const theme = useTheme()
const [activeStep, setActiveStep] = useState(0)
......@@ -74,14 +75,14 @@ const Simulation = (props: Props) => {
}, [activeStep, subproduct, customer])
return (
<div className={classes.pageContent}>
<div className={classes.stepContentContainer}>{renderStep(activeStep)}</div>
<div className={classes.stepperContainer}>
<Button size="large" onClick={handleBack} disabled={activeStep === 0} className={classes.stepperBtn}>
<Box sx={styles.pageContent}>
<Box sx={styles.stepContentContainer}>{renderStep(activeStep)}</Box>
<Box sx={styles.stepperContainer}>
<Button size="large" onClick={handleBack} disabled={activeStep === 0} sx={styles.stepperBtn}>
<KeyboardArrowLeftIcon />
Anterior
</Button>
<Stepper activeStep={activeStep} className={classes.stepper}>
<Stepper activeStep={activeStep} sx={styles.stepper}>
<Step>
<StepLabel>Informações linha de crédito</StepLabel>
</Step>
......@@ -89,7 +90,7 @@ const Simulation = (props: Props) => {
<StepLabel>Dados pessoais</StepLabel>
</Step>
</Stepper>
<Button size="large" onClick={handleNext} disabled={!canGoForward} className={classes.stepperBtn}>
<Button size="large" onClick={handleNext} disabled={!canGoForward} sx={styles.stepperBtn}>
{activeStep === steps - 1 ? (
'Finalizar'
) : (
......@@ -104,7 +105,7 @@ const Simulation = (props: Props) => {
steps={steps}
position="static"
activeStep={activeStep}
className={classes.stepper}
sx={styles.stepper}
nextButton={
<Button size="small" onClick={handleNext} disabled={!canGoForward || activeStep === steps}>
Próximo
......@@ -118,9 +119,9 @@ const Simulation = (props: Props) => {
</Button>
}
/> */}
</div>
</div>
</Box>
</Box>
)
}
export default connected(withStyles(styles)(Simulation))
export default connected(Simulation)
import React from 'react'
import TextFieldWithIcon from '@agiliza/components/atoms/TextFieldWithIcon'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { Box } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {
interface Props {
password: string
confirmPassword: string
onChange(type: 'password' | 'confirmPassword'): (value: string) => void
}
const CreatePassword = (props: Props) => {
const { classes, password, confirmPassword, onChange } = props
const styles = useStyles(useTheme())
const { password, confirmPassword, onChange } = props
return (
<div className={classes.dialogContent}>
<Box sx={styles.dialogContent}>
<TextFieldWithIcon label="Senha" value={password} onChange={(evt) => onChange('password')(evt.target.value)} type="password" />
<TextFieldWithIcon
label="Confirmar senha"
......@@ -24,8 +24,8 @@ const CreatePassword = (props: Props) => {
onChange={(evt) => onChange('confirmPassword')(evt.target.value)}
type="password"
/>
</div>
</Box>
)
}
export default withStyles(styles)(CreatePassword)
export default CreatePassword
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) =>
createStyles({
createSxStyles({
...sharedStyles(theme),
title: { marginBottom: theme.spacing(2) },
})
......@@ -5,6 +5,10 @@ import FirstAccessTemplate, { initState } from '@agiliza/components/templates/Fi
import { useFormState } from '@agiliza/utils/hooks/state'
import { values } from '@agiliza/utils/method'
import { isValidCPF } from '@agiliza/utils/validators'
import {
KeyboardArrowLeft as KeyboardArrowLeftIcon,
KeyboardArrowRight as KeyboardArrowRightIcon
} from '@mui/icons-material'
import {
Button,
Dialog,
......@@ -13,27 +17,24 @@ import {
DialogProps,
DialogTitle,
MobileStepper
} from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import {
KeyboardArrowLeft as KeyboardArrowLeftIcon,
KeyboardArrowRight as KeyboardArrowRightIcon
} from '@material-ui/icons'
} from '@mui/material'
import { useTheme } from '@mui/material/styles'
import { connected, ConnectedProps } from './connect'
import CreatePassword from './CreatePassword'
import styles from './styles'
import useStyles from './styles'
import VerifyCode from './VerifyCode'
import VerifyCPF from './VerifyCPF'
type ExtendedProps = Pick<DialogProps, 'open'> & WithStyles<typeof styles> & ConnectedProps
type ExtendedProps = Pick<DialogProps, 'open'> & ConnectedProps
interface Props extends ExtendedProps {
onClose: () => void
}
const FirstAccessDialog = (props: Props) => {
const { classes, open, onClose, context, fetching, sendingCode } = props
const { open, onClose, context, fetching, sendingCode } = props
const styles = useStyles(useTheme())
const { state, actions } = useFormState('firstAccessForm', initState)
const [code, setCode] = useState('')
......@@ -126,7 +127,7 @@ const FirstAccessDialog = (props: Props) => {
}
return (
<Dialog onClose={onClose} aria-labelledby="simple-dialog-title" open={open} PaperProps={{ className: classes.dialog }}>
<Dialog onClose={onClose} aria-labelledby="simple-dialog-title" open={open} PaperProps={{ sx: styles.dialog }}>
<DialogTitle>Primeiro acesso</DialogTitle>
<DialogContent>{renderStep(activeStep)}</DialogContent>
<DialogActions>
......@@ -135,7 +136,7 @@ const FirstAccessDialog = (props: Props) => {
steps={steps}
position="static"
activeStep={activeStep}
className={classes.stepper}
sx={styles.stepper}
nextButton={
<ButtonWithProgress
fetching={fetching || sendingCode}
......@@ -166,4 +167,4 @@ const FirstAccessDialog = (props: Props) => {
)
}
export default connected(withStyles(styles)(FirstAccessDialog))
export default connected(FirstAccessDialog)
import React from 'react'
import { maskCPFCNPJ } from '@agiliza/utils/masks'
import { TextField, Typography } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { Box, TextField, Typography } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {
interface Props {
cpf: string
onChange: (value: string) => void
}
const VerifyCPF = (props: Props) => {
const { classes, cpf, onChange } = props
const { cpf, onChange } = props
const styles = useStyles(useTheme())
return (
<div className={classes.dialogContent}>
<Typography className={classes.title}>Informe o seu CPF</Typography>
<Box sx={styles.dialogContent}>
<Typography sx={styles.title}>Informe o seu CPF</Typography>
<TextField
variant="outlined"
// label="CPF"
......@@ -25,8 +24,8 @@ const VerifyCPF = (props: Props) => {
onChange={(evt) => onChange(evt.target.value)}
inputProps={{ maxLength: 14 }}
/>
</div>
</Box>
)
}
export default withStyles(styles)(VerifyCPF)
export default VerifyCPF
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) =>
createStyles({
createSxStyles({
...sharedStyles(theme),
title: { marginBottom: theme.spacing(2) },
})
import React from 'react'
import { extractNumbers } from '@agiliza/utils/method'
import { Button, TextField, Typography } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { Box, Button, TextField, Typography } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import styles from './styles'
import useStyles from './styles'
type ExtendedProps = WithStyles<typeof styles>
interface Props extends ExtendedProps {
interface Props {
code: string
onChange: (value: string) => void
onResendCode: () => void
}
const VerifyCode = (props: Props) => {
const { classes, code, onChange } = props
const { code, onChange } = props
const styles = useStyles(useTheme())
return (
<div className={classes.dialogContent}>
<Typography className={classes.title}>Foi enviado um código de verificação por email.</Typography>
<Box sx={styles.dialogContent}>
<Typography sx={styles.title}>Foi enviado um código de verificação por email.</Typography>
<TextField variant="outlined" value={code} onChange={(evt) => onChange(extractNumbers(evt.target.value))} inputProps={{ maxLength: 14 }} />
<div style={{ display: 'flex', width: '100%', justifyContent: 'flex-end' }} onClick={props.onResendCode}>
<Button>Re-enviar código</Button>
</div>
</div>
</Box>
)
}
export default withStyles(styles)(VerifyCode)
export default VerifyCode
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) =>
createStyles({
createSxStyles({
...sharedStyles(theme),
title: { marginBottom: theme.spacing(2) },
})
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) =>
createStyles({
...sharedStyles(theme),
createSxStyles({
...sharedStyles,
gridContainer: { marginBottom: theme.spacing(1) },
dialog: { height: '60%', width: '65%' },
gridHeaderText: { fontWeight: 'bold' },
......
......@@ -4,12 +4,12 @@ import ButtonWithProgress from '@agiliza/components/atoms/ButtonWithProgress'
import LoginTemplate from '@agiliza/components/templates/Login'
import { formatCPF } from '@agiliza/utils/formatters'
import { extractNumbers } from '@agiliza/utils/method'
import { Button, TextFieldProps, Typography } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { Box, Button, TextFieldProps, Typography } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import { connected, ConnectedProps } from './connect'
import FirstAccessDialog from './FirstAccessDialog'
import styles from './styles'
import useSyles from './styles'
// interface UserFormFieldProps extends Pick<TextFieldProps, 'label' | 'value' | 'onChange' | 'error' | 'helperText' | 'inputProps'> {}
......@@ -25,15 +25,16 @@ interface State {
// email: (vl) => (isValidEmail(vl) ? validState(vl) : invalidState(vl, '')),
// }
type ExtendedProps = WithStyles<typeof styles> & ConnectedProps
type ExtendedProps = ConnectedProps
interface Props extends ExtendedProps {}
const UserForm = (props: Props) => {
const { classes, fetching, customer } = props
const { fetching, customer } = props
const [state, setState] = useState<State>({ username: '', password: '' })
const { username, password } = state
const [open, setOpen] = useState(false)
const styles = useSyles(useTheme())
// const { errorState, validState: isValidState, actions } = useErrorValidator({ username: '', password: '' })
......@@ -49,12 +50,12 @@ const UserForm = (props: Props) => {
}
return (
<div className={classes.contentContainer}>
<div className={classes.content}>
<Box sx={styles.contentContainer}>
<Box sx={styles.content}>
<Typography>Identifique-se</Typography>
<LoginTemplate username={formatCPF(username)} password={password} onChange={handleChange} />
<ButtonWithProgress
className={classes.btn}
sx={styles.btn}
fetching={fetching}
disabled={!username || !!customer}
color="secondary"
......@@ -67,7 +68,7 @@ const UserForm = (props: Props) => {
>
{!customer ? 'Identificar' : 'Identificado'}
</ButtonWithProgress>
<Button variant="contained" className={classes.btn} color="secondary" onClick={() => setOpen(true)} disabled={!!customer}>
<Button variant="contained" sx={styles.btn} color="secondary" onClick={() => setOpen(true)} disabled={!!customer}>
Primeiro aceeso
</Button>
{/* <UserFormField label="Nome" value={name} onChange={handleChange('name')} {...getErrorProps(errorState.name)} />
......@@ -79,10 +80,10 @@ const UserForm = (props: Props) => {
{...getErrorProps(errorState.phoneNumber)}
/>
<UserFormField label="Email" value={email} onChange={handleChange('email')} {...getErrorProps(errorState.email)} /> */}
</div>
</Box>
<FirstAccessDialog open={open} onClose={() => setOpen(false)} />
</div>
</Box>
)
}
export default connected(withStyles(styles)(UserForm))
export default connected(UserForm)
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material'
import sharedStyles from '../styles'
// eslint-disable-next-line
export default (theme: Theme) =>
createStyles({
createSxStyles({
...sharedStyles(theme),
content: { ...sharedStyles(theme).content, width: '15%' },
gridContainer: {},
......
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material'
import sharedStyles from '../shared-styles'
// eslint-disable-next-line
export default (theme: Theme) =>
createStyles({
const styles = (theme: Theme) =>
createSxStyles({
...sharedStyles(theme),
contentContainer: { display: 'flex', justifyContent: 'center', width: '100%' },
content: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', width: '35%' },
......@@ -14,3 +13,5 @@ export default (theme: Theme) =>
stepper: { flexGrow: 1 },
stepperBtn: { height: '100%' },
})
export default styles
......@@ -2,10 +2,10 @@ import React, { lazy, Suspense } from 'react'
import { Redirect, Route, RouteComponentProps, Switch } from 'react-router'
import { PATHS } from '@agiliza/views/Main/DrawerItems'
import { CircularProgress } from '@material-ui/core'
import { withStyles, WithStyles } from '@material-ui/core/styles'
import { CircularProgress } from '@mui/material'
import { useTheme } from '@mui/material/styles'
import styles from './shared-styles'
import useStyles from './shared-styles'
const CreditLinesList = lazy(() => import('./CreditLinesList'))
const Simulation = lazy(() => import('./Simulation'))
......@@ -25,15 +25,16 @@ export interface FinishSimulationRouteState {
proposalId: boolean
}
type ExtendedProps = WithStyles<typeof styles> & RouteComponentProps
type ExtendedProps = RouteComponentProps
interface Props extends ExtendedProps {}
const CreditLinesRouter = (props: Props) => {
const { classes, match } = props
const { match } = props
const styles = useStyles(useTheme())
return (
<div className={classes.pageContent}>
<Suspense fallback={<CircularProgress className={classes.circularProgress} />}>
<div style={styles.pageContent}>
<Suspense fallback={<CircularProgress sx={styles.circularProgress} />}>
<Switch>
<Route exact path={CREDIT_LINES_PATHS.creditLinesList} render={(rProps) => <CreditLinesList {...rProps} />} />
<Route
......@@ -61,4 +62,4 @@ const CreditLinesRouter = (props: Props) => {
)
}
export default withStyles(styles)(CreditLinesRouter)
export default CreditLinesRouter
import { createSxStyles } from '@agiliza/theme'
import sharedStyles from '@agiliza/views/shared-styles'
import { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/styles'
import { Theme } from '@mui/material'
// eslint-disable-next-line
export default (theme: Theme) =>
createStyles({
const styles = (theme: Theme) =>
createSxStyles({
...sharedStyles(theme),
title: { marginBottom: theme.spacing(2) },
})
export default styles
import { Theme } from '@material-ui/core'
import { createStyles } from '@material-ui/core/styles'
import { createSxStyles } from '@agiliza/theme'
import { Theme } from '@mui/material'
// import sharedStyles from '../../shared-styles'
export default (theme: Theme) => {
const display = 'flex'
return createStyles({
const display = 'flex'
const styles = (theme: Theme) => {
return createSxStyles({
pageContent: {
height: `calc(100vh - ${theme.mixins.toolbar.minHeight}px)`,
padding: theme.spacing(2),
height: `calc(100vh - ${theme?.mixins?.toolbar?.minHeight || 0}px)`,
padding: theme?.spacing(2),
display: 'flex',
flexDirection: 'column',
overflowY: 'hidden',
......@@ -30,7 +31,7 @@ export default (theme: Theme) => {
inputContainer: { display, flexWrap: 'wrap' },
form: { display, flexWrap: 'wrap', alignItems: 'center' },
formContent: {
marginRight: theme.spacing(3),
marginRight: theme?.spacing(3),
flexWrap: 'wrap',
display,
flexDirection: 'column',
......@@ -38,3 +39,5 @@ export default (theme: Theme) => {
},
})
}
export default styles
......@@ -88,7 +88,7 @@ const resolve = {
'@agiliza/views': pathResolve('src/views'),
'@agiliza/utils': pathResolve('src/utils'),
'@agiliza/public': pathResolve('public'),
'@material-ui/styles': path.resolve('.', 'node_modules', '@material-ui/styles'),
'@mui/styles': path.resolve('.', 'node_modules', '@mui/styles'),
}, // Modified paths, modify tsconfig.json "paths"
extensions: ['.ts', '.tsx', '.js'],
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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