mirror of
https://github.com/lifegpc/eh-downloader.git
synced 2026-06-06 05:38:44 +08:00
Update
This commit is contained in:
30
components/NewTask.tsx
Normal file
30
components/NewTask.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import { Component, ContextType } from "preact";
|
||||
import { GlobalCtx } from "./GlobalContext.tsx";
|
||||
import Fab from "preact-material-components/Fab";
|
||||
import Icon from "preact-material-components/Icon";
|
||||
import { set_state } from "../server/state.ts";
|
||||
|
||||
export type NewTaskProps = {
|
||||
show: boolean;
|
||||
};
|
||||
|
||||
export default class NewTask extends Component<NewTaskProps> {
|
||||
static contextType = GlobalCtx;
|
||||
declare context: ContextType<typeof GlobalCtx>;
|
||||
render() {
|
||||
if (!this.props.show) return null;
|
||||
return (
|
||||
<div class="new_task">
|
||||
<Fab class="close" mini={true}>
|
||||
<Icon
|
||||
onClick={() => {
|
||||
set_state((p) => p.slice(0, p.length - 4));
|
||||
}}
|
||||
>
|
||||
close
|
||||
</Icon>
|
||||
</Fab>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user