generated from EasyWebApp/WebCell-scaffold
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[optimize] simplify Scroll List components with Query Filter
- Loading branch information
Showing
12 changed files
with
76 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,8 @@ | ||
import { Loading } from 'idea-react'; | ||
import { observable } from 'mobx'; | ||
import { DataObject } from 'mobx-restful'; | ||
import { ScrollList, ScrollListProps } from 'mobx-restful-table'; | ||
|
||
import { i18n } from '../../models/Translation'; | ||
import { ScrollListProps } from 'mobx-restful-table'; | ||
|
||
export interface XScrollListProps<T extends DataObject = DataObject> | ||
extends Pick<ScrollListProps<T>, 'defaultData'> { | ||
selectedIds?: string[]; | ||
onSelect?: (selectedIds: string[]) => any; | ||
} | ||
|
||
export abstract class XScrollList< | ||
P extends XScrollListProps, | ||
> extends ScrollList<P> { | ||
translator = i18n; | ||
|
||
@observable | ||
selectedIds: string[] = []; | ||
|
||
onSelect = (list: string[]) => | ||
(this.selectedIds = list) && this.props.onSelect?.(list); | ||
|
||
render() { | ||
const { downloading, uploading } = this.store; | ||
|
||
return ( | ||
<> | ||
{(downloading > 0 || uploading > 0) && <Loading />} | ||
|
||
{super.render()} | ||
</> | ||
); | ||
} | ||
} |
Oops, something went wrong.
8d9d85a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deploy preview for open-hackathon ready!
✅ Preview
https://open-hackathon-45r7ntul7-techquery.vercel.app
Built with commit 8d9d85a.
This pull request is being automatically deployed with vercel-action