upload: smaller queue buttons
Massimo Melina committed
Jan 24, 2023 at 16:56 UTC
a6640c9c104766427314d76f20e355e97ac8d2f5
1 file changed
+8
-12
frontend/src/upload.ts
+8
-12
@@ -83,17 +83,13 @@ export function showUpload() {
83
h(Flex, { alignItems: 'center', justifyContent: 'center', borderTop: '1px dashed', padding: '.5em' },
84
"Queue",
85
`(${_.sumBy(qs, q => q.files.length)})`,
86
- h('button',{
87
- onClick(){
88
- uploadState.qs = []
89
- abortCurrentUpload()
90
- }
91
- }, "Clear"),
92
- h('button',{
93
- onClick(){
94
- uploadState.paused = !uploadState.paused
95
- }
96
- }, paused ? "Resume" : "Pause"),
86
+ iconBtn('trash', ()=> {
87
+ uploadState.qs = []
88
+ abortCurrentUpload()
89
+ }),
90
+ iconBtn(paused ? '▶' : '⏸', () => {
91
+ uploadState.paused = !uploadState.paused
92
+ }),
93
),
94
qs.map((q,idx) =>
95
h('div', { key: q.to },
@@ -152,7 +148,7 @@ function FilesList({ files, remove }: { files: File[], remove: (f:File) => any }
148
}
149
150
function iconBtn(icon: string, onClick: () => any, { small=true, style={}, ...props }={}) {
155
- return h('button', { onClick, ...props, ...small && { style: { padding: '.1em', ...style } } }, hIcon(icon))
151
+ return h('button', { onClick, ...props, ...small && { style: { padding: '.1em', width: 35, height: 30, ...style } } }, icon.length > 1 ? hIcon(icon) : icon)
152
}
153
154
function formatPerc(p: number) {