Skip to content

Commit

Permalink
feat(project): enableSharing toggled on by default
Browse files Browse the repository at this point in the history
- remove custom param
  • Loading branch information
AntonLantukh committed Jan 27, 2023
1 parent 2a268ce commit 6367493
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 20 deletions.
6 changes: 0 additions & 6 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,6 @@ You can change the background color of the shelf with the help of this property

---

**custom.enableSharing** (optional)

Set this parameter to `true` if you want to enable the "Share" button on the video and series detail screen.

---

**styling**

Use the `styling` object to define extra styles for your application.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import Button from '#components/Button/Button';
import type { ScreenComponent } from '#types/screens';
import useQueryParam from '#src/hooks/useQueryParam';
import InlinePlayer from '#src/containers/InlinePlayer/InlinePlayer';
import { isTruthyCustomParamValue } from '#src/utils/common';

const MediaMovie: ScreenComponent<PlaylistItem> = ({ data, isLoading }) => {
const { t } = useTranslation('video');
Expand All @@ -45,7 +44,6 @@ const MediaMovie: ScreenComponent<PlaylistItem> = ({ data, isLoading }) => {
const { config, accessModel } = useConfigStore(({ config, accessModel }) => ({ config, accessModel }), shallow);
const { siteName, features, custom } = config;

const enableSharing: boolean = isTruthyCustomParamValue(custom?.enableSharing);
const isFavoritesEnabled: boolean = Boolean(features?.favoritesList);
const inlineLayout = Boolean(custom?.inlinePlayer);

Expand Down Expand Up @@ -80,7 +78,7 @@ const MediaMovie: ScreenComponent<PlaylistItem> = ({ data, isLoading }) => {
const canonicalUrl = data ? `${window.location.origin}${mediaURL(data)}` : window.location.href;

const primaryMetadata = formatVideoMetaString(data);
const shareButton = enableSharing && <ShareButton title={data.title} description={data.description} url={canonicalUrl} />;
const shareButton = <ShareButton title={data.title} description={data.description} url={canonicalUrl} />;
const startWatchingButton = <StartWatchingButton item={data} playUrl={mediaURL(data, feedId, true)} />;

const favoriteButton = isFavoritesEnabled && <FavoriteButton item={data} />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import type { ScreenComponent } from '#types/screens';
import useQueryParam from '#src/hooks/useQueryParam';
import useGetSeriesId from '#src/hooks/useGetSeriesId';
import Loading from '#src/pages/Loading/Loading';
import { isTruthyCustomParamValue } from '#src/utils/common';

const MediaSeriesEpisode: ScreenComponent<PlaylistItem> = ({ data }) => {
const breakpoint = useBreakpoint();
Expand All @@ -46,7 +45,6 @@ const MediaSeriesEpisode: ScreenComponent<PlaylistItem> = ({ data }) => {
// Config
const { config, accessModel } = useConfigStore(({ config, accessModel }) => ({ config, accessModel }), shallow);
const { features, siteName, custom } = config;
const enableSharing: boolean = isTruthyCustomParamValue(custom?.enableSharing);
const isFavoritesEnabled: boolean = Boolean(features?.favoritesList);
const inlineLayout = Boolean(custom?.inlinePlayer);

Expand Down Expand Up @@ -112,7 +110,7 @@ const MediaSeriesEpisode: ScreenComponent<PlaylistItem> = ({ data }) => {
episodeItem.episodeNumber
}/${episodesInSeason}`;

const shareButton = enableSharing && <ShareButton title={episodeItem.title} description={episodeItem.description} url={canonicalUrl} />;
const shareButton = <ShareButton title={episodeItem.title} description={episodeItem.description} url={canonicalUrl} />;
const startWatchingButton = <StartWatchingButton item={episodeItem} playUrl={episodeURL(episodeItem, seriesId, true, feedId)} />;

const favoriteButton = isFavoritesEnabled && <FavoriteButton item={episodeItem} />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,13 @@ import { generateMovieJSONLD } from '#src/utils/structuredData';
import type { ScreenComponent } from '#types/screens';
import type { Playlist } from '#types/playlist';
import Loading from '#src/pages/Loading/Loading';
import { isTruthyCustomParamValue } from '#src/utils/common';

const PlaylistLiveChannels: ScreenComponent<Playlist> = ({ data: { feedid, playlist } }) => {
const { t } = useTranslation('epg');

// Config
const { config, accessModel } = useConfigStore(({ config, accessModel }) => ({ config, accessModel }), shallow);
const { siteName, custom } = config;

const enableSharing: boolean = isTruthyCustomParamValue(custom?.enableSharing);
const { siteName } = config;

// Routing
const location = useLocation();
Expand Down Expand Up @@ -130,10 +127,9 @@ const PlaylistLiveChannels: ScreenComponent<Playlist> = ({ data: { feedid, playl
const canonicalUrl = `${window.location.origin}${liveChannelsURL(feedid, channel.id)}`;
const pageTitle = `${channel.title} - ${siteName}`;

const shareButton =
enableSharing && channelMediaItem ? (
<ShareButton title={channelMediaItem.title} description={channelMediaItem.description} url={window.location.href} />
) : null;
const shareButton = channelMediaItem ? (
<ShareButton title={channelMediaItem.title} description={channelMediaItem.description} url={window.location.href} />
) : null;

const startWatchingButton = channelMediaItem ? (
<>
Expand Down

0 comments on commit 6367493

Please sign in to comment.