Skip to content

Commit f197868

Browse files
committed
More mobile cleanup
1 parent 4728370 commit f197868

File tree

7 files changed

+22
-18
lines changed

7 files changed

+22
-18
lines changed

resources/scripts/components/elements/Label.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import styled from 'styled-components/macro';
22
import tw from 'twin.macro';
33

44
const Label = styled.label<{ isLight?: boolean }>`
5-
${tw`block text-xs uppercase text-neutral-200 mb-2`};
5+
${tw`block text-xs uppercase text-neutral-200 mb-1 sm:mb-2`};
66
${props => props.isLight && tw`text-neutral-700`};
77
`;
88

resources/scripts/components/elements/Modal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ const Modal: React.FC<ModalProps> = ({ visible, appear, dismissable, showSpinner
113113
</div>
114114
</Fade>
115115
}
116-
<div css={tw`bg-neutral-800 p-6 rounded shadow-md overflow-y-scroll transition-all duration-150`}>
116+
<div css={tw`bg-neutral-800 p-3 sm:p-4 md:p-6 rounded shadow-md overflow-y-scroll transition-all duration-150`}>
117117
{children}
118118
</div>
119119
</ModalContainer>

resources/scripts/components/elements/PageContentBlock.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const PageContentBlock: React.FC<PageContentBlockProps> = ({ title, showFlashKey
2020
<title>{title}</title>
2121
</Helmet>
2222
}
23-
<ContentContainer css={tw`my-10`} className={className}>
23+
<ContentContainer css={tw`my-4 sm:my-10`} className={className}>
2424
{showFlashKey &&
2525
<FlashMessageRender byKey={showFlashKey} css={tw`mb-4`}/>
2626
}

resources/scripts/components/server/databases/CreateDatabaseButton.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,16 @@ export default () => {
8585
description={'Where connections should be allowed from. Use % for wildcards.'}
8686
/>
8787
</div>
88-
<div css={tw`mt-6 text-right`}>
88+
<div css={tw`flex flex-wrap justify-end mt-6`}>
8989
<Button
9090
type={'button'}
9191
isSecondary
92-
css={tw`mr-2`}
92+
css={tw`w-full sm:w-auto sm:mr-2`}
9393
onClick={() => setVisible(false)}
9494
>
9595
Cancel
9696
</Button>
97-
<Button type={'submit'}>
97+
<Button css={tw`w-full mt-4 sm:w-auto sm:mt-0`} type={'submit'}>
9898
Create Database
9999
</Button>
100100
</div>

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ const NetworkContainer = () => {
6868
<Spinner size={'large'} centered/>
6969
:
7070
data.map(({ id, ip, port, alias, notes, isDefault }, index) => (
71-
<GreyRowBox key={`${ip}:${port}`} css={index > 0 ? tw`mt-2 overflow-x-auto` : tw`overflow-x-auto`} $hoverable={false}>
71+
<GreyRowBox
72+
$hoverable={false}
73+
key={`${ip}:${port}`}
74+
css={index > 0 ? tw`mt-2 overflow-x-auto` : tw`overflow-x-auto`}
75+
>
7276
<div css={tw`hidden md:block pl-4 pr-6 text-neutral-400`}>
7377
<FontAwesomeIcon icon={faNetworkWired}/>
7478
</div>
@@ -90,7 +94,7 @@ const NetworkContainer = () => {
9094
/>
9195
</InputSpinner>
9296
</div>
93-
<div css={tw`w-32 text-right mr-2 md:mr-0`}>
97+
<div css={tw`w-32 text-right pr-4 sm:pr-0`}>
9498
{isDefault ?
9599
<span css={tw`bg-green-500 py-1 px-2 rounded text-green-50 text-xs`}>
96100
Primary

resources/scripts/components/server/schedules/EditScheduleModal.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,25 @@ const EditScheduleModal = ({ schedule, ...props }: Omit<Props, 'onScheduleUpdate
3030

3131
return (
3232
<Modal {...props} showSpinnerOverlay={isSubmitting}>
33-
<h3 css={tw`mb-6`}>{schedule ? 'Edit schedule' : 'Create new schedule'}</h3>
33+
<h3 css={tw`text-2xl mb-6`}>{schedule ? 'Edit schedule' : 'Create new schedule'}</h3>
3434
<FlashMessageRender byKey={'schedule:edit'} css={tw`mb-6`}/>
3535
<Form>
3636
<Field
3737
name={'name'}
3838
label={'Schedule name'}
3939
description={'A human readable identifer for this schedule.'}
4040
/>
41-
<div css={tw`flex mt-6`}>
42-
<div css={tw`flex-1 mr-4`}>
41+
<div css={tw`grid grid-cols-2 sm:grid-cols-4 gap-4 mt-6`}>
42+
<div>
4343
<Field name={'minute'} label={'Minute'}/>
4444
</div>
45-
<div css={tw`flex-1 mr-4`}>
45+
<div>
4646
<Field name={'hour'} label={'Hour'}/>
4747
</div>
48-
<div css={tw`flex-1 mr-4`}>
48+
<div>
4949
<Field name={'dayOfMonth'} label={'Day of month'}/>
5050
</div>
51-
<div css={tw`flex-1`}>
51+
<div>
5252
<Field name={'dayOfWeek'} label={'Day of week'}/>
5353
</div>
5454
</div>
@@ -64,7 +64,7 @@ const EditScheduleModal = ({ schedule, ...props }: Omit<Props, 'onScheduleUpdate
6464
/>
6565
</div>
6666
<div css={tw`mt-6 text-right`}>
67-
<Button type={'submit'} disabled={isSubmitting}>
67+
<Button css={tw`w-full sm:w-auto`} type={'submit'} disabled={isSubmitting}>
6868
{schedule ? 'Save changes' : 'Create schedule'}
6969
</Button>
7070
</div>

resources/scripts/components/server/users/EditSubuserModal.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ interface Values {
3131
}
3232

3333
const PermissionLabel = styled.label`
34-
${tw`flex items-center border border-transparent rounded p-2`};
34+
${tw`flex items-center border border-transparent rounded md:p-2`};
3535
text-transform: none;
3636
3737
&:not(.disabled) {
@@ -146,7 +146,7 @@ const EditSubuserModal = forwardRef<HTMLHeadingElement, Props>(({ subuser, ...pr
146146
htmlFor={`permission_${key}_${pkey}`}
147147
css={[
148148
tw`transition-colors duration-75`,
149-
index > 0 ? tw`mt-2` : undefined,
149+
index > 0 ? tw`mt-4 sm:mt-2` : undefined,
150150
]}
151151
className={(!canEditUser || editablePermissions.indexOf(`${key}.${pkey}`) < 0) ? 'disabled' : undefined}
152152
>
@@ -174,7 +174,7 @@ const EditSubuserModal = forwardRef<HTMLHeadingElement, Props>(({ subuser, ...pr
174174
</div>
175175
<Can action={subuser ? 'user.update' : 'user.create'}>
176176
<div css={tw`pb-6 flex justify-end`}>
177-
<Button type={'submit'}>
177+
<Button type={'submit'} css={tw`w-full sm:w-auto`}>
178178
{subuser ? 'Save' : 'Invite User'}
179179
</Button>
180180
</div>

0 commit comments

Comments
 (0)