-
-
Notifications
You must be signed in to change notification settings - Fork 656
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
318 additions
and
328 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 23 additions & 8 deletions
31
...Accordion/ConstraintAccordionView/ConstraintAccordionViewBody/SingleValue/SingleValue.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,44 @@ | ||
import { Chip } from '@mui/material'; | ||
import { Chip, styled } from '@mui/material'; | ||
import StringTruncator from 'component/common/StringTruncator/StringTruncator'; | ||
import { useStyles } from '../ConstraintAccordionViewBody.style'; | ||
|
||
interface ISingleValueProps { | ||
value: string | undefined; | ||
operator: string; | ||
} | ||
|
||
const StyledDiv = styled('div')(({ theme }) => ({ | ||
display: 'flex', | ||
alignItems: 'center', | ||
[theme.breakpoints.down(600)]: { flexDirection: 'column' }, | ||
})); | ||
|
||
const StyledParagraph = styled('p')(({ theme }) => ({ | ||
marginRight: theme.spacing(1.5), | ||
[theme.breakpoints.down(600)]: { | ||
marginBottom: theme.spacing(1.5), | ||
marginRight: 0, | ||
}, | ||
})); | ||
|
||
const StyledChip = styled(Chip)(({ theme }) => ({ | ||
margin: theme.spacing(0, 1, 1, 0), | ||
})); | ||
|
||
export const SingleValue = ({ value, operator }: ISingleValueProps) => { | ||
const { classes: styles } = useStyles(); | ||
if (!value) return null; | ||
|
||
return ( | ||
<div className={styles.singleValueView}> | ||
<p className={styles.singleValueText}>Value must be {operator}</p>{' '} | ||
<Chip | ||
<StyledDiv> | ||
<StyledParagraph>Value must be {operator}</StyledParagraph>{' '} | ||
<StyledChip | ||
label={ | ||
<StringTruncator | ||
maxWidth="400" | ||
text={value} | ||
maxLength={50} | ||
/> | ||
} | ||
className={styles.chip} | ||
/> | ||
</div> | ||
</StyledDiv> | ||
); | ||
}; |
2 changes: 1 addition & 1 deletion
2
...n/ConstraintAccordionView/ConstraintAccordionViewHeader/ConstraintAccordionViewHeader.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.