Skip to content

Commit

Permalink
Add a new differential expression for drift detection (#4168)
Browse files Browse the repository at this point in the history
* Add changed color

* Lint

* Adjust color
  • Loading branch information
funera1 authored Feb 10, 2023
1 parent e7744c7 commit cb1fe77
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { makeStyles } from "@material-ui/core";
import green from "@material-ui/core/colors/green";
import red from "@material-ui/core/colors/red";
import yellow from "@material-ui/core/colors/yellow";
import { FC, memo } from "react";

const useStyles = makeStyles((theme) => ({
Expand All @@ -17,6 +18,10 @@ const useStyles = makeStyles((theme) => ({
color: red[800],
backgroundColor: red[50],
},
change: {
color: yellow[900],
backgroundColor: yellow[50],
},
line: {
minHeight: `${theme.typography.body2.lineHeight}em`,
},
Expand Down Expand Up @@ -46,6 +51,12 @@ export const DiffView: FC<DiffViewProps> = memo(function DiffView({ content }) {
<span className={classes.del}>{line}</span>
</div>
);
case "~":
return (
<div key={i} className={classes.line} data-testid="changed-line">
<span className={classes.change}>{line}</span>
</div>
);
default:
return (
<div key={i} className={classes.line}>
Expand Down

0 comments on commit cb1fe77

Please sign in to comment.