Skip to content

Commit

Permalink
chore: patch layout
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed Oct 27, 2022
1 parent f81d103 commit 8cde7b2
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 23 deletions.
11 changes: 7 additions & 4 deletions assets/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,13 @@

// Preset
&-presets {
margin: 0;
padding: 0;
list-style: none;
background: #CCCCFF;
background: #ccccff;

ul {
margin: 0;
padding: 0;
list-style: none;
}
}

&-footer,
Expand Down
39 changes: 20 additions & 19 deletions src/PresetPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as React from 'react';
import type { PresetDate } from './interface';

export interface PresetPanelProps<T> {
Expand All @@ -16,23 +15,25 @@ export default function PresetPanel<T>(props: PresetPanelProps<T>) {
}

return (
<ul className={`${prefixCls}-presets`}>
{presets.map(({ label, value }, index) => (
<li
key={index}
onClick={() => {
onClick(value);
}}
onMouseEnter={() => {
onHover?.(value);
}}
onMouseLeave={() => {
onHover?.(null);
}}
>
{label}
</li>
))}
</ul>
<div className={`${prefixCls}-presets`}>
<ul>
{presets.map(({ label, value }, index) => (
<li
key={index}
onClick={() => {
onClick(value);
}}
onMouseEnter={() => {
onHover?.(value);
}}
onMouseLeave={() => {
onHover?.(null);
}}
>
{label}
</li>
))}
</ul>
</div>
);
}

0 comments on commit 8cde7b2

Please sign in to comment.