Skip to content

Commit

Permalink
chore(admin): refine ColumnsToolBar (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope authored Mar 11, 2023
1 parent eac9a8d commit e97768c
Showing 1 changed file with 17 additions and 29 deletions.
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

0 comments on commit e97768c

Please sign in to comment.