Skip to content

Commit e82e9c1

Browse files
committed
feat(pendingView): Add refresh button.
1 parent cd17897 commit e82e9c1

File tree

2 files changed

+28
-6
lines changed

2 files changed

+28
-6
lines changed

src/components/PendingStatsView.module.css

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,27 @@
3434
}
3535
.header > .settings:hover {
3636
transform: rotateZ(45deg);
37-
37+
}
38+
.extra-action {
39+
display: flex;
40+
justify-content: flex-end;
41+
}
42+
43+
.extra-action > .btn {
44+
flex: 0 0 64px;
45+
text-align: center;
46+
font-size: smaller;
47+
margin: 2px;
48+
line-height: var(--nav-item-size);
49+
/* color: var(--interactive-accent); */
50+
cursor: pointer;
51+
display: flex;
52+
justify-content: space-around;
53+
align-items: center;
54+
padding: 4px 6px;
55+
/* border: 1px solid var(--interactive-accent); */
56+
box-shadow: 0 0 2px 1px var(--interactive-accent);
57+
border-radius: 4px;
3858
}
3959
.scroll-container {
4060
overflow-y: scroll;

src/components/PendingStatsView.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import * as React from "react";
22
import { Tree, Button } from 'antd';
33
import type { DataNode, TreeProps } from 'antd/es/tree';
4-
5-
import { throttle } from 'lodash';
6-
import classnames from 'classnames';
74
import useStore, { LogType } from './pendingStore';
85
import styles from './PendingStatsView.module.css';
96
import { AlertTriangle, CheckCircle, ArrowDownUp, Activity, LineChart, Cog, Siren, FileType, ScrollText, Info, AlertCircle, XCircle, ChevronRight, Terminal, RedoDot, UploadCloud, DownloadCloud } from 'lucide-react';
@@ -13,7 +10,7 @@ import InvioPlugin from "src/main";
1310
import { CheckSettingsModal } from './CheckSettingsModal';
1411

1512
export const PendingStatsViewComponent = (props: { plugin: InvioPlugin }) => {
16-
const { record, toLocalSelected, toRemoteSelected, getToLocalFileList, getToRemoteFileList, getAllCheckedFileList, existToLocalFile, existToRemoteFile, updateSelectedToLocalFileList, updateSelectedToRemoteFileList } = useStore();
13+
const { getToLocalFileList, getToRemoteFileList, getAllCheckedFileList, existToLocalFile, existToRemoteFile, updateSelectedToLocalFileList, updateSelectedToRemoteFileList } = useStore();
1714
const toLocalTouched = getToLocalFileList();
1815

1916
const toRemoteTouched = getToRemoteFileList();
@@ -86,6 +83,9 @@ export const PendingStatsViewComponent = (props: { plugin: InvioPlugin }) => {
8683
<Cog className={styles['settings']} onClick={openSettings} />
8784
</h4>
8885
<div className={styles['scrollContainer']}>
86+
<div className={styles['extraAction']}>
87+
<div className={styles['btn']} onClick={() => { props.plugin.pendingView()}}><ArrowDownUp className={styles['icon']} />Refresh</div>
88+
</div>
8989
{
9090
treeToLocalData?.length > 0 ?
9191
<>
@@ -110,7 +110,9 @@ export const PendingStatsViewComponent = (props: { plugin: InvioPlugin }) => {
110110
null
111111
}
112112

113-
<div className={styles['subHeader']}>Local Changed Files</div>
113+
<div className={styles['subHeader']}>
114+
Local Changed Files
115+
</div>
114116
<Tree
115117
checkable
116118
showLine

0 commit comments

Comments
 (0)