remove dep

This commit is contained in:
SrGooglo 2024-09-16 11:34:21 +00:00
parent a4f5112c3a
commit addcf4f220
9 changed files with 94 additions and 40 deletions

View File

@ -41,7 +41,6 @@
"@tauri-apps/api": "^1.5.4",
"@tsmx/human-readable": "^1.0.7",
"antd": "^5.20.6",
"antd-mobile": "^5.31.0",
"axios": "^1.7.7",
"bear-react-carousel": "^4.0.10-alpha.0",
"capacitor-music-controls-plugin-v3": "^1.1.0",
@ -49,7 +48,6 @@
"dompurify": "^3.0.0",
"evite": "^0.17.0",
"fast-average-color": "^9.2.0",
"feather-reactjs": "2.0.13",
"framer-motion": "^10.12.17",
"fuse.js": "6.5.3",
"hls.js": "^1.5.15",
@ -83,7 +81,6 @@
"react-motion": "0.5.2",
"react-rnd": "10.3.5",
"react-router-dom": "^6.26.2",
"react-ticker": "^1.3.2",
"react-transition-group": "^4.4.5",
"react-useanimations": "^2.10.0",
"realtime-bpm-analyzer": "^3.2.1",

View File

@ -151,11 +151,6 @@
"version": "5.20.6",
"license": "MIT"
},
{
"name": "antd-mobile",
"version": "5.37.1",
"license": "MIT"
},
{
"name": "axios",
"version": "1.7.7",
@ -201,11 +196,6 @@
"url": "https://github.com/fast-average-color/fast-average-color"
}
},
{
"name": "feather-reactjs",
"version": "2.0.13",
"license": "MIT"
},
{
"name": "framer-motion",
"version": "10.18.0",
@ -424,12 +414,6 @@
"license": "MIT",
"author": "Remix Software <hello@remix.run>"
},
{
"name": "react-ticker",
"version": "1.3.2",
"license": "MIT",
"author": "https://github.com/AndreasFaust"
},
{
"name": "react-transition-group",
"version": "4.4.5",

View File

@ -1,5 +1,5 @@
import React from "react"
import { SearchBar } from "antd-mobile"
import { Input } from "antd"
import classnames from "classnames"
import "./index.less"
@ -39,7 +39,7 @@ export default (props) => {
className="searchButton"
onClick={() => openSearchBox(true)}
>
<SearchBar
<Input
ref={searchBoxRef}
className={classnames("searchBox", { ["open"]: open })}
onSearch={props.onSearch}

View File

@ -0,0 +1,49 @@
import React from "react"
import classnames from "classnames"
import { Translation } from "react-i18next"
import { createIconRender } from "@components/Icons"
import "./index.less"
const ActionsMenu = (props) => {
return <div
className="app-actions_menu"
>
{
props.list.map((action, index) => {
return <div
id={action.id}
key={index}
onClick={() => {
action.onClick()
if (action.closeOnClick !== false) {
props.close()
}
}}
className={classnames(
"app-actions_menu-action",
{
["danger"]: action.danger
}
)}
>
<div
className="app-actions_menu-icon"
>
{createIconRender(action.icon)}
</div>
<div
className="app-actions_menu-label"
>
<span><Translation>{t => t(action.label)}</Translation></span>
</div>
</div>
})
}
</div>
}
export default ActionsMenu

View File

@ -0,0 +1,35 @@
.app-actions_menu {
display: flex;
flex-direction: column;
gap: 7px;
color: var(--text-color);
.app-actions_menu-action {
display: inline-flex;
flex-direction: row;
align-items: center;
padding: 10px;
gap: 20px;
border-radius: 12px;
font-size: 1rem;
background-color: var(--background-color-primary);
&.danger {
color: var(--danger-color);
}
.app-actions_menu-label {}
.app-actions_menu-icon {
font-size: 1.2rem;
}
}
}

View File

@ -62,7 +62,6 @@ const PlayerButton = (props) => {
const AccountButton = React.forwardRef((props, ref) => {
const user = app.userData
const ActionMenu = React.useRef()
const handleClick = () => {
if (!user) {
@ -73,7 +72,7 @@ const AccountButton = React.forwardRef((props, ref) => {
}
const handleHold = () => {
ActionMenu.current = app.layout.draggable.actions({
app.layout.draggable.actions({
list: [
{
key: "settings",
@ -81,8 +80,7 @@ const AccountButton = React.forwardRef((props, ref) => {
label: "Settings",
onClick: () => {
app.navigation.goToSettings()
ActionMenu.current.close()
}
},
},
{
key: "account",
@ -90,8 +88,7 @@ const AccountButton = React.forwardRef((props, ref) => {
label: "Account",
onClick: () => {
app.navigation.goToAccount()
ActionMenu.current.close()
}
},
},
{
key: "logout",
@ -100,8 +97,7 @@ const AccountButton = React.forwardRef((props, ref) => {
danger: true,
onClick: () => {
app.eventBus.emit("app.logout_request")
ActionMenu.current.close()
}
},
}
]
})

View File

@ -1,6 +1,5 @@
import React from "react"
import * as antd from "antd"
import { FloatingPanel } from "antd-mobile"
import PostCard from "@components/PostCard"
@ -8,8 +7,6 @@ import Post from "@models/post"
import "./index.less"
const floatingPanelAnchors = [160, 72 + 119, window.innerHeight * 0.8]
export default (props) => {
const post_id = props.params.post_id
@ -41,9 +38,5 @@ export default (props) => {
return <div className="postPage">
<PostCard data={data} fullmode />
<FloatingPanel anchors={floatingPanelAnchors}>
</FloatingPanel>
</div>
}

View File

@ -1,6 +1,6 @@
import React from "react"
import Ticker from "react-ticker"
import * as antd from "antd"
import Marquee from "react-fast-marquee"
import classnames from "classnames"
import UserPreview from "@components/UserPreview"
@ -341,13 +341,13 @@ export default class StreamViewer extends React.Component {
<h1>{this.state.stream.info?.title}</h1>
</div>
<div className="livestream_player_header_info_description">
<Ticker
<Marquee
mode="smooth"
>
{({ index }) => {
return <h4>{this.state.stream.info?.description}</h4>
}}
</Ticker>
</Marquee>
</div>
</div>
}

View File

@ -1,6 +1,6 @@
import React from "react"
import * as antd from "antd"
import { Input } from "antd-mobile"
import { Input } from "antd"
import { Icons } from "@components/Icons"