Skip to content

Commit

Permalink
Correct linting / formatting whoopsies
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswilty committed Mar 4, 2024
1 parent cdcf199 commit 0cfc31b
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 51 deletions.
10 changes: 5 additions & 5 deletions cloud/cdk.context.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"availability-zones:account=992382568770:region=eu-north-1": [
"eu-north-1a",
"eu-north-1b",
"eu-north-1c"
]
"availability-zones:account=992382568770:region=eu-north-1": [
"eu-north-1a",
"eu-north-1b",
"eu-north-1c"
]
}
9 changes: 8 additions & 1 deletion cloud/lib/auth-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ import {
UserPoolClient,
UserPoolDomain,
} from 'aws-cdk-lib/aws-cognito';
import { CfnOutput, Duration, RemovalPolicy, Stack, StackProps, Tags } from 'aws-cdk-lib/core';
import {
CfnOutput,
Duration,
RemovalPolicy,
Stack,
StackProps,
Tags,
} from 'aws-cdk-lib/core';
import { Construct } from 'constructs';

import { resourceName } from './resourceNamingUtils';
Expand Down
49 changes: 11 additions & 38 deletions frontend/src/Authenticator.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@

[data-amplify-authenticator] .welcome-header,
[data-amplify-authenticator] .form-header {
display: flex;
justify-content: space-between;
position: sticky;
top: 0;
background-color: var(--main-text-colour);
border-bottom: 0.1875rem solid var(--main-border-colour);
z-index: 1;
display: flex;
justify-content: space-between;
border-bottom: 0.1875rem solid var(--main-border-colour);
background-color: var(--main-text-colour);
}

[data-amplify-authenticator] .amplify-heading--3 {
Expand Down Expand Up @@ -76,15 +76,12 @@
overflow-y: auto;
height: 100%;
}
[data-amplify-authenticator] [data-amplify-router] > [data-amplify-form] {
padding-top: 0;
}

[data-amplify-authenticator] [data-amplify-form] fieldset {
position: relative;
margin: 0;
padding: 0;
border: none;
position: relative;
}

[data-amplify-authenticator] [data-amplify-form] .amplify-field {
Expand Down Expand Up @@ -263,8 +260,8 @@
border-radius: 0.25rem;
background-color: inherit;
color: var(--accent-background-colour);
font-size: inherit;
outline-offset: 0.125rem;
font-size: inherit;
}

[data-amplify-authenticator] .amplify-button--link:focus-visible {
Expand All @@ -280,22 +277,14 @@
[data-amplify-authenticator] .form-header,
[data-amplify-authenticator] .welcome-header,
[data-amplify-authenticator] [data-amplify-footer] {
padding: 1rem 0;
padding: 1rem 2rem;
}

[data-amplify-authenticator] [data-amplify-router] > [data-amplify-form],
[data-amplify-authenticator] [data-amplify-footer] {
padding-top: 0;
}

[data-amplify-authenticator] [data-amplify-form],
[data-amplify-authenticator] .form-header,
[data-amplify-authenticator] .welcome-header,
[data-amplify-authenticator] [data-amplify-footer] {
padding-left: 2rem;
padding-right: 2rem;
}

[data-amplify-authenticator] .form-header {
margin: 0 -2rem;
}
Expand All @@ -309,22 +298,14 @@
[data-amplify-authenticator] .form-header,
[data-amplify-authenticator] .welcome-header,
[data-amplify-authenticator] [data-amplify-footer] {
padding: 0.75rem 0;
padding: 0.75rem 1.5rem;
}

[data-amplify-authenticator] [data-amplify-router] > [data-amplify-form],
[data-amplify-authenticator] [data-amplify-footer] {
padding-top: 0;
}

[data-amplify-authenticator] [data-amplify-form],
[data-amplify-authenticator] .form-header,
[data-amplify-authenticator] .welcome-header,
[data-amplify-authenticator] [data-amplify-footer] {
padding-left: 1.5rem;
padding-right: 1.5rem;
}

[data-amplify-authenticator] .form-header {
margin: 0 -1.5rem;
}
Expand All @@ -344,25 +325,17 @@
[data-amplify-authenticator] .form-header,
[data-amplify-authenticator] .welcome-header,
[data-amplify-authenticator] [data-amplify-footer] {
padding: 0.25rem 0;
}

[data-amplify-authenticator] [data-amplify-router] > [data-amplify-form],
[data-amplify-authenticator] [data-amplify-footer] {
padding-top: 0;
padding: 0.25rem 1rem;
}

[data-amplify-authenticator] [data-amplify-form],
[data-amplify-authenticator] [data-amplify-footer] {
padding-bottom: 0.5rem;
}

[data-amplify-authenticator] [data-amplify-form],
[data-amplify-authenticator] .form-header,
[data-amplify-authenticator] .welcome-header,
[data-amplify-authenticator] [data-amplify-router] > [data-amplify-form],
[data-amplify-authenticator] [data-amplify-footer] {
padding-left: 1rem;
padding-right: 1rem;
padding-top: 0;
}

[data-amplify-authenticator] .form-header {
Expand Down
20 changes: 13 additions & 7 deletions frontend/src/service/backendService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,20 @@ type RequestOptions<T> = Pick<RequestInit, 'method' | 'signal'> & {
async function sendRequest<T>(path: string, options: RequestOptions<T> = {}) {
const { method = 'GET', body, signal } = options;
// No auth in dev mode
const auth: Record<string, string> = import.meta.env.MODE === 'production' ? {
Authorization: (await fetchAuthSession()).tokens?.accessToken.toString() ?? ''
} : {};
const auth: Record<string, string> =
import.meta.env.MODE === 'production'
? {
Authorization:
(await fetchAuthSession()).tokens?.accessToken.toString() ?? '',
}
: {};

// Body is always JSON, if present
const contentType: Record<string, string> = body ? {
'Content-Type': 'application/json'
} : {};
const contentType: Record<string, string> = body
? {
'Content-Type': 'application/json',
}
: {};

return fetch(makeUrl(path), {
method,
Expand All @@ -34,7 +40,7 @@ async function sendRequest<T>(path: string, options: RequestOptions<T> = {}) {
headers: {
...auth,
...contentType,
}
},
});
}

Expand Down

0 comments on commit 0cfc31b

Please sign in to comment.