Skip to content

Commit 8503418

Browse files
committed
Show diff badge
1 parent 294bab5 commit 8503418

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

site/src/pages/TemplateVersionPage/TemplateVersionPageView.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ const Files: FC<{
5656
const tabValue = index.toString()
5757
const extension = getExtension(filename)
5858
const icon = iconByExtension[extension]
59+
const hasDiff = currentFiles[filename] !== previousFiles[filename]
5960

6061
return (
6162
<button
@@ -70,6 +71,7 @@ const Files: FC<{
7071
>
7172
{icon}
7273
{filename}
74+
{hasDiff && <div className={styles.tabDiff} />}
7375
</button>
7476
)
7577
})}
@@ -154,6 +156,7 @@ const useStyles = makeStyles((theme) => ({
154156
display: "flex",
155157
alignItems: "baseline",
156158
borderBottom: `1px solid ${theme.palette.divider}`,
159+
gap: 1,
157160
},
158161

159162
tab: {
@@ -163,7 +166,7 @@ const useStyles = makeStyles((theme) => ({
163166
display: "flex",
164167
alignItems: "center",
165168
height: theme.spacing(6),
166-
opacity: 0.75,
169+
opacity: 0.85,
167170
cursor: "pointer",
168171
gap: theme.spacing(0.5),
169172
position: "relative",
@@ -180,6 +183,7 @@ const useStyles = makeStyles((theme) => ({
180183

181184
tabActive: {
182185
opacity: 1,
186+
background: theme.palette.action.hover,
183187

184188
"&:after": {
185189
content: '""',
@@ -193,6 +197,14 @@ const useStyles = makeStyles((theme) => ({
193197
},
194198
},
195199

200+
tabDiff: {
201+
height: 6,
202+
width: 6,
203+
backgroundColor: theme.palette.warning.light,
204+
borderRadius: "100%",
205+
marginLeft: theme.spacing(0.5),
206+
},
207+
196208
codeWrapper: {
197209
background: theme.palette.background.paperLight,
198210
},

0 commit comments

Comments
 (0)