Skip to content

Commit

Permalink
Fix shrinked horizontal separator (#9192)
Browse files Browse the repository at this point in the history
Related issue:
https://discord.com/channels/1130383047699738754/1317185369577492532/1317185369577492532.

TL;DR: When used in a flex container, the separators gets hidden when
the container becomes scrollable. We must ensure they can't shrink.

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
  • Loading branch information
Devessier and lucasbordeau authored Dec 30, 2024
1 parent e153168 commit e1c99be
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export const SignInUpGlobalScopeForm = () => {
{authProviders.google && <SignInUpWithGoogle />}
{authProviders.microsoft && <SignInUpWithMicrosoft />}
{(authProviders.google || authProviders.microsoft) && (
<HorizontalSeparator visible />
<HorizontalSeparator />
)}
{/* eslint-disable-next-line react/jsx-props-no-spreading */}
<FormProvider {...form}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const SignInUpWorkspaceScopeForm = () => {
workspaceAuthProviders.microsoft ||
workspaceAuthProviders.sso.length > 0) &&
workspaceAuthProviders.password ? (
<HorizontalSeparator visible />
<HorizontalSeparator />
) : null}

{workspaceAuthProviders.password && <SignInUpWithCredentials />}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
/* @license Enterprise */

import { parseSAMLMetadataFromXMLFile } from '@/settings/security/utils/parseSAMLMetadataFromXMLFile';
import { SnackBarVariant } from '@/ui/feedback/snack-bar-manager/components/SnackBar';
import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
import { TextInput } from '@/ui/input/components/TextInput';
import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { ChangeEvent, useRef } from 'react';
import { useFormContext } from 'react-hook-form';
import {
HorizontalSeparator,
Button,
H2Title,
HorizontalSeparator,
IconCheck,
IconCopy,
IconDownload,
IconUpload,
Section,
} from 'twenty-ui';
import { parseSAMLMetadataFromXMLFile } from '@/settings/security/utils/parseSAMLMetadataFromXMLFile';
import { SnackBarVariant } from '@/ui/feedback/snack-bar-manager/components/SnackBar';
import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
import { TextInput } from '@/ui/input/components/TextInput';
import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { ChangeEvent, useRef } from 'react';
import { useFormContext } from 'react-hook-form';
import { REACT_APP_SERVER_BASE_URL } from '~/config';
import { isDefined } from '~/utils/isDefined';

Expand Down Expand Up @@ -156,7 +156,7 @@ export const SettingsSSOSAMLForm = () => {
title="Download file"
></Button>
</StyledContainer>
<HorizontalSeparator visible={true} text={'Or'} />
<HorizontalSeparator text={'Or'} />
<StyledContainer>
<StyledLinkContainer>
<TextInput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ type HorizontalSeparatorProps = {
const StyledSeparator = styled.div<HorizontalSeparatorProps>`
background-color: ${({ theme, color }) => color ?? theme.border.color.medium};
height: ${({ visible }) => (visible ? '1px' : 0)};
flex-shrink: 0;
margin-bottom: ${({ theme, noMargin }) => (noMargin ? 0 : theme.spacing(3))};
margin-top: ${({ theme, noMargin }) => (noMargin ? 0 : theme.spacing(3))};
width: 100%;
Expand Down

0 comments on commit e1c99be

Please sign in to comment.