Skip to content

Commit 12655e6

Browse files
committed
fix table buttons width
1 parent 73196fd commit 12655e6

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

web/src/components/About/index.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import axios from 'axios'
2-
import { useEffect, useState } from 'react'
2+
import { useEffect, useState, useMemo } from 'react'
33
import Button from '@material-ui/core/Button'
44
import InfoIcon from '@material-ui/icons/Info'
55
import ListItemIcon from '@material-ui/core/ListItemIcon'
@@ -25,13 +25,13 @@ export default function AboutDialog() {
2525

2626
const onClose = () => setOpen(false)
2727
const ref = useOnStandaloneAppOutsideClick(onClose)
28-
const getBasePath = () => {
28+
// Use useMemo to compute basePath once
29+
const basePath = useMemo(() => {
2930
if (typeof window !== 'undefined') {
3031
return window.location.pathname.split('/')[1] || ''
3132
}
3233
return ''
33-
}
34-
const basePath = getBasePath()
34+
}, [])
3535

3636
return (
3737
<>
@@ -64,7 +64,7 @@ export default function AboutDialog() {
6464
<HeaderSection>
6565
<div>{t('About')}</div>
6666
{torrServerVersion}
67-
<img src={`${basePath}/icon.png`} alt='ts-icon' />
67+
<img src={`${basePath ? `/${basePath}` : ''}/icon.png`} alt='ts-icon' />
6868
</HeaderSection>
6969

7070
<div style={{ overflow: 'auto' }}>

web/src/components/DialogTorrentDetailsContent/Table/style.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export const TableStyle = styled.table`
7676
7777
.button-cell {
7878
display: grid;
79-
grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
79+
grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
8080
gap: 10px;
8181
}
8282

0 commit comments

Comments
 (0)