Skip to content

Commit 47d59ca

Browse files
committed
Fix mobile UI for allocation rows
1 parent 4ff5de7 commit 47d59ca

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

resources/scripts/components/server/backups/BackupRow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default ({ backup, className }: Props) => {
4949
}
5050
</div>
5151
<div css={tw`flex-1`}>
52-
<p css={tw`text-sm mb-1`}>
52+
<p css={tw`flex items-center text-sm mb-1`}>
5353
{!backup.isSuccessful &&
5454
<span css={tw`bg-red-500 py-px px-2 rounded-full text-white text-xs uppercase border border-red-600 mr-2`}>
5555
Failed

resources/scripts/components/server/network/AllocationRow.tsx

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import setServerAllocationNotes from '@/api/server/network/setServerAllocationNo
1515
import useFlash from '@/plugins/useFlash';
1616
import { ServerContext } from '@/state/server';
1717

18-
const Code = styled.code`${tw`font-mono py-1 px-2 bg-neutral-900 rounded text-sm block`}`;
18+
const Code = styled.code`${tw`font-mono py-1 px-2 bg-neutral-900 rounded text-sm inline-block break-all`}`;
1919
const Label = styled.label`${tw`uppercase text-xs mt-1 text-neutral-400 block px-1 select-none transition-colors duration-150`}`;
2020

2121
interface Props {
@@ -40,22 +40,21 @@ const AllocationRow = ({ allocation, onSetPrimary, onNotesChanged }: Props) => {
4040
}, 750);
4141

4242
return (
43-
<GreyRowBox
44-
$hoverable={false}
45-
// css={index > 0 ? tw`mt-2 overflow-x-auto` : tw`overflow-x-auto`}
46-
>
47-
<div css={tw`hidden md:block pl-4 pr-6 text-neutral-400`}>
48-
<FontAwesomeIcon icon={faNetworkWired}/>
43+
<GreyRowBox $hoverable={false} css={tw`flex-wrap md:flex-no-wrap mt-2`}>
44+
<div css={tw`flex items-center w-full md:w-auto`}>
45+
<div css={tw`pl-4 pr-6 text-neutral-400`}>
46+
<FontAwesomeIcon icon={faNetworkWired}/>
47+
</div>
48+
<div css={tw`mr-4 flex-1 md:w-40`}>
49+
<Code>{allocation.alias || allocation.ip}</Code>
50+
<Label>IP Address</Label>
51+
</div>
52+
<div css={tw`w-16 md:w-24 overflow-hidden`}>
53+
<Code>{allocation.port}</Code>
54+
<Label>Port</Label>
55+
</div>
4956
</div>
50-
<div css={tw`mr-4`}>
51-
<Code>{allocation.alias || allocation.ip}</Code>
52-
<Label>IP Address</Label>
53-
</div>
54-
<div>
55-
<Code>{allocation.port}</Code>
56-
<Label>Port</Label>
57-
</div>
58-
<div css={tw`px-8 flex-none sm:flex-1 self-start`}>
57+
<div css={tw`mt-4 w-full md:mt-0 md:flex-1 md:w-auto`}>
5958
<InputSpinner visible={loading}>
6059
<Textarea
6160
css={tw`bg-neutral-800 hover:border-neutral-600 border-transparent`}
@@ -65,7 +64,7 @@ const AllocationRow = ({ allocation, onSetPrimary, onNotesChanged }: Props) => {
6564
/>
6665
</InputSpinner>
6766
</div>
68-
<div css={tw`w-32 text-right pr-4 sm:pr-0`}>
67+
<div css={tw`w-full md:flex-none md:w-32 md:text-center mt-4 md:mt-0 text-right ml-4`}>
6968
{allocation.isDefault ?
7069
<span css={tw`bg-green-500 py-1 px-2 rounded text-green-50 text-xs`}>Primary</span>
7170
:

0 commit comments

Comments
 (0)