Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add svg logo #276

Merged
merged 2 commits into from
Feb 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion css/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $button-unselected: #8F9290;


$background-color-1: #1F2531;
$background-color-2: #282C38;
$background-color-2: #171C28;
$background-color-3: #151B29;
$background-color-4: #1B202B;

Expand Down
2 changes: 1 addition & 1 deletion postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = {
extend: {
spacing: {
'15': '3.75rem',
'65.5':'15.625rem',
'62.5':'15.625rem',
},
},
},
Expand Down
1 change: 1 addition & 0 deletions public/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/components/Layout/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ function Sidebar() {
);

return (
<div className="flex flex-col flex-grow items-center h-screen bg-background-nav overflow-y-auto w-65.5 box-border font-semibold drop-shadow-[4px_0_4px_rgba(0,0,0,0.25)]">
<div className="flex flex-col flex-grow items-center h-screen bg-background-nav overflow-y-auto w-62.5 box-border font-semibold drop-shadow-[4px_0_4px_rgba(0,0,0,0.25)]">
<div className="flex flex-col p-10">
<img src="logo.png" alt="logo" className="w-20" />
<img src="logo.svg" alt="logo" className="w-20" />
</div>
<div className="flex cursor-pointer items-center justify-center bg-background-alt w-full py-4">
<div className="flex cursor-pointer items-center justify-center user-icon w-15 h-15 text-xl rounded-full" onClick={() => dispatch(setStatus(true))}>
Expand Down
30 changes: 30 additions & 0 deletions src/components/Panels/ShokoPanel.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import React from 'react';

type Props = {
title: string;
children: any;
options?: any;
className?: string;
isFetching?: boolean;
};

const ShokoPanel = ({ className, title, options, children }: Props) => (
<div className={`${className ?? ''} flex flex-col overflow-hidden h-full`}>
<div className="flex justify-between items-center mr-2">
<span className="flex font-semibold text-xl">{title}</span>
<div
className="flex"
onMouseDown={event => event.stopPropagation()}
onTouchStart={event => event.stopPropagation()}
>
{options}
</div>
</div>
<span className="bg-background-border my-2 h-0.5 flex-shrink-0" />
<div className="flex flex-col mr-2 font-mulish">
{children}
</div>
</div>
);

export default ShokoPanel;
6 changes: 3 additions & 3 deletions src/core/slices/webuiSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ type State = {
export const defaultLayout = {
dashboard: {
lg: [{
i: 'collectionBreakdown', x: 0, y: 0, w: 6, h: 9, minW: 5, minH: 6, maxH: 9, moved: false, static: false,
i: 'collectionBreakdown', x: 0, y: 0, w: 2, h: 15, minW: 2, minH: 15, maxH: 15, moved: false, static: false,
}, {
i: 'collectionTypeBreakdown', x: 2, y: 0, w: 2, h: 15, moved: false, static: false,
}, {
i: 'seriesBreakdown', x: 6, y: 0, w: 6, h: 9, minW: 5, minH: 6, maxH: 9, moved: false, static: false,
}, {
Expand All @@ -49,8 +51,6 @@ export const defaultLayout = {
i: 'actionItems', x: 3, y: 26, w: 3, h: 14, moved: false, static: false,
}, {
i: 'actionItems2', x: 6, y: 26, w: 3, h: 14, moved: false, static: false,
}, {
i: 'collectionTypeBreakdown', x: 9, y: 26, w: 3, h: 14, moved: false, static: false,
}],
} as LayoutType,
importFolders: {
Expand Down
6 changes: 3 additions & 3 deletions src/pages/dashboard/DashboardPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ function DashboardPage() {
<div key="collectionBreakdown">
<CollectionBreakdown />
</div>
<div key="collectionTypeBreakdown">
<CollectionTypeBreakdown />
</div>
<div key="seriesBreakdown">
<SeriesBreakdown />
</div>
Expand All @@ -70,9 +73,6 @@ function DashboardPage() {
<div key="actionItems2">
<ActionItems />
</div>
<div key="collectionTypeBreakdown">
<CollectionTypeBreakdown />
</div>
</ResponsiveGridLayout>
);
}
Expand Down
46 changes: 27 additions & 19 deletions src/pages/dashboard/panels/CollectionBreakdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,53 @@ import { useSelector } from 'react-redux';
import prettyBytes from 'pretty-bytes';

import { RootState } from '../../../core/store';
import FixedPanel from '../../../components/Panels/FixedPanel';
import ShokoPanel from '../../../components/Panels/ShokoPanel';

function CollectionBreakdown() {
const hasFetched = useSelector((state: RootState) => state.mainpage.fetched.stats);
const stats = useSelector((state: RootState) => state.mainpage.stats);

const renderItem = (key: string, title: string, value: string | number = 0) => (
<div key={key} className="flex mt-3 first:mt-2">
<div key={key} className="flex">
<div className="flex-grow">
{title}
</div>
<div className="color-highlight-1">
{value}
</div>
<div className="font-semibold">{value}</div>
</div>
);

const childrenLeft = [
const childrenFirst = [
renderItem('series', 'Series', stats.SeriesCount),
renderItem('files', 'Files', stats.FileCount),
renderItem('collection-size', 'Collection Size', `${prettyBytes(stats.FileSize || 0, { binary: true })}`),
];
const childrenRight = [
renderItem('series-completed', 'Series Completed', stats.FinishedSeries),
renderItem('episodes-watched', 'Episodes Watched', stats.WatchedEpisodes),
renderItem('hours-watched', 'Hours Watched', `${stats.WatchedHours || 0} H`),
];
const childrenSecond = [
renderItem('collection-size', 'Collection Size', `${prettyBytes(stats.FileSize || 0, { binary: true })}`),
renderItem('files', 'Files', stats.FileCount),
renderItem('unrecognized-files', 'Unrecognized Files', stats.UnrecognizedFiles),
renderItem('multiple-files', 'Multiple Files', stats.EpisodesWithMultipleFiles),
renderItem('duplicate-files', 'Duplicate Files', stats.FilesWithDuplicateLocations),
];

const childrenThird = [
renderItem('missing-links', 'Missing TvDB/TMDB Links', stats.SeriesWithMissingLinks),
renderItem('missing-episodes-collecting', 'Missing Episodes (Collecting)', stats.MissingEpisodesCollecting),
renderItem('missing-episodes', 'Missing Episodes (Total)', stats.MissingEpisodes),
];

return (
<FixedPanel title="Collection Breakdown" isFetching={!hasFetched}>
<div className="flex">
<div className="flex flex-col w-1/2 mr-6">
{childrenLeft}
</div>
<div className="flex flex-col w-1/2 ml-6">
{childrenRight}
</div>
<ShokoPanel title="Collection Breakdown" isFetching={!hasFetched}>
<div className="flex flex-col leading-5">
{childrenFirst}
</div>
<div className="flex flex-col mt-6 leading-5">
{childrenSecond}
</div>
<div className="flex flex-col mt-6 leading-5">
{childrenThird}
</div>
</FixedPanel>
</ShokoPanel>
);
}

Expand Down
6 changes: 3 additions & 3 deletions src/pages/dashboard/panels/CollectionTypeBreakdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useSelector } from 'react-redux';
import { forEach } from 'lodash';

import { RootState } from '../../../core/store';
import FixedPanel from '../../../components/Panels/FixedPanel';
import ShokoPanel from '../../../components/Panels/ShokoPanel';

const colors = {
Series: '#FF3F57',
Expand Down Expand Up @@ -51,9 +51,9 @@ function CollectionTypeBreakdown() {
});

return (
<FixedPanel title="Collection Type Breakdown" isFetching={!hasFetched}>
<ShokoPanel title="Collection Type Breakdown" isFetching={!hasFetched}>
{items}
</FixedPanel>
</ShokoPanel>
);
}

Expand Down