Fix 0.32 bis (#8346)

Various UI fixes according to discussions with Design team
This commit is contained in:
Charles Bochet
2024-11-05 18:14:44 +01:00
committed by GitHub
parent 3793f6c451
commit 88ba057b2c
12 changed files with 50 additions and 18 deletions

View File

@@ -9,6 +9,10 @@ html {
font-size: 13px; font-size: 13px;
} }
button {
font-size: 13px;
}
/* https://stackoverflow.com/questions/44543157/how-to-hide-the-google-invisible-recaptcha-badge */ /* https://stackoverflow.com/questions/44543157/how-to-hide-the-google-invisible-recaptcha-badge */
.grecaptcha-badge { .grecaptcha-badge {
visibility: hidden !important; visibility: hidden !important;

View File

@@ -20,8 +20,8 @@ import { toSpliced } from '~/utils/array/toSpliced';
import { turnIntoEmptyStringIfWhitespacesOnly } from '~/utils/string/turnIntoEmptyStringIfWhitespacesOnly'; import { turnIntoEmptyStringIfWhitespacesOnly } from '~/utils/string/turnIntoEmptyStringIfWhitespacesOnly';
const StyledDropdownMenu = styled(DropdownMenu)` const StyledDropdownMenu = styled(DropdownMenu)`
left: -1px; margin-left: -1px;
top: -1px; margin-top: -1px;
`; `;
type MultiItemFieldInputProps<T> = { type MultiItemFieldInputProps<T> = {

View File

@@ -51,6 +51,7 @@ const StyledContainer = styled.div`
const StyledContainerWithPadding = styled.div` const StyledContainerWithPadding = styled.div`
height: calc(100% - 40px); height: calc(100% - 40px);
margin-left: ${({ theme }) => theme.spacing(2)};
width: 100%; width: 100%;
`; `;

View File

@@ -34,7 +34,13 @@ export const RecordTableCellEditMode = ({
}: RecordTableCellEditModeProps) => { }: RecordTableCellEditModeProps) => {
const { refs, floatingStyles } = useFloating({ const { refs, floatingStyles } = useFloating({
placement: 'top-start', placement: 'top-start',
middleware: [flip(), offset(-32)], middleware: [
flip(),
offset({
mainAxis: -32,
crossAxis: 0,
}),
],
whileElementsMounted: autoUpdate, whileElementsMounted: autoUpdate,
}); });

View File

@@ -1,8 +1,10 @@
import styled from '@emotion/styled'; import styled from '@emotion/styled';
import { Button, IconHelpCircle } from 'twenty-ui'; import { Button, IconHelpCircle, LightIconButton } from 'twenty-ui';
import { SupportButtonSkeletonLoader } from '@/support/components/SupportButtonSkeletonLoader'; import { SupportButtonSkeletonLoader } from '@/support/components/SupportButtonSkeletonLoader';
import { useSupportChat } from '@/support/hooks/useSupportChat'; import { useSupportChat } from '@/support/hooks/useSupportChat';
import { isNavigationDrawerExpandedState } from '@/ui/navigation/states/isNavigationDrawerExpanded';
import { useRecoilValue } from 'recoil';
const StyledButtonContainer = styled.div` const StyledButtonContainer = styled.div`
display: flex; display: flex;
@@ -11,11 +13,18 @@ const StyledButtonContainer = styled.div`
export const SupportButton = () => { export const SupportButton = () => {
const { loading, isFrontChatLoaded } = useSupportChat(); const { loading, isFrontChatLoaded } = useSupportChat();
const isNavigationDrawerExpanded = useRecoilValue(
isNavigationDrawerExpandedState,
);
if (loading) { if (loading) {
return <SupportButtonSkeletonLoader />; return <SupportButtonSkeletonLoader />;
} }
return isFrontChatLoaded ? ( if (!isFrontChatLoaded) {
return;
}
return isNavigationDrawerExpanded ? (
<StyledButtonContainer> <StyledButtonContainer>
<Button <Button
variant="tertiary" variant="tertiary"
@@ -24,5 +33,7 @@ export const SupportButton = () => {
Icon={IconHelpCircle} Icon={IconHelpCircle}
/> />
</StyledButtonContainer> </StyledButtonContainer>
) : null; ) : (
<LightIconButton Icon={IconHelpCircle} />
);
}; };

View File

@@ -8,6 +8,7 @@ import {
IconChevronUp, IconChevronUp,
IconComponent, IconComponent,
IconX, IconX,
LightIconButton,
MOBILE_VIEWPORT, MOBILE_VIEWPORT,
OverflowingTextWithTooltip, OverflowingTextWithTooltip,
} from 'twenty-ui'; } from 'twenty-ui';
@@ -119,10 +120,10 @@ export const PageHeader = ({
</StyledTopBarButtonContainer> </StyledTopBarButtonContainer>
)} )}
{hasClosePageButton && ( {hasClosePageButton && (
<IconButton <LightIconButton
Icon={IconX} Icon={IconX}
size="small" size="small"
variant="tertiary" accent="tertiary"
onClick={() => onClosePage?.()} onClick={() => onClosePage?.()}
/> />
)} )}

View File

@@ -12,6 +12,7 @@ type TopBarProps = {
const StyledContainer = styled.div` const StyledContainer = styled.div`
border-bottom: ${({ theme }) => `1px solid ${theme.border.color.light}`}; border-bottom: ${({ theme }) => `1px solid ${theme.border.color.light}`};
display: flex; display: flex;
margin-left: ${({ theme }) => theme.spacing(2)};
flex-direction: column; flex-direction: column;
`; `;
@@ -27,7 +28,6 @@ const StyledTopBar = styled.div`
height: 39px; height: 39px;
justify-content: space-between; justify-content: space-between;
padding-right: ${({ theme }) => theme.spacing(2)}; padding-right: ${({ theme }) => theme.spacing(2)};
padding-left: ${({ theme }) => theme.spacing(2)};
z-index: 7; z-index: 7;
`; `;

View File

@@ -2,9 +2,9 @@ import { isNavigationDrawerExpandedState } from '@/ui/navigation/states/isNaviga
import styled from '@emotion/styled'; import styled from '@emotion/styled';
import { useSetRecoilState } from 'recoil'; import { useSetRecoilState } from 'recoil';
import { import {
IconButton,
IconLayoutSidebarLeftCollapse, IconLayoutSidebarLeftCollapse,
IconLayoutSidebarRightCollapse, IconLayoutSidebarRightCollapse,
LightIconButton,
} from 'twenty-ui'; } from 'twenty-ui';
const StyledCollapseButton = styled.div` const StyledCollapseButton = styled.div`
@@ -13,10 +13,8 @@ const StyledCollapseButton = styled.div`
color: ${({ theme }) => theme.font.color.light}; color: ${({ theme }) => theme.font.color.light};
cursor: pointer; cursor: pointer;
display: flex; display: flex;
height: ${({ theme }) => theme.spacing(4)};
justify-content: center; justify-content: center;
user-select: none; user-select: none;
width: ${({ theme }) => theme.spacing(4)};
`; `;
type NavigationDrawerCollapseButtonProps = { type NavigationDrawerCollapseButtonProps = {
@@ -41,13 +39,13 @@ export const NavigationDrawerCollapseButton = ({
) )
} }
> >
<IconButton <LightIconButton
Icon={ Icon={
direction === 'left' direction === 'left'
? IconLayoutSidebarLeftCollapse ? IconLayoutSidebarLeftCollapse
: IconLayoutSidebarRightCollapse : IconLayoutSidebarRightCollapse
} }
variant="tertiary" accent="tertiary"
size="small" size="small"
/> />
</StyledCollapseButton> </StyledCollapseButton>

View File

@@ -7,10 +7,10 @@ import { DEFAULT_WORKSPACE_LOGO } from '@/ui/navigation/navigation-drawer/consta
import { DEFAULT_WORKSPACE_NAME } from '@/ui/navigation/navigation-drawer/constants/DefaultWorkspaceName'; import { DEFAULT_WORKSPACE_NAME } from '@/ui/navigation/navigation-drawer/constants/DefaultWorkspaceName';
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile'; import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
import { NavigationDrawerAnimatedCollapseWrapper } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerAnimatedCollapseWrapper';
import { isNavigationDrawerExpandedState } from '@/ui/navigation/states/isNavigationDrawerExpanded'; import { isNavigationDrawerExpandedState } from '@/ui/navigation/states/isNavigationDrawerExpanded';
import { isNonEmptyString } from '@sniptt/guards'; import { isNonEmptyString } from '@sniptt/guards';
import { NavigationDrawerCollapseButton } from './NavigationDrawerCollapseButton'; import { NavigationDrawerCollapseButton } from './NavigationDrawerCollapseButton';
import { NavigationDrawerAnimatedCollapseWrapper } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerAnimatedCollapseWrapper';
const StyledContainer = styled.div` const StyledContainer = styled.div`
align-items: center; align-items: center;

View File

@@ -1,7 +1,13 @@
import styled from '@emotion/styled'; import styled from '@emotion/styled';
import { DropResult } from '@hello-pangea/dnd'; import { DropResult } from '@hello-pangea/dnd';
import { MouseEvent, useCallback } from 'react'; import { MouseEvent, useCallback } from 'react';
import { IconLock, IconPencil, IconPlus, useIcons } from 'twenty-ui'; import {
IconLock,
IconPencil,
IconPlus,
LightIconButtonAccent,
useIcons,
} from 'twenty-ui';
import { DraggableItem } from '@/ui/layout/draggable-list/components/DraggableItem'; import { DraggableItem } from '@/ui/layout/draggable-list/components/DraggableItem';
import { DraggableList } from '@/ui/layout/draggable-list/components/DraggableList'; import { DraggableList } from '@/ui/layout/draggable-list/components/DraggableList';
@@ -109,6 +115,7 @@ export const ViewPickerListContent = () => {
Icon: IconPencil, Icon: IconPencil,
onClick: (event: MouseEvent<HTMLButtonElement>) => onClick: (event: MouseEvent<HTMLButtonElement>) =>
handleEditViewButtonClick(event, view.id), handleEditViewButtonClick(event, view.id),
accent: 'tertiary' as LightIconButtonAccent,
}, },
].filter(isDefined)} ].filter(isDefined)}
isIconDisplayedOnHoverOnly={true} isIconDisplayedOnHoverOnly={true}

View File

@@ -217,7 +217,7 @@ const StyledButton = styled.button<
return '0'; return '0';
} }
}}; }};
box-sizing: content-box; box-sizing: border-box;
cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'pointer')}; cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'pointer')};
display: flex; display: flex;
flex-direction: row; flex-direction: row;

View File

@@ -105,7 +105,11 @@ export const LightIconButton = ({
active={active} active={active}
title={title} title={title}
> >
{Icon && <Icon size={theme.icon.size.sm} />} {Icon && (
<Icon
size={size === 'medium' ? theme.icon.size.md : theme.icon.size.sm}
/>
)}
</StyledButton> </StyledButton>
); );
}; };