mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 18:44:16 +00:00
format
This commit is contained in:
parent
ec1e574ce9
commit
9b08415139
@ -31,11 +31,12 @@ const LyricsEditor = (props) => {
|
|||||||
function updateCurrentLang(url) {
|
function updateCurrentLang(url) {
|
||||||
handleChange("langs", {
|
handleChange("langs", {
|
||||||
...langs,
|
...langs,
|
||||||
[selectedLang]: url
|
[selectedLang]: url,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return <div className="lyrics-editor">
|
return (
|
||||||
|
<div className="lyrics-editor">
|
||||||
<div className="flex-row align-center justify-space-between gap-10">
|
<div className="flex-row align-center justify-space-between gap-10">
|
||||||
<h1>
|
<h1>
|
||||||
<Icons.MdOutlineMusicNote />
|
<Icons.MdOutlineMusicNote />
|
||||||
@ -43,9 +44,7 @@ const LyricsEditor = (props) => {
|
|||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<div className="flex-row aling-center gap-5">
|
<div className="flex-row aling-center gap-5">
|
||||||
<span>
|
<span>Language:</span>
|
||||||
Language:
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<antd.Select
|
<antd.Select
|
||||||
showSearch
|
showSearch
|
||||||
@ -57,41 +56,46 @@ const LyricsEditor = (props) => {
|
|||||||
{
|
{
|
||||||
label: "Original",
|
label: "Original",
|
||||||
value: "original",
|
value: "original",
|
||||||
}
|
},
|
||||||
]}
|
]}
|
||||||
optionFilterProp="children"
|
optionFilterProp="children"
|
||||||
filterOption={(input, option) => (option?.label.toLowerCase() ?? '').includes(input.toLowerCase())}
|
filterOption={(input, option) =>
|
||||||
|
(option?.label.toLowerCase() ?? "").includes(
|
||||||
|
input.toLowerCase(),
|
||||||
|
)
|
||||||
|
}
|
||||||
filterSort={(optionA, optionB) =>
|
filterSort={(optionA, optionB) =>
|
||||||
(optionA?.label.toLowerCase() ?? '').toLowerCase().localeCompare((optionB?.label.toLowerCase() ?? '').toLowerCase())
|
(optionA?.label.toLowerCase() ?? "")
|
||||||
|
.toLowerCase()
|
||||||
|
.localeCompare(
|
||||||
|
(
|
||||||
|
optionB?.label.toLowerCase() ?? ""
|
||||||
|
).toLowerCase(),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
onChange={setSelectedLang}
|
onChange={setSelectedLang}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{
|
{selectedLang && (
|
||||||
selectedLang && <UploadButton
|
<UploadButton
|
||||||
onSuccess={(file_uid, data) => {
|
onSuccess={(file_uid, data) => {
|
||||||
updateCurrentLang(data.url)
|
updateCurrentLang(data.url)
|
||||||
}}
|
}}
|
||||||
accept={[
|
accept={["text/*"]}
|
||||||
"text/*"
|
|
||||||
]}
|
|
||||||
/>
|
/>
|
||||||
}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{
|
{!langs[selectedLang] && (
|
||||||
!langs[selectedLang] && <span>
|
<span>No lyrics uploaded for this language</span>
|
||||||
No lyrics uploaded for this language
|
)}
|
||||||
</span>
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{langs[selectedLang] && (
|
||||||
langs[selectedLang] && <LyricsTextView
|
<LyricsTextView lrcURL={langs[selectedLang]} />
|
||||||
lrcURL={langs[selectedLang]}
|
)}
|
||||||
/>
|
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default LyricsEditor
|
export default LyricsEditor
|
Loading…
x
Reference in New Issue
Block a user