diff --git a/.vscode/settings.json b/.vscode/settings.json index b6c6bf6d..329f582d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -177,6 +177,7 @@ "Upvote", "Viewset", "viewsets", + "vkvideo", "wordform", "Wordforms", "XCSDATN", diff --git a/rsconcept/frontend/src/app/global-dialogs.tsx b/rsconcept/frontend/src/app/global-dialogs.tsx index bf40d824..d2d2981e 100644 --- a/rsconcept/frontend/src/app/global-dialogs.tsx +++ b/rsconcept/frontend/src/app/global-dialogs.tsx @@ -4,6 +4,9 @@ import React from 'react'; import { DialogType, useDialogsStore } from '@/stores/dialogs'; +const DlgShowVideo = React.lazy(() => + import('@/features/help/dialogs/dlg-show-video').then(module => ({ default: module.DlgShowVideo })) +); const DlgChangeInputSchema = React.lazy(() => import('@/features/oss/dialogs/dlg-change-input-schema').then(module => ({ default: module.DlgChangeInputSchema })) ); @@ -161,6 +164,8 @@ export const GlobalDialogs = () => { return null; } switch (active) { + case DialogType.SHOW_VIDEO: + return ; case DialogType.CONSTITUENTA_TEMPLATE: return ; case DialogType.CREATE_CONSTITUENTA: diff --git a/rsconcept/frontend/src/components/icons.tsx b/rsconcept/frontend/src/components/icons.tsx index 1fb83dd0..aff85178 100644 --- a/rsconcept/frontend/src/components/icons.tsx +++ b/rsconcept/frontend/src/components/icons.tsx @@ -39,6 +39,7 @@ export { RiMenuFoldFill as IconMenuFold } from 'react-icons/ri'; export { RiMenuUnfoldFill as IconMenuUnfold } from 'react-icons/ri'; export { LuMoon as IconDarkTheme } from 'react-icons/lu'; export { LuSun as IconLightTheme } from 'react-icons/lu'; +export { IoVideocamOutline as IconVideo } from 'react-icons/io5'; export { LuFolderTree as IconFolderTree } from 'react-icons/lu'; export { LuFolder as IconFolder } from 'react-icons/lu'; export { LuFolderSearch as IconFolderSearch } from 'react-icons/lu'; diff --git a/rsconcept/frontend/src/components/view/embed-vkvideo.tsx b/rsconcept/frontend/src/components/view/embed-vkvideo.tsx new file mode 100644 index 00000000..be5450b5 --- /dev/null +++ b/rsconcept/frontend/src/components/view/embed-vkvideo.tsx @@ -0,0 +1,42 @@ +interface EmbedVKVideoProps { + /** Video ID to embed. */ + videoID: string; + + /** Display height in pixels. */ + pxHeight: number; + + /** Display width in pixels. */ + pxWidth?: number; +} + +/** + * Embeds a YouTube video into the page using the given video ID and dimensions. + */ +export function EmbedVKVideo({ videoID, pxHeight, pxWidth }: EmbedVKVideoProps) { + if (!pxWidth) { + pxWidth = (pxHeight * 16) / 9; + } + return ( +
+