feat: tweak add new app connection dialog

This commit is contained in:
Ali BARIN
2021-12-16 23:27:09 +01:00
parent 3e8bae2ec3
commit 81c18ee37c
6 changed files with 22 additions and 9 deletions

View File

@@ -45,7 +45,6 @@ export default function AddNewAppConnection(props: AddNewAppConnectionProps){
<FormControl <FormControl
variant="outlined" variant="outlined"
fullWidth fullWidth
sx={{ mt: 2 }}
size={matchSmallScreens ? 'small' : 'medium'} size={matchSmallScreens ? 'small' : 'medium'}
> >
<InputLabel <InputLabel
@@ -72,10 +71,11 @@ export default function AddNewAppConnection(props: AddNewAppConnectionProps){
{data?.getApps?.map((app: App) => ( {data?.getApps?.map((app: App) => (
<ListItem disablePadding key={app.name}> <ListItem disablePadding key={app.name}>
<ListItemButton component={Link} to={URLS.APP_ADD_CONNECTION(app.name.toLowerCase())}> <ListItemButton component={Link} to={URLS.APP_ADD_CONNECTION(app.name.toLowerCase())}>
<ListItemIcon> <ListItemIcon sx={{ minWidth: 74 }}>
<AppIcon color={app.primaryColor} url={app.iconUrl} name={app.name} /> <AppIcon color="transparent" url={app.iconUrl} name={app.name} />
</ListItemIcon> </ListItemIcon>
<ListItemText primary={app.name} />
<ListItemText primary={app.name} primaryTypographyProps={{ sx: { color: (theme) => theme.palette.text.primary } }} />
</ListItemButton> </ListItemButton>
</ListItem> </ListItem>
))} ))}

View File

@@ -13,14 +13,13 @@ const inlineImgStyle: React.CSSProperties = {
}; };
export default function AppIcon(props: AppIconProps & AvatarProps) { export default function AppIcon(props: AppIconProps & AvatarProps) {
const { name, url, sx = {}, ...restProps } = props; const { name, url, color, sx = {}, ...restProps } = props;
const color = url ? 'white' : props.color
return ( return (
<Avatar <Avatar
component="span" component="span"
variant="square" variant="square"
sx={{ bgcolor: `#${color}`, display: 'inline-flex', width: 50, height: 50, ...sx }} sx={{ bgcolor: color, display: 'inline-flex', width: 50, height: 50, ...sx }}
imgProps={{ style: inlineImgStyle }} imgProps={{ style: inlineImgStyle }}
src={url} src={url}
alt={name} alt={name}

View File

@@ -35,6 +35,7 @@ export default function InputCreator(props: InputCreatorProps) {
readOnly={readOnly} readOnly={readOnly}
onChange={onChange} onChange={onChange}
name={name} name={name}
size="small"
label={label} label={label}
fullWidth fullWidth
helperText={description} helperText={description}

View File

@@ -22,7 +22,7 @@ const createCopyAdornment = (ref: React.RefObject<HTMLInputElement | null>) => {
onClick={() => copyInputValue(ref.current as HTMLInputElement)} onClick={() => copyInputValue(ref.current as HTMLInputElement)}
edge="end" edge="end"
> >
<ContentCopyIcon /> <ContentCopyIcon color="primary" />
</IconButton> </IconButton>
</InputAdornment> </InputAdornment>
); );

View File

@@ -19,12 +19,16 @@
"apps.addConnection": "Add connection", "apps.addConnection": "Add connection",
"apps.addNewAppConnection": "Add a new app connection", "apps.addNewAppConnection": "Add a new app connection",
"apps.searchApp": "Search for app", "apps.searchApp": "Search for app",
"addAppConnection.submit": "Submit",
"connection.flowCount": "{count} flows", "connection.flowCount": "{count} flows",
"connection.viewFlows": "View flows", "connection.viewFlows": "View flows",
"connection.testConnection": "Test connection", "connection.testConnection": "Test connection",
"connection.testSuccessful": "Test successful",
"connection.testFailed": "Test failed",
"connection.testing": "Testing...",
"connection.reconnect": "Reconnect", "connection.reconnect": "Reconnect",
"connection.delete": "Delete", "connection.delete": "Delete",
"connection.deletedMessage": "The connection has been deleted.", "connection.deletedMessage": "The connection has been deleted.",
"connection.addedAt": "Added {datetime}" "connection.addedAt": "added {datetime}"
} }

View File

@@ -239,6 +239,15 @@ const extendedTheme = createTheme({
} }
} }
}, },
MuiDialogContent: {
styleOverrides: {
root: {
'&&': {
paddingTop: referenceTheme.spacing(2),
}
},
}
},
MuiDialogTitle: { MuiDialogTitle: {
styleOverrides: { styleOverrides: {
root: { root: {