Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(admin): refine ColumnsToolBar #241

Merged
merged 1 commit into from
Mar 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 17 additions & 29 deletions packages/admin/src/components/ColumnsToolBar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,43 +1,31 @@
import { Dropdown, Menu, Space } from 'antd';
import { useMemo } from 'react';
import { Dropdown, Space } from "antd";
import { useMemo } from "react";

export default function (props: { nodes: any[]; outs: any[] }) {
const items = useMemo(() => {
return props.nodes.map((val, index) => {
return {
const items = useMemo(
() =>
props.nodes.map((val, index) => ({
key: index,
label: val,
};
});
}, [props.nodes]);
const menu = <Menu items={items} />;
})),
[props.nodes]
);

return (
<Space>
{props.outs}
<Dropdown overlay={menu} trigger={['click']}>
<Dropdown menu={{ items }} trigger={["click"]}>
<a className="more-hover">
<svg
fill="currentColor"
viewBox="0 0 1024 1024"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
p-id="2390"
width={20}
height={20}
style={{ transform: 'translateY(3px)' }}
viewBox="0 0 1024 1024"
width="20"
height="20"
fill="currentColor"
// FIXME: Update icon instead of using css to adjust center
style="transform:translateY(3px)"
>
<path
d="M223.962372 607.897867c-52.980346 0-95.983874-43.003528-95.983874-95.983874s43.003528-95.983874 95.983874-95.983874 95.983874 43.003528 95.983874 95.983874S276.942718 607.897867 223.962372 607.897867z"
p-id="2391"
></path>
<path
d="M511.913993 607.897867c-52.980346 0-95.983874-43.003528-95.983874-95.983874s43.003528-95.983874 95.983874-95.983874 95.983874 43.003528 95.983874 95.983874S564.894339 607.897867 511.913993 607.897867z"
p-id="2392"
></path>
<path
d="M800.037628 607.897867c-52.980346 0-95.983874-43.003528-95.983874-95.983874s43.003528-95.983874 95.983874-95.983874 95.983874 43.003528 95.983874 95.983874S852.84596 607.897867 800.037628 607.897867z"
p-id="2393"
></path>
<path d="M223.962 607.898c-52.98 0-95.984-43.004-95.984-95.984s43.004-95.984 95.984-95.984 95.984 43.004 95.984 95.984-43.003 95.984-95.984 95.984zM511.914 607.898c-52.98 0-95.984-43.004-95.984-95.984s43.004-95.984 95.984-95.984 95.984 43.004 95.984 95.984-43.004 95.984-95.984 95.984zM800.038 607.898c-52.98 0-95.984-43.004-95.984-95.984s43.003-95.984 95.984-95.984 95.984 43.004 95.984 95.984-43.176 95.984-95.984 95.984z" />
</svg>
</a>
</Dropdown>
Expand Down