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

fixes #6223

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Faisal-imtiyaz123
2024-07-12 23:59:15 +05:30
committed by GitHub
parent 11da718482
commit f68bd1be66
3 changed files with 16 additions and 6 deletions

View File

@ -203,7 +203,6 @@ export const SettingsDataModelOverview = () => {
proOptions={{ hideAttribution: true }} proOptions={{ hideAttribution: true }}
> >
<Background /> <Background />
<IconButtonGroup <IconButtonGroup
className="react-flow__panel react-flow__controls bottom left" className="react-flow__panel react-flow__controls bottom left"
size="small" size="small"

View File

@ -1,7 +1,7 @@
import styled from '@emotion/styled'; import styled from '@emotion/styled';
import { IconEye } from 'twenty-ui'; 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 { Card } from '@/ui/layout/card/components/Card';
import DarkCoverImage from '../assets/cover-dark.png'; import DarkCoverImage from '../assets/cover-dark.png';
@ -30,12 +30,12 @@ export const SettingsObjectCoverImage = () => {
return ( return (
<StyledCoverImageContainer> <StyledCoverImageContainer>
<StyledButtonContainer> <StyledButtonContainer>
<Button <FloatingButton
Icon={IconEye} Icon={IconEye}
title="Visualize" title="Visualize"
size="small" size="small"
to="/settings/objects/overview" to="/settings/objects/overview"
></Button> />
</StyledButtonContainer> </StyledButtonContainer>
</StyledCoverImageContainer> </StyledCoverImageContainer>
); );

View File

@ -1,6 +1,6 @@
import React from 'react';
import { useTheme } from '@emotion/react'; import { useTheme } from '@emotion/react';
import styled from '@emotion/styled'; import styled from '@emotion/styled';
import { Link } from 'react-router-dom';
import { IconComponent } from 'twenty-ui'; import { IconComponent } from 'twenty-ui';
export type FloatingButtonSize = 'small' | 'medium'; export type FloatingButtonSize = 'small' | 'medium';
@ -16,12 +16,19 @@ export type FloatingButtonProps = {
applyBlur?: boolean; applyBlur?: boolean;
disabled?: boolean; disabled?: boolean;
focus?: boolean; focus?: boolean;
to?: string;
}; };
const StyledButton = styled.button< const StyledButton = styled.button<
Pick< Pick<
FloatingButtonProps, FloatingButtonProps,
'size' | 'focus' | 'position' | 'applyBlur' | 'applyShadow' | 'position' | 'size'
| 'focus'
| 'position'
| 'applyBlur'
| 'applyShadow'
| 'position'
| 'to'
> >
>` >`
align-items: center; align-items: center;
@ -87,6 +94,7 @@ const StyledButton = styled.button<
&:focus { &:focus {
outline: none; outline: none;
} }
text-decoration: none;
`; `;
export const FloatingButton = ({ export const FloatingButton = ({
@ -99,6 +107,7 @@ export const FloatingButton = ({
applyShadow = true, applyShadow = true,
disabled = false, disabled = false,
focus = false, focus = false,
to,
}: FloatingButtonProps) => { }: FloatingButtonProps) => {
const theme = useTheme(); const theme = useTheme();
return ( return (
@ -110,6 +119,8 @@ export const FloatingButton = ({
applyShadow={applyShadow} applyShadow={applyShadow}
position={position} position={position}
className={className} className={className}
to={to}
as={to ? Link : 'button'}
> >
{Icon && <Icon size={theme.icon.size.sm} />} {Icon && <Icon size={theme.icon.size.sm} />}
{title} {title}