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

Fixes 6223 graph button indistinguishable (#6223). Replaces Button with FloatingButton #6234

Merged
Show file tree
Hide file tree
Changes from 4 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
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ export const SettingsDataModelOverview = () => {
proOptions={{ hideAttribution: true }}
>
<Background />

<IconButtonGroup
className="react-flow__panel react-flow__controls bottom left"
size="small"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import styled from '@emotion/styled';
import { IconEye } from 'twenty-ui';

import { Button } from '@/ui/input/button/components/Button';
import { FloatingButton } from '@/ui/input/button/components/FloatingButton';
import { Card } from '@/ui/layout/card/components/Card';

import DarkCoverImage from '../assets/cover-dark.png';
Expand Down Expand Up @@ -30,12 +30,12 @@ export const SettingsObjectCoverImage = () => {
return (
<StyledCoverImageContainer>
<StyledButtonContainer>
<Button
<FloatingButton
Icon={IconEye}
title="Visualize"
size="small"
to="/settings/objects/overview"
></Button>
/>
</StyledButtonContainer>
</StyledCoverImageContainer>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { IconComponent } from 'twenty-ui';
import { Link } from 'react-router-dom';

export type FloatingButtonSize = 'small' | 'medium';
export type FloatingButtonPosition = 'standalone' | 'left' | 'middle' | 'right';
Expand All @@ -16,12 +16,18 @@ export type FloatingButtonProps = {
applyBlur?: boolean;
disabled?: boolean;
focus?: boolean;
to?: string;
};

const StyledButton = styled.button<
Pick<
FloatingButtonProps,
'size' | 'focus' | 'position' | 'applyBlur' | 'applyShadow' | 'position'
| 'size'
| 'focus'
| 'position'
| 'applyBlur'
| 'applyShadow'
| 'position'
>
>`
align-items: center;
Expand Down Expand Up @@ -87,6 +93,7 @@ const StyledButton = styled.button<
&:focus {
outline: none;
}
text-decoration: none;
`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style: Ensure text-decoration is set to none to remove underline from link.


export const FloatingButton = ({
Expand All @@ -99,6 +106,7 @@ export const FloatingButton = ({
applyShadow = true,
disabled = false,
focus = false,
to,
}: FloatingButtonProps) => {
const theme = useTheme();
return (
Expand All @@ -110,6 +118,8 @@ export const FloatingButton = ({
applyShadow={applyShadow}
position={position}
className={className}
to={to}
as={to ? Link : 'button'}
>
{Icon && <Icon size={theme.icon.size.sm} />}
{title}
Expand Down
Loading