Skip to content

Commit

Permalink
update build (#387)
Browse files Browse the repository at this point in the history
  • Loading branch information
markdavella authored Apr 26, 2024
1 parent b8de48b commit 88a0726
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 32 deletions.
43 changes: 43 additions & 0 deletions web/src/components/channel_config/NoChannelsCreated.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import SettingsRemoteIcon from '@mui/icons-material/SettingsRemote';
import { Box, Button, Typography } from '@mui/material';
import { Link as RouterLink } from 'react-router-dom';
import { useChannels } from '../../hooks/useChannels';
import PaddedPaper from '../base/PaddedPaper';

export default function NoChannelsCreated() {
const { isFetching: channelsFetching, data: channels } = useChannels();

return (
channels &&
channels.length === 0 &&
!channelsFetching && (
<PaddedPaper
sx={{
display: 'flex',
justifyContent: 'center',
py: 10,
textAlign: 'center',
}}
>
<Box>
<SettingsRemoteIcon fontSize="large" />
<Typography variant="h5">
You haven't created any channels yet.
</Typography>
<Button
variant="contained"
sx={{
my: 2,
maxWidth: 350,
textAlign: 'center',
}}
component={RouterLink}
to="/channels/new"
>
Create your First Channel Now!
</Button>
</Box>
</PaddedPaper>
)
);
}
33 changes: 2 additions & 31 deletions web/src/pages/channels/ChannelsPage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Delete, PlayArrow as WatchIcon } from '@mui/icons-material';
import AddCircleIcon from '@mui/icons-material/AddCircle';
import EditIcon from '@mui/icons-material/Edit';
import SettingsRemoteIcon from '@mui/icons-material/SettingsRemote';
import TextSnippetIcon from '@mui/icons-material/TextSnippet';
import {
Box,
Expand Down Expand Up @@ -32,7 +31,7 @@ import { isEmpty } from 'lodash-es';
import { useState } from 'react';
import { Link as RouterLink, useNavigate } from 'react-router-dom';
import TunarrLogo from '../../components/TunarrLogo.tsx';
import PaddedPaper from '../../components/base/PaddedPaper.tsx';
import NoChannelsCreated from '../../components/channel_config/NoChannelsCreated.tsx';
import { useChannels } from '../../hooks/useChannels.ts';
import { useTunarrApi } from '../../hooks/useTunarrApi.ts';

Expand Down Expand Up @@ -238,35 +237,7 @@ export default function ChannelsPage() {
</Table>
</TableContainer>

{channels && channels.length === 0 && !channelsFetching && (
<PaddedPaper
sx={{
display: 'flex',
justifyContent: 'center',
py: 10,
textAlign: 'center',
}}
>
<Box>
<SettingsRemoteIcon fontSize="large" />
<Typography variant="h5">
You haven't created any channels yet.
</Typography>
<Button
variant="contained"
sx={{
my: 2,
maxWidth: 350,
textAlign: 'center',
}}
component={RouterLink}
to="/channels/new"
>
Create your First Channel Now!
</Button>
</Box>
</PaddedPaper>
)}
<NoChannelsCreated />
</div>
);
}
4 changes: 3 additions & 1 deletion web/src/pages/guide/GuidePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ import { DatePicker } from '@mui/x-date-pickers/DatePicker';
import dayjs, { Dayjs, duration } from 'dayjs';
import isBetween from 'dayjs/plugin/isBetween';
import { useCallback, useState } from 'react';
import { useInterval } from 'usehooks-ts';
import NoChannelsCreated from '../../components/channel_config/NoChannelsCreated.tsx';
import { TvGuide } from '../../components/guide/TvGuide.tsx';
import { roundCurrentTime } from '../../helpers/util.ts';
import useStore from '../../store/index.ts';
import { setGuideDurationState } from '../../store/themeEditor/actions.ts';
import { useInterval } from 'usehooks-ts';

dayjs.extend(duration);
dayjs.extend(isBetween);
Expand Down Expand Up @@ -153,6 +154,7 @@ export default function GuidePage({ channelId }: Props = { channelId: 'all' }) {
</Stack>
</Box>
<TvGuide channelId={channelId} start={start} end={end} />
<NoChannelsCreated />
</>
);
}

0 comments on commit 88a0726

Please sign in to comment.