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

fix(components): fix tooltip alignment for copy button #761

Merged
merged 3 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Bug fixes

- [#671](https://github.com/alleslabs/celatone-frontend/pull/671) Fix copy button tooltip alignment
- [#754](https://github.com/alleslabs/celatone-frontend/pull/754) Fix mobile guard incorrect behavior
- [#751](https://github.com/alleslabs/celatone-frontend/pull/751) Fix fail txs should have no logs and remove stone-12-1

Expand Down
28 changes: 15 additions & 13 deletions src/lib/components/copy/Copier.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { IconProps, LayoutProps } from "@chakra-ui/react";
import { Flex, type IconProps, type LayoutProps } from "@chakra-ui/react";

import { CustomIcon } from "../icon";
import { trackUseCopier } from "lib/amplitude";
Expand Down Expand Up @@ -26,18 +26,20 @@ export const Copier = ({
value={value}
copyLabel={copyLabel}
triggerElement={
<CustomIcon
id={type}
className="copier"
display={display}
cursor="pointer"
m={0}
marginLeft={ml}
onClick={() => trackUseCopier(type, amptrackSection)}
name="copy"
boxSize={3}
color="gray.600"
/>
<Flex>
<CustomIcon
id={type}
className="copier"
display={display}
cursor="pointer"
m={0}
marginLeft={ml}
onClick={() => trackUseCopier(type, amptrackSection)}
name="copy"
boxSize={3}
color="gray.600"
/>
</Flex>
}
/>
);
54 changes: 28 additions & 26 deletions src/lib/components/copy/CopyButton.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button } from "@chakra-ui/react";
import { Button, Flex } from "@chakra-ui/react";
import type { BoxProps, ButtonProps } from "@chakra-ui/react";

import { CustomIcon } from "../icon";
Expand Down Expand Up @@ -42,31 +42,33 @@ export const CopyButton = ({
ml={ml}
w={w}
triggerElement={
<Button
w={w}
isDisabled={isDisable}
variant={variant}
size={size}
float="right"
onClick={() =>
track(AmpEvent.USE_COPY_BUTTON, {
section: amptrackSection,
subSection: amptrackSubSection,
info: amptrackInfo,
})
}
{...buttonProps}
borderRadius={size === "xs" ? 6 : 8}
>
{hasIcon && (
<CustomIcon
name="copy"
boxSize={size === "xs" ? 3 : 4}
mr={iconGap}
/>
)}
{buttonText}
</Button>
<Flex>
<Button
w={w}
isDisabled={isDisable}
variant={variant}
size={size}
float="right"
onClick={() =>
track(AmpEvent.USE_COPY_BUTTON, {
section: amptrackSection,
subSection: amptrackSubSection,
info: amptrackInfo,
})
}
{...buttonProps}
borderRadius={size === "xs" ? 6 : 8}
>
{hasIcon && (
<CustomIcon
name="copy"
boxSize={size === "xs" ? 3 : 4}
mr={iconGap}
/>
)}
{buttonText}
</Button>
</Flex>
}
/>
);
Loading