diff --git a/packages/app/src/pages/music/tabs/index.jsx b/packages/app/src/pages/music/tabs/index.jsx index 75704e79..1b8ea67c 100755 --- a/packages/app/src/pages/music/tabs/index.jsx +++ b/packages/app/src/pages/music/tabs/index.jsx @@ -1,23 +1,24 @@ import LibraryTab from "./library" import ExploreTab from "./explore" +import RadioTab from "./radio" export default [ - { - key: "explore", - label: "Explore", - icon: "FiCompass", - component: ExploreTab - }, - { - key: "library", - label: "Library", - icon: "MdLibraryMusic", - component: LibraryTab, - }, - { - key: "radio", - label: "Radio", - icon: "FiRadio", - disabled: true - }, -] \ No newline at end of file + { + key: "explore", + label: "Explore", + icon: "FiCompass", + component: ExploreTab, + }, + { + key: "library", + label: "Library", + icon: "MdLibraryMusic", + component: LibraryTab, + }, + { + key: "radio", + label: "Radio", + icon: "FiRadio", + component: RadioTab, + }, +] diff --git a/packages/app/src/pages/music/tabs/radio/index.jsx b/packages/app/src/pages/music/tabs/radio/index.jsx new file mode 100644 index 00000000..1cde55a9 --- /dev/null +++ b/packages/app/src/pages/music/tabs/radio/index.jsx @@ -0,0 +1,68 @@ +import React from "react" +import { Skeleton, Result } from "antd" +import RadioModel from "@models/radio" +import Image from "@components/Image" + +import { MdPlayCircle, MdHeadphones } from "react-icons/md" + +import "./index.less" + +const RadioItem = ({ item }) => { + const start = () => { + app.cores.player.start( + { + title: item.name, + source: item.http_src, + cover: item.background, + }, + { + radioId: item.radio_id, + }, + ) + } + + return ( +
+ +
+

{item.name}

+

{item.description}

+ +
+
+ + {item.now_playing.song.text} +
+
+ + {item.listeners} +
+
+
+
+ ) +} + +const RadioTab = () => { + const [L_Radios, R_Radios, E_Radios, M_Radios] = app.cores.api.useRequest( + RadioModel.getRadioList, + ) + + if (E_Radios) { + return + } + + if (L_Radios) { + return + } + + return ( +
+ {R_Radios.map((item) => ( + + ))} +
+ ) +} + +export default RadioTab diff --git a/packages/app/src/pages/music/tabs/radio/index.less b/packages/app/src/pages/music/tabs/radio/index.less new file mode 100644 index 00000000..667b4bd0 --- /dev/null +++ b/packages/app/src/pages/music/tabs/radio/index.less @@ -0,0 +1,80 @@ +.radio-list { + display: flex; + flex-direction: column; + gap: 10px; + + width: 100%; + + gap: 20px; +} + +.radio-list-item { + position: relative; + + display: flex; + flex-direction: column; + + height: 160px; + width: 100%; + + border-radius: 16px; + background-color: var(--background-color-accent); + + overflow: hidden; + + &:hover { + cursor: pointer; + } + + .lazy-load-image-background, + .radio-list-item-cover { + position: absolute; + + z-index: 1; + + top: 0; + left: 0; + + width: 100%; + height: 100%; + } + + .radio-list-item-content { + position: relative; + z-index: 2; + + display: flex; + flex-direction: column; + + justify-content: space-between; + + width: 100%; + height: 100%; + + backdrop-filter: blur(2px); + + padding: 16px; + + .radio-list-item-info { + display: flex; + align-items: center; + + gap: 8px; + + .radio-list-item-info-item { + display: flex; + + flex-direction: row; + align-items: center; + + gap: 8px; + padding: 4px; + + background-color: rgba(var(--bg_color_3), 0.7); + + border-radius: 8px; + font-size: 0.7rem; + } + } + } +}