Skip to content

Commit

Permalink
style: improve content style
Browse files Browse the repository at this point in the history
  • Loading branch information
ddecrulle committed Jul 16, 2023
1 parent 4933418 commit 0ea6515
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 51 deletions.
36 changes: 22 additions & 14 deletions src/ui/components/pages/service/section/contentBloc.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,24 @@ export const ContentBloc = ({ functions, products }) => {
} = getProduct(products, idProduct);
return (
<div key={idProduct} className={classes.productFunctions}>
<img src={iconUrl} alt='' height='50px' width='50px' />
<Divider
component='div'
orientation='vertical'
className={cx(
css({
backgroundColor: color,
}),
classes.titleDivider
)}
/>
<Typography className={classes.productTitle} variant='h4'>
{labelProduct}
</Typography>
<div className={classes.title}>
<div>
<img src={iconUrl} alt='' height='50px' width='50px' />
<Divider
component='div'
orientation='vertical'
className={cx(
css({
backgroundColor: color,
}),
classes.titleDivider
)}
/>
</div>
<Typography className={classes.productTitle} variant='h4'>
{labelProduct}
</Typography>
</div>
<FunctionsByProducts
productFunctions={groupedFunctions}
labelProduct={labelProduct}
Expand All @@ -49,8 +53,12 @@ export const ContentBloc = ({ functions, products }) => {
};

const useStyles = makeStyles()((theme) => ({
title: {
display: 'inline-flex',
},
titleDivider: {
width: theme.spacing(6),
height: theme.spacing(0.5),
borderWidth: '3px',
borderRadius: '10px',
},
Expand Down
5 changes: 4 additions & 1 deletion src/ui/components/pages/service/serviceOffer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ export const ServiceOffer = () => {
treeState={searchParams}
setTreeState={updateParams}
tree={products['children'] ?? []}
autoCompleteLabel='Produits, GSBPM, Jalons ...'
autoComplete={{
isEnabled: true,
label: 'Produits, GSBPM, Jalons ...',
}}
/>
</Card>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,40 @@ export const ProductContentBloc = ({ products }) => {
const { id, iconUrl, label: labelProduct, color, description } = product;
return (
<div key={id} className={classes.productFunctions}>
<img src={iconUrl} alt='' height='50px' width='50px' />
<Divider
component='div'
orientation='vertical'
className={cx(
css({
backgroundColor: color,
}),
classes.titleDivider
)}
/>
<Typography className={classes.productTitle} variant='h4'>
{labelProduct}
<Typography textTransform='none' variant='body1' color='gray'>
{description}
<div className={classes.title}>
<div>
<img src={iconUrl} alt='' height='50px' width='50px' />
<Divider
component='div'
orientation='vertical'
className={cx(
css({
backgroundColor: color,
}),
classes.titleDivider
)}
/>
</div>
<Typography className={classes.productTitle} variant='h4'>
{labelProduct}
<Typography textTransform='none' variant='body1' color='gray'>
{description}
</Typography>
</Typography>
</Typography>
</div>
<ProductTools product={product} color={color} />
</div>
);
});
};

const useStyles = makeStyles()((theme) => ({
title: {
display: 'inline-flex',
},
titleDivider: {
width: theme.spacing(6),
height: theme.spacing(0.5),
borderWidth: '3px',
borderRadius: '10px',
},
Expand Down
2 changes: 1 addition & 1 deletion src/ui/components/pages/tools/tools.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const Tools = () => {
treeState={searchParams}
setTreeState={updateParams}
tree={products['children'] ?? []}
autoCompleteLabel='Applications'
autoComplete={{ isEnabled: false }}
/>
</Card>
</Box>
Expand Down
40 changes: 21 additions & 19 deletions src/ui/components/shared/treeFilter/treeFilter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,7 @@ const renderTree = (nodes) => (
</TreeItem>
);

export const TreeFilter = ({
treeState,
setTreeState,
tree,
autoCompleteLabel,
}) => {
export const TreeFilter = ({ treeState, setTreeState, tree, autoComplete }) => {
const { classes } = useStyles();

const handleAutocomplete = (_, newValue) => {
Expand All @@ -45,19 +40,26 @@ export const TreeFilter = ({

return (
<>
<Autocomplete
multiple
className={classes.autocomplete}
id='tags-standard'
getOptionLabel={(option) => option.title}
renderInput={(params) => (
<TextField {...params} variant='outlined' label={autoCompleteLabel} />
)}
options={[]}
value={treeState.filtered}
onChange={handleAutocomplete}
disabled
/>
{autoComplete.isEnabled && (
<Autocomplete
multiple
className={classes.autocomplete}
id='tags-standard'
getOptionLabel={(option) => option.title}
renderInput={(params) => (
<TextField
{...params}
variant='outlined'
label={autoComplete.label}
/>
)}
options={[]}
value={treeState.filtered}
onChange={handleAutocomplete}
disabled
/>
)}

<Button
onClick={handleCollapseClick}
disabled={treeState.expanded.length === 0}
Expand Down

0 comments on commit 0ea6515

Please sign in to comment.