mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-11 03:24:16 +00:00
fix tv
This commit is contained in:
parent
5fc346e66f
commit
5bb4f50023
@ -16,7 +16,7 @@ export default class TVDashboard extends React.Component {
|
|||||||
primaryPanelRef = React.createRef()
|
primaryPanelRef = React.createRef()
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
app.eventBus.emit("style.compactMode", false)
|
app.cores.style.compactMode(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
renderActiveTab() {
|
renderActiveTab() {
|
||||||
|
@ -1,12 +1,49 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
import * as antd from "antd"
|
import * as antd from "antd"
|
||||||
|
|
||||||
import { Icons } from "components/Icons"
|
import { Icons, createIconRender } from "components/Icons"
|
||||||
|
|
||||||
import Livestream from "../../../../models/livestream"
|
import Livestream from "../../../../models/livestream"
|
||||||
|
|
||||||
import "./index.less"
|
import "./index.less"
|
||||||
|
|
||||||
|
const CategoryView = (props) => {
|
||||||
|
const category = props.category
|
||||||
|
|
||||||
|
const [categoryData, setCategoryData] = React.useState(null)
|
||||||
|
|
||||||
|
const loadData = async () => {
|
||||||
|
const categoryData = await Livestream.getCategories(category).catch((err) => {
|
||||||
|
console.error(err)
|
||||||
|
|
||||||
|
app.message.error("Failed to load category")
|
||||||
|
|
||||||
|
return null
|
||||||
|
})
|
||||||
|
|
||||||
|
setCategoryData(categoryData)
|
||||||
|
}
|
||||||
|
|
||||||
|
React.useEffect(() => {
|
||||||
|
if (props.category) {
|
||||||
|
loadData()
|
||||||
|
}
|
||||||
|
}, [props.category])
|
||||||
|
|
||||||
|
return <div className="category">
|
||||||
|
{
|
||||||
|
categoryData?.icon &&
|
||||||
|
<div className="icon">
|
||||||
|
{createIconRender(categoryData.icon)}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
<div className="label">
|
||||||
|
{categoryData?.label ?? "No category"}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
const StreamingKeyView = (props) => {
|
const StreamingKeyView = (props) => {
|
||||||
const [streamingKeyVisibility, setStreamingKeyVisibility] = React.useState(false)
|
const [streamingKeyVisibility, setStreamingKeyVisibility] = React.useState(false)
|
||||||
|
|
||||||
@ -143,7 +180,7 @@ const StreamInfoEditor = (props) => {
|
|||||||
</span>
|
</span>
|
||||||
<div className="value">
|
<div className="value">
|
||||||
<LivestreamsCategoriesSelector
|
<LivestreamsCategoriesSelector
|
||||||
defaultValue={streamInfo.category.key}
|
defaultValue={streamInfo.category}
|
||||||
updateStreamInfo={updateStreamInfo}
|
updateStreamInfo={updateStreamInfo}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@ -277,9 +314,7 @@ export default (props) => {
|
|||||||
<span>
|
<span>
|
||||||
Category
|
Category
|
||||||
</span>
|
</span>
|
||||||
<h4>
|
<CategoryView category={streamInfo?.category} />
|
||||||
{streamInfo?.category?.label ?? "No category"}
|
|
||||||
</h4>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
background-color: var(--background-color-primary2);
|
background-color: var(--background-color-primary-2);
|
||||||
|
|
||||||
border: 1px solid var(--border-color);
|
border: 1px solid var(--border-color);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user