Skip to content

Commit 85ffa25

Browse files
committed
feat(view): change to Insights icon and apply new badge (#907)
1 parent 265cc73 commit 85ffa25

5 files changed

Lines changed: 30 additions & 17 deletions

File tree

packages/view/src/App.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import type { IDESentEvents } from "types/IDESentEvents";
1313
import { useBranchStore, useDataStore, useGithubInfo, useLoadingStore, useThemeStore } from "store";
1414
import { THEME_INFO } from "components/ThemeSelector/ThemeSelector.const";
1515
import { NetworkGraph } from "components/NetworkGraph";
16-
import { NewButton } from "components/NewButton";
16+
import { InsightsButton } from "components/InsightsButton";
1717

1818
const App = () => {
1919
const initRef = useRef<boolean>(false);
@@ -71,7 +71,8 @@ const App = () => {
7171
<ThemeSelector />
7272
<BranchSelector />
7373
<RefreshButton />
74-
<NewButton
74+
<InsightsButton
75+
isNew
7576
sx={{
7677
width: "1.875rem",
7778
height: "1.875rem",
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { Badge, IconButton, IconButtonProps } from "@mui/material";
2+
import InsightsIcon from "@mui/icons-material/Insights";
3+
4+
type InsightsButtonProps = {
5+
isNew?: boolean;
6+
} & IconButtonProps;
7+
8+
const InsightsButton = ({ isNew = false, ...props }: InsightsButtonProps) => {
9+
return (
10+
<IconButton {...props}>
11+
<Badge
12+
badgeContent="NEW"
13+
invisible={!isNew}
14+
sx={{
15+
"& .MuiBadge-badge": {
16+
fontSize: "0.625rem",
17+
},
18+
}}
19+
>
20+
<InsightsIcon />
21+
</Badge>
22+
</IconButton>
23+
);
24+
};
25+
26+
export default InsightsButton;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as InsightsButton } from "./InsightsButton";

packages/view/src/components/NewButton/NewButton.tsx

Lines changed: 0 additions & 14 deletions
This file was deleted.

packages/view/src/components/NewButton/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)