mirror of
https://github.com/Qortal/q-share.git
synced 2025-01-30 14:52:20 +00:00
added icon and category to videocontent
This commit is contained in:
parent
a4dca30d11
commit
2c0419d5c5
BIN
src/assets/icons/audio.webp
Normal file
BIN
src/assets/icons/audio.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 77 KiB |
BIN
src/assets/icons/document.webp
Normal file
BIN
src/assets/icons/document.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 84 KiB |
BIN
src/assets/icons/video.webp
Normal file
BIN
src/assets/icons/video.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 40 KiB |
@ -751,7 +751,7 @@ export const EditVideo = () => {
|
|||||||
dispatch(updateInHashMap(clonedCopy));
|
dispatch(updateInHashMap(clonedCopy));
|
||||||
dispatch(
|
dispatch(
|
||||||
setNotification({
|
setNotification({
|
||||||
msg: "Video updated",
|
msg: "File updated",
|
||||||
alertType: "success",
|
alertType: "success",
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
@ -674,7 +674,7 @@ export const UploadVideo = ({ editId, editContent }: NewCrowdfundProps) => {
|
|||||||
setPlaylistSetting(null);
|
setPlaylistSetting(null);
|
||||||
dispatch(
|
dispatch(
|
||||||
setNotification({
|
setNotification({
|
||||||
msg: "Videos published",
|
msg: "Files published",
|
||||||
alertType: "success",
|
alertType: "success",
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
import softwareIcon from '../assets/icons/software.webp'
|
import softwareIcon from '../assets/icons/software.webp'
|
||||||
import gamingIcon from '../assets/icons/gaming.webp'
|
import gamingIcon from '../assets/icons/gaming.webp'
|
||||||
import mediaIcon from '../assets/icons/media.webp'
|
import mediaIcon from '../assets/icons/media.webp'
|
||||||
|
import audioIcon from '../assets/icons/audio.webp'
|
||||||
|
import videoIcon from '../assets/icons/video.webp'
|
||||||
|
import documentIcon from '../assets/icons/document.webp'
|
||||||
|
|
||||||
|
|
||||||
const useTestIdentifiers = false;
|
const useTestIdentifiers = false;
|
||||||
@ -227,5 +230,8 @@ export const subCategories3: CategoryMap = {
|
|||||||
export const icons = {
|
export const icons = {
|
||||||
1: softwareIcon,
|
1: softwareIcon,
|
||||||
2: gamingIcon,
|
2: gamingIcon,
|
||||||
3: mediaIcon
|
3: mediaIcon,
|
||||||
|
302: videoIcon,
|
||||||
|
301: audioIcon,
|
||||||
|
304: documentIcon
|
||||||
}
|
}
|
@ -682,7 +682,19 @@ export const VideoList = ({ mode }: VideoListProps) => {
|
|||||||
hasHash = true;
|
hasHash = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const category = categories?.find(item => item?.id === videoObj?.category);
|
||||||
|
const subcategory = subCategories[category?.id]?.find(item => item?.id === videoObj?.subcategory);
|
||||||
|
const subcategory2 = subCategories2[subcategory?.id]?.find(item => item.id === videoObj?.subcategory2);
|
||||||
|
const subcategory3 = subCategories3[subcategory2?.id]?.find(item => item.id === videoObj?.subcategory3);
|
||||||
|
|
||||||
|
const catId = category?.id || null;
|
||||||
|
const subId = subcategory?.id || null;
|
||||||
|
const sub2Id = subcategory2?.id || null;
|
||||||
|
const sub3Id = subcategory3?.id || null;
|
||||||
|
|
||||||
|
const icon = icons[sub3Id] || icons[sub2Id] || icons[subId] || icons[catId] || null;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -753,7 +765,7 @@ export const VideoList = ({ mode }: VideoListProps) => {
|
|||||||
gap: '25px',
|
gap: '25px',
|
||||||
alignItems: 'center'
|
alignItems: 'center'
|
||||||
}}>
|
}}>
|
||||||
{icons[videoObj?.category] ? <img src={icons[videoObj?.category]} width="50px" style={{
|
{icon ? <img src={icon} width="50px" style={{
|
||||||
borderRadius: '5px'
|
borderRadius: '5px'
|
||||||
}}/> : (
|
}}/> : (
|
||||||
<AttachFileIcon />
|
<AttachFileIcon />
|
||||||
|
@ -33,7 +33,7 @@ import {
|
|||||||
CrowdfundSubTitle,
|
CrowdfundSubTitle,
|
||||||
CrowdfundSubTitleRow,
|
CrowdfundSubTitleRow,
|
||||||
} from "../../components/UploadVideo/Upload-styles";
|
} from "../../components/UploadVideo/Upload-styles";
|
||||||
import { QTUBE_VIDEO_BASE } from "../../constants";
|
import { QTUBE_VIDEO_BASE, categories, subCategories, subCategories2, subCategories3 } from "../../constants";
|
||||||
import { Playlists } from "../../components/Playlists/Playlists";
|
import { Playlists } from "../../components/Playlists/Playlists";
|
||||||
import { DisplayHtml } from "../../components/common/TextEditor/DisplayHtml";
|
import { DisplayHtml } from "../../components/common/TextEditor/DisplayHtml";
|
||||||
import FileElement from "../../components/common/FileElement";
|
import FileElement from "../../components/common/FileElement";
|
||||||
@ -277,7 +277,18 @@ export const VideoContent = () => {
|
|||||||
}
|
}
|
||||||
}, [videoData]);
|
}, [videoData]);
|
||||||
|
|
||||||
|
const categoriesDisplay = useMemo(()=> {
|
||||||
|
const category = categories?.find((item)=> item?.id === videoData?.category)
|
||||||
|
if(!category) return null
|
||||||
|
const subcategory = subCategories[category?.id]?.find(item=> item?.id === videoData?.subcategory)
|
||||||
|
if(!subcategory) return category?.name
|
||||||
|
|
||||||
|
const subcategory2 = subCategories2[subcategory?.id]?.find(item => item.id === videoData?.subcategory2)
|
||||||
|
if(!subcategory2) return `${category?.name} > ${subcategory?.name}`
|
||||||
|
const subcategory3 = subCategories3[subcategory2?.id]?.find(item => item.id === videoData?.subcategory3)
|
||||||
|
if(!subcategory3) return `${category?.name} > ${subcategory?.name} > ${subcategory2?.name}`
|
||||||
|
return `${category?.name} > ${subcategory?.name} > ${subcategory2?.name} > ${subcategory3?.name}`
|
||||||
|
}, [videoData])
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -354,6 +365,14 @@ export const VideoContent = () => {
|
|||||||
</StyledCardHeaderComment>
|
</StyledCardHeaderComment>
|
||||||
</Box>
|
</Box>
|
||||||
<Spacer height="15px" />
|
<Spacer height="15px" />
|
||||||
|
<Box>
|
||||||
|
<Typography sx={{
|
||||||
|
fontWeight: 'bold',
|
||||||
|
fontSize: '16px',
|
||||||
|
userSelect: 'none'
|
||||||
|
}}>{categoriesDisplay}</Typography>
|
||||||
|
</Box>
|
||||||
|
<Spacer height="15px" />
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
background: "#333333",
|
background: "#333333",
|
||||||
|
Loading…
Reference in New Issue
Block a user