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

fix: rollback live channel links pending route refactor #373

Merged
merged 7 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 1 addition & 4 deletions src/components/Epg/Epg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ type Props = {
channel: EpgChannel | undefined;
program: EpgProgram | undefined;
config: Config;
getUrl: (channelId: string) => string;
};

export default function Epg({ channels, onChannelClick, onProgramClick, channel, program, config, getUrl }: Props) {
export default function Epg({ channels, onChannelClick, onProgramClick, channel, program, config }: Props) {
const breakpoint = useBreakpoint();
const { t } = useTranslation('common');

Expand Down Expand Up @@ -75,7 +74,6 @@ export default function Epg({ channels, onChannelClick, onProgramClick, channel,
onScrollToNow();
}}
isActive={channel?.id === epgChannel.uuid}
url={getUrl(epgChannel.uuid)}
/>
)}
renderProgram={({ program: programItem, isBaseTimeFormat }) => {
Expand All @@ -91,7 +89,6 @@ export default function Epg({ channels, onChannelClick, onProgramClick, channel,
isActive={program?.id === programItem.data.id}
compact={isMobile}
isBaseTimeFormat={isBaseTimeFormat}
url={getUrl(programItem.data.channelUuid)}
/>
);
}}
Expand Down
2 changes: 0 additions & 2 deletions src/components/EpgChannel/EpgChannelItem.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
.epgChannelBox {
position: absolute;
padding: 8px 0;
color: inherit;
text-decoration: none;
background-color: var(--body-background-color);
}

Expand Down
8 changes: 3 additions & 5 deletions src/components/EpgChannel/EpgChannelItem.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import type { Channel } from 'planby';
import classNames from 'classnames';
import { Link } from 'react-router-dom';

import styles from './EpgChannelItem.module.scss';

Expand All @@ -14,15 +13,14 @@ type Props = {
sidebarWidth: number;
onClick?: (channel: Channel) => void;
isActive: boolean;
url: string;
};

const EpgChannelItem: React.VFC<Props> = ({ channel, channelItemWidth, sidebarWidth, onClick, isActive, url }) => {
const EpgChannelItem: React.VFC<Props> = ({ channel, channelItemWidth, sidebarWidth, onClick, isActive }) => {
const { position, uuid, channelLogoImage } = channel;
const style = { top: position.top, height: position.height, width: sidebarWidth };

return (
<Link to={url} className={styles.epgChannelBox} style={style}>
<div className={styles.epgChannelBox} style={style}>
<div
className={classNames(styles.epgChannel, { [styles.active]: isActive })}
style={{ width: channelItemWidth }}
Expand All @@ -31,7 +29,7 @@ const EpgChannelItem: React.VFC<Props> = ({ channel, channelItemWidth, sidebarWi
>
<Image className={styles.epgChannelLogo} image={channelLogoImage} alt="Logo" width={320} />
</div>
</Link>
</div>
);
};

Expand Down
2 changes: 0 additions & 2 deletions src/components/EpgProgramItem/EpgProgramItem.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
position: absolute;
padding: 8px 4px;
overflow: hidden;
color: inherit;
text-decoration: none;
}

.epgProgram {
Expand Down
8 changes: 3 additions & 5 deletions src/components/EpgProgramItem/EpgProgramItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react';
import { Program, useProgram } from 'planby';
import classNames from 'classnames';
import { useTranslation } from 'react-i18next';
import { Link } from 'react-router-dom';

import styles from './EpgProgramItem.module.scss';

Expand All @@ -15,10 +14,9 @@ type Props = {
compact: boolean;
disabled: boolean;
isBaseTimeFormat: boolean;
url: string;
};

const ProgramItem: React.VFC<Props> = ({ program, onClick, isActive, compact, disabled, isBaseTimeFormat, url }) => {
const ProgramItem: React.VFC<Props> = ({ program, onClick, isActive, compact, disabled, isBaseTimeFormat }) => {
const {
styles: { position },
formatTime,
Expand All @@ -41,7 +39,7 @@ const ProgramItem: React.VFC<Props> = ({ program, onClick, isActive, compact, di
const showLiveTagInImage = !compact && isMinWidth && isLive;

return (
<Link to={url} className={styles.epgProgramBox} style={position} onClick={() => onClick && onClick(program)}>
<div className={styles.epgProgramBox} style={position} onClick={() => onClick && onClick(program)}>
<div
className={classNames(styles.epgProgram, {
[styles.selected]: isActive,
Expand All @@ -61,7 +59,7 @@ const ProgramItem: React.VFC<Props> = ({ program, onClick, isActive, compact, di
</span>
</div>
</div>
</Link>
</div>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const PlaylistLiveChannels: ScreenComponent<Playlist> = ({ data: { feedid, playl
}

// SEO (for channels)
const getUrl = (id: string) => liveChannelsURL(feedid, id);
// const getUrl = (id: string) => liveChannelsURL(feedid, id);
const canonicalUrl = `${window.location.origin}${liveChannelsURL(feedid, channel.id)}`;
const pageTitle = `${channel.title} - ${siteName}`;

Expand Down Expand Up @@ -215,7 +215,6 @@ const PlaylistLiveChannels: ScreenComponent<Playlist> = ({ data: { feedid, playl
channel={channel}
program={program}
config={config}
getUrl={getUrl}
/>
</div>
</VideoDetails>
Expand Down