Skip to content

Commit

Permalink
Prettier fixes, version updated
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeBellTMH committed Jun 12, 2021
1 parent bc5d745 commit 2e0662d
Show file tree
Hide file tree
Showing 14 changed files with 1,224 additions and 751 deletions.
1,810 changes: 1,146 additions & 664 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
"author": "George Bell",
"license": "ISC",
"dependencies": {
"@aws-amplify/api": "^3.2.20",
"@aws-amplify/ui-react": "^1.0.1",
"@sentry/browser": "^6.1.0",
"@aws-amplify/api": "^4.0.2",
"@aws-amplify/ui-react": "^1.2.2",
"@sentry/browser": "^6.6.0",
"aws-amplify": "^3.3.19",
"bootstrap": "^4.5.3",
"date-fns": "^2.16.1",
Expand Down Expand Up @@ -86,7 +86,7 @@
]
},
"devDependencies": {
"@sentry/cli": "^1.61.0",
"@sentry/cli": "^1.66.0",
"@testing-library/react": "^11.2.6",
"@types/draft-js": "^0.11.2",
"@types/draftjs-to-html": "^0.8.0",
Expand Down
12 changes: 6 additions & 6 deletions src/components/Loaders/Archive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { RouteComponentProps } from 'react-router-dom';
import RenderRouter from '../RenderRouter/RenderRouter';
import { Analytics } from 'aws-amplify';

const seriesContent = fetch(
`/static/content/series-archive.json`
).then((response) => response.json());
const videoContent = fetch(
`/static/content/video-archive.json`
).then((response) => response.json());
const seriesContent = fetch(`/static/content/series-archive.json`).then(
(response) => response.json()
);
const videoContent = fetch(`/static/content/video-archive.json`).then(
(response) => response.json()
);

interface Params {
archiveType: string;
Expand Down
7 changes: 4 additions & 3 deletions src/components/RenderRouter/FAQItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,10 @@ class ContentItem extends React.Component<Props, State> {
render() {
let image1: ItemImage | undefined;
if (this.state.content.image1) {
image1 = this.state.content.image1[
Math.floor(Math.random() * this.state.content.image1.length)
];
image1 =
this.state.content.image1[
Math.floor(Math.random() * this.state.content.image1.length)
];
}

return (
Expand Down
7 changes: 4 additions & 3 deletions src/components/RenderRouter/HeroItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,10 @@ class HeroItem extends React.Component<Props, State> {
}

renderHeroImage(className: string) {
const image1 = this.state.content.image1[
Math.floor(Math.random() * this.state.content.image1.length)
];
const image1 =
this.state.content.image1[
Math.floor(Math.random() * this.state.content.image1.length)
];
let onLoad: EventHandler<SyntheticEvent<HTMLImageElement>> | undefined;
let style: CSSProperties | undefined;
if (className === 'heroImage') {
Expand Down
6 changes: 3 additions & 3 deletions src/components/RenderRouter/ListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1185,9 +1185,9 @@ class ListItem extends React.Component<Props, State> {
if (!item) {
return false;
}
return (item[
this.props.content.filterField as keyof ListData
] as string)?.includes(this.props.content.filterValue);
return (
item[this.props.content.filterField as keyof ListData] as string
)?.includes(this.props.content.filterValue);
});

const dataLength = data.length;
Expand Down
6 changes: 3 additions & 3 deletions src/components/RenderRouter/SearchItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -924,15 +924,15 @@ class ContentItem extends React.Component<Props, State> {
style={{
fontWeight:
this.state.currentSearchType ==
((item as unknown) as SearchType)
(item as unknown as SearchType)
? 'bold'
: 'normal',
}}
onClick={() => {
this.setState({
currentSearchType: (SearchType[
currentSearchType: SearchType[
item as any
] as unknown) as SearchType,
] as unknown as SearchType,
});
// this.doSearch(item);
}}
Expand Down
16 changes: 7 additions & 9 deletions src/components/RenderRouter/SundayMorningItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,11 @@ export class SundayMorningItem extends React.Component<Props, State> {
}
}

private getMarkerClickHandler = (item: ListData) => (
_props?: IMarkerProps,
marker?: google.maps.Marker
) => {
this.setState({ selectedPlaceMarker: marker, selectedPlace: item });
};
private getMarkerClickHandler =
(item: ListData) =>
(_props?: IMarkerProps, marker?: google.maps.Marker) => {
this.setState({ selectedPlaceMarker: marker, selectedPlace: item });
};

private async setGeoLocation(postalCode?: string): Promise<void> {
const currentLatLng = await new Promise<google.maps.LatLngLiteral>(
Expand Down Expand Up @@ -241,9 +240,8 @@ export class SundayMorningItem extends React.Component<Props, State> {
console.log(res);
if (status === 'OK') {
for (const distanceItem of res.rows[0].elements) {
const site = this.state.listData[
res.rows[0].elements.indexOf(distanceItem)
];
const site =
this.state.listData[res.rows[0].elements.indexOf(distanceItem)];
console.log('Site: %o, distance: %o', site, distanceItem);
site.distance = distanceItem;
}
Expand Down
18 changes: 6 additions & 12 deletions src/components/RenderRouter/VideoPlayerLive_leadersday.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,12 @@ export default class VideoPlayer extends React.Component<Props, State> {
{
__typename: 'ZoomItem',
title: 'Brampton',
link:
'https://us02web.zoom.us/j/88149318051?pwd=T2l6dVI3THVhanNPbEg5WjdNWjlYdz09',
link: 'https://us02web.zoom.us/j/88149318051?pwd=T2l6dVI3THVhanNPbEg5WjdNWjlYdz09',
},
{
__typename: 'ZoomItem',
title: 'Brantford',
link:
'https://us02web.zoom.us/j/83338623830?pwd=MTNSWm05bElxT1RDMzNMNmZubzZGQT09',
link: 'https://us02web.zoom.us/j/83338623830?pwd=MTNSWm05bElxT1RDMzNMNmZubzZGQT09',
},
{
__typename: 'ZoomItem',
Expand All @@ -51,8 +49,7 @@ export default class VideoPlayer extends React.Component<Props, State> {
{
__typename: 'ZoomItem',
title: 'Hamilton Ancaster',
link:
'https://us02web.zoom.us/j/83813502060?pwd=K2xKWTdaQ3RDT0syWXY4U1pZaklJdz09',
link: 'https://us02web.zoom.us/j/83813502060?pwd=K2xKWTdaQ3RDT0syWXY4U1pZaklJdz09',
},
{
__typename: 'ZoomItem',
Expand All @@ -67,8 +64,7 @@ export default class VideoPlayer extends React.Component<Props, State> {
{
__typename: 'ZoomItem',
title: 'Kitchener',
link:
'https://us02web.zoom.us/j/86132511938?pwd=VjRFM1VyWEd2SGFmckxFVEx3S0I4QT09',
link: 'https://us02web.zoom.us/j/86132511938?pwd=VjRFM1VyWEd2SGFmckxFVEx3S0I4QT09',
},
{
__typename: 'ZoomItem',
Expand All @@ -78,8 +74,7 @@ export default class VideoPlayer extends React.Component<Props, State> {
{
__typename: 'ZoomItem',
title: 'Oakville',
link:
' https://us02web.zoom.us/j/87155258165?pwd=NXR0ZUJPdm5HNEZRZ25Oc0JhR1pLUT09',
link: ' https://us02web.zoom.us/j/87155258165?pwd=NXR0ZUJPdm5HNEZRZ25Oc0JhR1pLUT09',
},
{
__typename: 'ZoomItem',
Expand Down Expand Up @@ -119,8 +114,7 @@ export default class VideoPlayer extends React.Component<Props, State> {
{
__typename: 'ZoomItem',
title: 'Toronto Uptown',
link:
'https://us02web.zoom.us/j/82132846890?pwd=TE01Ym0vWEZBNUE4QVI0dGh2MmZkQT09',
link: 'https://us02web.zoom.us/j/82132846890?pwd=TE01Ym0vWEZBNUE4QVI0dGh2MmZkQT09',
},
{
__typename: 'ZoomItem',
Expand Down
5 changes: 2 additions & 3 deletions src/components/RenderRouter/WeatherItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ class HeroItem extends React.Component<Props> {
}

getCalendarEventForLocation(locationItem: any) {
let nextSunday = (moment().day() === 0
? moment().add(1, 'week')
: moment().day(0)
let nextSunday = (
moment().day() === 0 ? moment().add(1, 'week') : moment().day(0)
).startOf('day');
let serviceHour =
locationItem.serviceTimes[locationItem.serviceTimes.length - 1];
Expand Down
3 changes: 1 addition & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ else if (window.location.hostname.includes('beta')) env = 'beta';
else env = 'prod';

Sentry.init({
dsn:
'https://[email protected]/5231570',
dsn: 'https://[email protected]/5231570',
environment: env,
release: version.git,
ignoreErrors: [
Expand Down
19 changes: 8 additions & 11 deletions src/pages/admin/Announcements.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,8 @@ export default function Announcements(): JSX.Element {
const [count, setCount] = useState(5);
const [showExpired, setShowExpired] = useState(false);
const [locations, setLocations] = useState<Array<Location>>([]);
const [
currentAnnouncement,
setCurrentAnnouncement,
] = useState<AnnouncementData>();
const [currentAnnouncement, setCurrentAnnouncement] =
useState<AnnouncementData>();
const [openCreateModal, setOpenCreateModal] = useState(false);
const [openEditModal, setOpenEditModal] = useState(false);
const [locationFilter, setlocationFilter] = useState('Cross-Regional');
Expand Down Expand Up @@ -262,10 +260,10 @@ export default function Announcements(): JSX.Element {
});

setAnnouncements(
(getAnnouncements.data?.listAnnouncements
?.items as NonNullAnnouncements).sort((a, b) =>
a.publishedDate.localeCompare(b.publishedDate)
)
(
getAnnouncements.data?.listAnnouncements
?.items as NonNullAnnouncements
).sort((a, b) => a.publishedDate.localeCompare(b.publishedDate))
);
} catch (e) {
Sentry.captureException(e);
Expand Down Expand Up @@ -644,9 +642,8 @@ export default function Announcements(): JSX.Element {
);
};
const CreateAnnouncementModal = (): JSX.Element => {
const [announcement, setAnnouncement] = useState<AnnouncementData>(
announcementInit
);
const [announcement, setAnnouncement] =
useState<AnnouncementData>(announcementInit);
const [parishes, setParishes] = useState<Array<string>>(['Cross-Regional']);
const [errorTxt, setErrorTxt] = useState<string>('');
if (!announcement) return <></>;
Expand Down
8 changes: 2 additions & 6 deletions src/pages/admin/create-notes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -580,12 +580,8 @@ class Index extends React.Component<EmptyProps, State> {
};

async makePdf(): Promise<void> {
const {
title,
episodeNumber,
notesEditorState,
questionsEditorState,
} = this.state;
const { title, episodeNumber, notesEditorState, questionsEditorState } =
this.state;

if (
questionsEditorState.getCurrentContent().hasText() &&
Expand Down
50 changes: 28 additions & 22 deletions src/pages/admin/import-video.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,8 @@ class Index extends React.Component<EmptyProps, State> {
authMode: GRAPHQL_AUTH_MODE.AMAZON_COGNITO_USER_POOLS,
});
console.log({
'Success customMutations.updateOneSpeakerVideo: ': updateOneSpeakerVideo,
'Success customMutations.updateOneSpeakerVideo: ':
updateOneSpeakerVideo,
});
} catch (e) {
console.log(e);
Expand Down Expand Up @@ -750,7 +751,8 @@ class Index extends React.Component<EmptyProps, State> {
authMode: GRAPHQL_AUTH_MODE.AMAZON_COGNITO_USER_POOLS,
});
console.log({
'Success mutations.createCustomPlaylistVideo': createCustomPlaylistVideo,
'Success mutations.createCustomPlaylistVideo':
createCustomPlaylistVideo,
});
} catch (e) {
console.error(e);
Expand All @@ -766,7 +768,8 @@ class Index extends React.Component<EmptyProps, State> {
authMode: GRAPHQL_AUTH_MODE.AMAZON_COGNITO_USER_POOLS,
});
console.log({
'Success mutations.deleteCustomPlaylistVideo': deleteCustomPlaylistVideo,
'Success mutations.deleteCustomPlaylistVideo':
deleteCustomPlaylistVideo,
});
} catch (e) {
console.error(e);
Expand Down Expand Up @@ -978,14 +981,15 @@ class Index extends React.Component<EmptyProps, State> {
className="adminButton"
onClick={() => {
if (this.state.selectedSpeaker !== '') {
const a = this.state.selectedVideo.speakers.items.find(
(a: any) => {
return (
a?.speaker?.id ===
this.state.selectedSpeaker
);
}
);
const a =
this.state.selectedVideo.speakers.items.find(
(a: any) => {
return (
a?.speaker?.id ===
this.state.selectedSpeaker
);
}
);
if (!a) {
const speakers: any = {
items: [
Expand All @@ -1012,14 +1016,15 @@ class Index extends React.Component<EmptyProps, State> {
<button
onClick={() => {
if (this.state.selectedSpeaker) {
const speakerInSpeakers = this.state.originalSpeakers.items.find(
(a: any) => {
return (
a?.speaker?.id ===
this.state.selectedSpeaker
);
}
);
const speakerInSpeakers =
this.state.originalSpeakers.items.find(
(a: any) => {
return (
a?.speaker?.id ===
this.state.selectedSpeaker
);
}
);
if (speakerInSpeakers) {
const speakers: any = {
items: [
Expand Down Expand Up @@ -1112,9 +1117,10 @@ class Index extends React.Component<EmptyProps, State> {
)
) {
this.setState({
addToPlaylists: this.state.addToPlaylists.concat(
this.state.selectedPlaylist
),
addToPlaylists:
this.state.addToPlaylists.concat(
this.state.selectedPlaylist
),
});
}
}}
Expand Down

0 comments on commit 2e0662d

Please sign in to comment.