Use new tooltip from macaw in filter presets (#3467)
This commit is contained in:
parent
935c224bb2
commit
548c10676e
3 changed files with 633 additions and 483 deletions
1072
package-lock.json
generated
1072
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -33,7 +33,7 @@
|
|||
"@material-ui/lab": "^4.0.0-alpha.61",
|
||||
"@material-ui/styles": "^4.11.4",
|
||||
"@reach/auto-id": "^0.16.0",
|
||||
"@saleor/macaw-ui": "^0.8.0-pre.64",
|
||||
"@saleor/macaw-ui": "^0.8.0-pre.66",
|
||||
"@saleor/sdk": "^0.4.6",
|
||||
"@sentry/react": "^6.0.0",
|
||||
"@types/faker": "^5.1.6",
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { commonMessages } from "@dashboard/intl";
|
||||
import { Tooltip } from "@saleor/macaw-ui";
|
||||
import {
|
||||
Box,
|
||||
Button,
|
||||
|
@ -9,6 +8,7 @@ import {
|
|||
PlusIcon,
|
||||
sprinkles,
|
||||
Text,
|
||||
Tooltip,
|
||||
vars,
|
||||
} from "@saleor/macaw-ui/next";
|
||||
import React, { MouseEvent } from "react";
|
||||
|
@ -72,10 +72,16 @@ export const FilterPresetsSelect = ({
|
|||
if (!savedPresets?.length) {
|
||||
return (
|
||||
<Box display="flex" alignItems="center">
|
||||
<Tooltip title={intl.formatMessage(messages.noPresets)}>
|
||||
<Text variant="title" size="small">
|
||||
{selectAllLabel}
|
||||
</Text>
|
||||
<Tooltip>
|
||||
<Tooltip.Trigger>
|
||||
<Text variant="title" size="small">
|
||||
{selectAllLabel}
|
||||
</Text>
|
||||
</Tooltip.Trigger>
|
||||
<Tooltip.Content>
|
||||
<Tooltip.Arrow />
|
||||
{intl.formatMessage(messages.noPresets)}
|
||||
</Tooltip.Content>
|
||||
</Tooltip>
|
||||
</Box>
|
||||
);
|
||||
|
@ -179,16 +185,22 @@ export const FilterPresetsSelect = ({
|
|||
</Button>
|
||||
)}
|
||||
{showSaveButton && (
|
||||
<Tooltip title={intl.formatMessage(messages.savePreset)}>
|
||||
<Button
|
||||
className={sprinkles({
|
||||
marginLeft: 6,
|
||||
})}
|
||||
icon={<PlusIcon />}
|
||||
onClick={onSave}
|
||||
variant="secondary"
|
||||
size="small"
|
||||
/>
|
||||
<Tooltip>
|
||||
<Tooltip.Trigger>
|
||||
<Button
|
||||
className={sprinkles({
|
||||
marginLeft: 6,
|
||||
})}
|
||||
icon={<PlusIcon />}
|
||||
onClick={onSave}
|
||||
variant="secondary"
|
||||
size="small"
|
||||
/>
|
||||
</Tooltip.Trigger>
|
||||
<Tooltip.Content>
|
||||
<Tooltip.Arrow />
|
||||
{intl.formatMessage(messages.savePreset)}
|
||||
</Tooltip.Content>
|
||||
</Tooltip>
|
||||
)}
|
||||
</Box>
|
||||
|
|
Loading…
Reference in a new issue