Skip to content

Commit

Permalink
Linting and formatting
Browse files Browse the repository at this point in the history
CRLF > LF is REALLY annoying
  • Loading branch information
ajnart committed May 10, 2022
1 parent 5d80d36 commit a0d86e2
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 36 deletions.
7 changes: 3 additions & 4 deletions components/layout/Aside.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Aside as MantineAside, Space } from '@mantine/core';
import CalendarComponent, { CalendarModule } from '../modules/calendar/CalendarModule';
import DateComponent from '../modules/date/DateModule';
import { Aside as MantineAside } from '@mantine/core';
import { CalendarModule } from '../modules/calendar/CalendarModule';
import ModuleWrapper from '../modules/moduleWrapper';

export default function Aside() {
Expand All @@ -13,7 +12,7 @@ export default function Aside() {
base: 'auto',
}}
>
<ModuleWrapper module={CalendarModule} />
<ModuleWrapper module={CalendarModule} />
</MantineAside>
);
}
2 changes: 0 additions & 2 deletions components/layout/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { AppShell, Center, createStyles } from '@mantine/core';
import { Header } from './Header';
import { Footer } from './Footer';
import CalendarComponent from '../modules/calendar/CalendarModule';
import DateComponent from '../modules/date/DateModule';
import Aside from './Aside';
import Navbar from './Navbar';

Expand Down
3 changes: 2 additions & 1 deletion components/layout/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Navbar as MantineNavbar } from '@mantine/core';
import DateComponent, { DateModule } from '../modules/date/DateModule';
import { DateModule } from '../modules/date/DateModule';
import ModuleWrapper from '../modules/moduleWrapper';

export default function Navbar() {
return (
<MantineNavbar
Expand Down
33 changes: 14 additions & 19 deletions components/modules/calendar/CalendarModule.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/* eslint-disable react/no-children-prop */
import { Popover, Box, ScrollArea, Divider, Indicator, Card } from '@mantine/core';
import { useEffect, useState } from 'react';
import { Popover, Box, ScrollArea, Divider, Indicator } from '@mantine/core';
import React, { useEffect, useState } from 'react';
import { Calendar } from '@mantine/dates';
import { CalendarIcon } from '@modulz/radix-icons';
import { RadarrMediaDisplay, SonarrMediaDisplay } from './MediaDisplay';
import { useConfig } from '../../../tools/state';
import { IModule } from '../modules';
import React from 'react';

export const CalendarModule: IModule = {
title: 'Calendar',
Expand Down Expand Up @@ -105,25 +104,21 @@ function DayComponent(props: any) {
target={`‏ ${day}`}
>
<ScrollArea style={{ height: 400 }}>
{sonarrFiltered.map((media: any, index: number) => {
return (
<React.Fragment key={index}>
<SonarrMediaDisplay media={media} />
{index < sonarrFiltered.length - 1 && <Divider variant="dashed" my="xl" />}
</React.Fragment>
);
})}
{sonarrFiltered.map((media: any, index: number) => (
<React.Fragment key={index}>
<SonarrMediaDisplay media={media} />
{index < sonarrFiltered.length - 1 && <Divider variant="dashed" my="xl" />}
</React.Fragment>
))}
{radarrFiltered.length > 0 && sonarrFiltered.length > 0 && (
<Divider variant="dashed" my="xl" />
)}
{radarrFiltered.map((media: any, index: number) => {
return (
<React.Fragment key={index}>
<RadarrMediaDisplay media={media} />
{index < radarrFiltered.length - 1 && <Divider variant="dashed" my="xl" />}
</React.Fragment>
);
})}
{radarrFiltered.map((media: any, index: number) => (
<React.Fragment key={index}>
<RadarrMediaDisplay media={media} />
{index < radarrFiltered.length - 1 && <Divider variant="dashed" my="xl" />}
</React.Fragment>
))}
</ScrollArea>
</Popover>
</Box>
Expand Down
2 changes: 1 addition & 1 deletion components/modules/date/DateModule.story.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import DateComponent from "./DateModule";
import DateComponent from './DateModule';

export default {
title: 'Date module',
Expand Down
4 changes: 2 additions & 2 deletions components/modules/date/DateModule.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Card, Group, Text, Title } from '@mantine/core';
import { Group, Text, Title } from '@mantine/core';
import dayjs from 'dayjs';
import { useEffect, useState } from 'react';
import { Clock } from 'tabler-icons-react';
Expand All @@ -25,7 +25,7 @@ export default function DateComponent(props: any) {
}, []);

return (
<Group p={'sm'} direction="column">
<Group p="sm" direction="column">
<Title>
{hours < 10 ? `0${hours}` : hours}:{minutes < 10 ? `0${minutes}` : minutes}
</Title>
Expand Down
7 changes: 3 additions & 4 deletions components/modules/moduleWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
import { Card, FloatingTooltip, Tooltip, useMantineTheme } from '@mantine/core';
import { Card, useMantineTheme } from '@mantine/core';
import { IModule } from './modules';

export default function ModuleWrapper(props: any) {
const { module }: { module: IModule } = props;
const theme = useMantineTheme();
console.log(module.title);
return (
<Card
mx="sm"
radius="lg"
shadow="sm"
style={{
// Make background color of the card depend on the theme
backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[6] : "white",
backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[6] : 'white',
}}
>
{<module.component />}
<module.component />
</Card>
);
}
4 changes: 1 addition & 3 deletions tools/theme.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { MantineProviderProps } from '@mantine/core';

export const theme: MantineProviderProps['theme'] = {

};
export const theme: MantineProviderProps['theme'] = {};

0 comments on commit a0d86e2

Please sign in to comment.