Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@
"tabs": {
"all": "全部",
"allWithDate": "全部 ({{date}})"
}
}
},
"noLivestreams": "暂无直播计划,请查看前一天的安排。"
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@
"tabs": {
"all": "All",
"allWithDate": "All ({{date}})"
}
}
},
"noLivestreams": "No scheduled streams. Please check the previous day's schedule."
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@
"tabs": {
"all": "すべて",
"allWithDate": "すべて ({{date}})"
}
}
},
"noLivestreams": "配信予定がありません、前日の予定をご覧ください。"
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@
"tabs": {
"all": "전체",
"allWithDate": "전체 ({{date}})"
}
}
},
"noLivestreams": "예정된 방송이 없습니다. 전날 일정을 확인해주세요."
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@
"tabs": {
"all": "全部",
"allWithDate": "全部 ({{date}})"
}
}
},
"noLivestreams": "沒有配信預定,請查看前一天的行程。"
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@ import {
Grid,
Typography,
} from "@mui/material";
import { styled } from "@mui/material/styles";
import { styled, type Theme } from "@mui/material/styles";
import { useTranslation } from "next-i18next";
import type React from "react";
import type { Clip } from "@/features/shared/domain";
import { useVideoModalContext } from "@/hooks/video-modal";

const doubleBorderRadius = (theme: Theme) =>
typeof theme.shape.borderRadius === "number"
? theme.shape.borderRadius * 2
: `calc(${theme.shape.borderRadius} * 2)`;

// Styled components
const SectionTitle = styled(Typography)(({ theme }) => ({
fontWeight: 700,
Expand Down Expand Up @@ -59,7 +64,7 @@ const SingleRowContainer = styled(Box)(({ theme }) => ({
// Modern card style
const ModernCard = styled(Card)(({ theme }) => ({
overflow: "hidden",
borderRadius: theme.shape.borderRadius * 2,
borderRadius: doubleBorderRadius(theme),
transition: "transform 0.3s ease, box-shadow 0.3s ease",
height: "100%",
"&:hover": {
Expand Down Expand Up @@ -88,7 +93,7 @@ const CardOverlay = styled(Box)(({ theme }) => ({

const ShortsCard = styled(Card)(({ theme }) => ({
overflow: "hidden",
borderRadius: theme.shape.borderRadius * 2,
borderRadius: doubleBorderRadius(theme),
height: "100%",
aspectRatio: "9/16",
transition: "transform 0.3s ease, box-shadow 0.3s ease",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,22 @@ import {
styled,
useMediaQuery,
useTheme,
type Theme,
} from "@mui/material";
import { useTranslation } from "next-i18next";
import type { TFunction } from "next-i18next";
import React from "react";
import { LayoutType } from "../../hooks/useMultiviewLayout";

const scaledBorderRadius = (theme: Theme, scale: number) =>
typeof theme.shape.borderRadius === "number"
? theme.shape.borderRadius * scale
: `calc(${theme.shape.borderRadius} * ${scale})`;

const SelectorContainer = styled(Paper)(({ theme }) => ({
padding: theme.spacing(2.5),
backgroundColor: "white",
borderRadius: theme.shape.borderRadius * 1.5,
borderRadius: scaledBorderRadius(theme, 1.5),
boxShadow: theme.shadows[2],
border: `1px solid ${theme.palette.divider}`,
[theme.breakpoints.down("md")]: {
Expand Down Expand Up @@ -59,7 +65,7 @@ const LayoutButton = styled(IconButton, {
border: `2px solid ${
isSelected ? theme.palette.primary.main : theme.palette.divider
}`,
borderRadius: theme.shape.borderRadius * 1.5,
borderRadius: scaledBorderRadius(theme, 1.5),
backgroundColor: isSelected
? alpha(theme.palette.primary.main, 0.08)
: "transparent",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
styled,
useMediaQuery,
useTheme,
type Theme,
} from "@mui/material";
import { useTranslation } from "next-i18next";
import React, { useState, useCallback, useRef, useEffect } from "react";
Expand All @@ -15,12 +16,17 @@ import "react-resizable/css/styles.css";
import { MultiviewLayout } from "../../hooks/useMultiviewLayout";
import { VideoPlayer } from "../containers";

const scaledBorderRadius = (theme: Theme, scale: number) =>
typeof theme.shape.borderRadius === "number"
? theme.shape.borderRadius * scale
: `calc(${theme.shape.borderRadius} * ${scale})`;

const GridContainer = styled(Paper)<{ isFullscreen?: boolean }>(
({ theme, isFullscreen }) => ({
minHeight: isFullscreen ? "100vh" : "600px",
padding: theme.spacing(isFullscreen ? 0 : 1),
backgroundColor: "white",
borderRadius: isFullscreen ? 0 : theme.shape.borderRadius * 2,
borderRadius: isFullscreen ? 0 : scaledBorderRadius(theme, 2),
boxShadow: isFullscreen ? "none" : theme.shadows[4],
border: isFullscreen ? "none" : `1px solid ${theme.palette.divider}`,
position: isFullscreen ? "fixed" : "relative",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
styled,
useMediaQuery,
useTheme,
type Theme,
} from "@mui/material";
import { useTranslation } from "next-i18next";
import React from "react";
Expand All @@ -36,6 +37,11 @@ import {
} from "../../components/containers";
import { LayoutType, useMultiviewLayout } from "../../hooks/useMultiviewLayout";

const scaledBorderRadius = (theme: Theme, scale: number) =>
typeof theme.shape.borderRadius === "number"
? theme.shape.borderRadius * scale
: `calc(${theme.shape.borderRadius} * ${scale})`;

// Styled components
const HeaderSection = styled(Paper)(({ theme }) => ({
padding: theme.spacing(2),
Expand Down Expand Up @@ -87,7 +93,7 @@ const ControlsPanel = styled(Paper)<{ collapsed?: boolean }>(
backgroundColor: "rgba(255, 255, 255, 0.95)",
backdropFilter: "blur(10px)",
boxShadow: theme.shadows[8],
borderRadius: theme.shape.borderRadius * 2,
borderRadius: scaledBorderRadius(theme, 2),
border: `1px solid ${theme.palette.grey[300]}`,
zIndex: 1100,
transition: theme.transitions.create(["right", "opacity"], {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export const LivestreamContentPresenter: React.FC<LivestreamContentProps> = ({
livestreamsByDate,
timeZone,
);
const hasLivestreams = Object.keys(livestreamsByTimeBlock).length > 0;

const navigateToDate = (date: string, daysToAdd: number) => {
const currentDate = new Date(date);
Expand All @@ -101,6 +102,16 @@ export const LivestreamContentPresenter: React.FC<LivestreamContentProps> = ({
);
};

if (!hasLivestreams) {
return (
<Box sx={{ px: 2, py: 1 }}>
<Typography variant="body1" color="text.secondary">
{t("noLivestreams")}
</Typography>
</Box>
);
}

return (
<Box>
{Object.entries(livestreamsByTimeBlock).map(([date, timeBlocks]) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ export const groupLivestreamsByTimeBlock = (

// Sort livestreams into time blocks using the user's timezone
for (const livestream of livestreams) {
if (!livestream.scheduledStartTime) {
continue;
}

// Convert UTC time to user's timezone
const startTimeInUserTZ = utcToZonedTime(
livestream.scheduledStartTime,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@ const transformLivestreamsToDomain = (
if (!apiLivestreams) {
return [];
}
return apiLivestreams.map((stream) => {

const streamsWithStartTime = apiLivestreams.filter(
(stream): stream is ListStreams200StreamsItem & { startedAt: string } =>
Boolean(stream.startedAt),
);

return streamsWithStartTime.map((stream) => {
const livestream = {
id: stream.rawId,
type: "livestream",
Expand All @@ -49,7 +55,7 @@ const transformLivestreamsToDomain = (
thumbnailUrl: stream.thumbnailURL,
viewCount: stream.viewCount,
status: stream.status,
scheduledStartTime: stream.startedAt || "",
scheduledStartTime: stream.startedAt,
scheduledEndTime: stream.endedAt,
channelId: stream.rawChannelID,
channelTitle: stream.creatorName || "",
Expand Down
2 changes: 1 addition & 1 deletion service/vspo-schedule/v2/web/src/lib/i18n/cf-assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ interface CloudflareContextEnv {

export class CloudflareAssetsBackend implements BackendModule {
type = "backend" as const;
private services: Services | undefined;
private services?: Services;
private options: BackendOptions = {
loadPath: "/locales/{{lng}}/{{ns}}.json",
};
Expand Down