Skip to content

Commit 2c8ddd9

Browse files
authored
feat(view): 스토리라인 차트 표시 버튼에 MUI 적용 (#951)
* feat(view): convert button to mui icon button (#907) * feat(view): change to Insights icon and apply new badge (#907)
1 parent 6df8971 commit 2c8ddd9

4 files changed

Lines changed: 36 additions & 16 deletions

File tree

packages/view/src/App.scss

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,6 @@ body {
4747
}
4848
}
4949

50-
.folder-activity-flow-button {
51-
padding: 0.5rem 1rem;
52-
background: #007bff;
53-
color: white;
54-
border: none;
55-
border-radius: 0.25rem;
56-
cursor: pointer;
57-
font-size: 0.875rem;
58-
}
59-
6050
.folder-activity-flow-modal {
6151
position: fixed;
6252
top: 0;

packages/view/src/App.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import type { IDESentEvents } from "types/IDESentEvents";
2020
import { useBranchStore, useDataStore, useGithubInfo, useLoadingStore, useThemeStore } from "store";
2121
import { THEME_INFO } from "components/ThemeSelector/ThemeSelector.const";
2222
import { NetworkGraph } from "components/NetworkGraph";
23+
import { InsightsButton } from "components/InsightsButton";
2324

2425
const App = () => {
2526
const initRef = useRef<boolean>(false);
@@ -78,13 +79,15 @@ const App = () => {
7879
<BranchSelector />
7980
<div>
8081
<RefreshButton />
81-
<button
82-
type="button"
83-
className="folder-activity-flow-button"
82+
<InsightsButton
83+
isNew
84+
sx={{
85+
width: "1.875rem",
86+
height: "1.875rem",
87+
color: "white",
88+
}}
8489
onClick={handleOpenFolderActivityFlowModal}
85-
>
86-
Folder Activity Flow
87-
</button>
90+
/>
8891
</div>
8992
</div>
9093
<div className="top-container">
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";

0 commit comments

Comments
 (0)