@samitouri / QOSami-HFS / commits / 0cc8f6ca

fix: (regression 0.50.0) file-show had misplaced navigation arrows

Massimo Melina committed Jan 1, 2024 at 19:40 UTC 0cc8f6ca6618ea78a45a011dbd72025451f34e28
2 files changed +5 -4
frontend/src/components.ts
+2 -1
@@ -18,7 +18,7 @@ interface FlexProps extends CSSProperties {
18 className?: string,
19 props?: HTMLAttributes<HTMLDivElement>
20 }
21 -export const Flex = forwardRef(({ gap='.8em', vert=false, children=null, className='', props={}, ...rest }: FlexProps, ref) =>
21 +export const Flex = forwardRef(({ gap='.8em', center=false, vert=false, children=null, className='', props={}, ...rest }: FlexProps, ref) =>
22 h('div', {
23 ref,
24 className,
@@ -27,6 +27,7 @@ export const Flex = forwardRef(({ gap='.8em', vert=false, children=null, classNa
27 gap,
28 flexDirection: vert ? 'column' : undefined,
29 alignItems: vert ? undefined : 'center',
30 + justifyContent: center ? 'center' : undefined,
31 ...rest,
32 },
33 ...props
frontend/src/upload.ts
+3 -3
@@ -111,7 +111,7 @@ export function showUpload() {
111 h(FlexV, { className: 'upload-toolbar' },
112 !props?.can_upload ? t('no_upload_here', "No upload permission for the current folder")
113 : h(FlexV, {},
114 - h(Flex, { justifyContent: 'center', flexWrap: 'wrap' },
114 + h(Flex, { center: true, flexWrap: 'wrap' },
115 h('button', {
116 className: 'upload-files',
117 onClick: () => pickFiles({ accept: normalizeAccept(props?.accept) })
@@ -124,7 +124,7 @@ export function showUpload() {
124 h(Checkbox, { value: skipExisting, onChange: v => uploadState.skipExisting = v }, t`Skip existing files`),
125 ),
126 !isMobile() && h(Flex, { gap: 4 }, hIcon('info'), t('upload_dd_hint', "You can upload files doing drag&drop on the files list")),
127 - adding.length > 0 && h(Flex, { justifyContent: 'center', flexWrap: 'wrap' },
127 + adding.length > 0 && h(Flex, { center: true, flexWrap: 'wrap' },
128 h('button', {
129 className: 'upload-send',
130 onClick() {
@@ -147,7 +147,7 @@ export function showUpload() {
147 }),
148 h(UploadStatus, { margin: '.5em 0' }),
149 qs.length > 0 && h('div', {},
150 - h(Flex, { justifyContent: 'center', borderTop: '1px dashed', padding: '.5em' },
150 + h(Flex, { center: true, borderTop: '1px dashed', padding: '.5em' },
151 [queueStr, etaStr, speed && formatSpeed(speed)].filter(Boolean).join(', '),
152 inQ > 0 && iconBtn('delete', ()=> {
153 uploadState.qs = []