The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
fix: conditionally rendered Tablist only if there are multiple accounts. (#6274)
Adithya Thejas Sa8dfff3a6d8c
diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarChannelDetails.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarChannelDetails.tsxindex 6cd442b6102..3955904289a 100644--- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarChannelDetails.tsx+++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarChannelDetails.tsx@@ -12,7 +12,6 @@ const StyledDetailsContainer = styled.div`display: flex;flex-direction: column;gap: ${({ theme }) => theme.spacing(6)};- padding-top: ${({ theme }) => theme.spacing(6)};`;type SettingsAccountsCalendarChannelDetailsProps = {diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarChannelsContainer.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarChannelsContainer.tsxindex e31bfd53090..10e7017d501 100644--- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarChannelsContainer.tsx+++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarChannelsContainer.tsx@@ -1,3 +1,4 @@+import styled from '@emotion/styled';import { useRecoilValue } from 'recoil';import { CalendarChannel } from '@/accounts/types/CalendarChannel';@@ -13,6 +14,10 @@ import { TabList } from '@/ui/layout/tab/components/TabList';import { useTabList } from '@/ui/layout/tab/hooks/useTabList';import React from 'react';+const StyledCalenderContainer = styled.div`+ padding-bottom: ${({ theme }) => theme.spacing(6)};+`;+export const SettingsAccountsCalendarChannelsContainer = () => {const { activeTabIdState } = useTabList(SETTINGS_ACCOUNT_CALENDAR_CHANNELS_TAB_LIST_COMPONENT_ID,@@ -55,10 +60,14 @@ export const SettingsAccountsCalendarChannelsContainer = () => {return (<>- <TabList- tabListId={SETTINGS_ACCOUNT_CALENDAR_CHANNELS_TAB_LIST_COMPONENT_ID}- tabs={tabs}- />+ {tabs.length > 1 && (+ <StyledCalenderContainer>+ <TabList+ tabListId={SETTINGS_ACCOUNT_CALENDAR_CHANNELS_TAB_LIST_COMPONENT_ID}+ tabs={tabs}+ />+ </StyledCalenderContainer>+ )}{calendarChannels.map((calendarChannel) => (<React.Fragment key={calendarChannel.id}>{calendarChannel.id === activeTabId && (diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageChannelDetails.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageChannelDetails.tsxindex 0f1a331b6b4..930d749abd3 100644--- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageChannelDetails.tsx+++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageChannelDetails.tsx@@ -29,7 +29,6 @@ const StyledDetailsContainer = styled.div`display: flex;flex-direction: column;gap: ${({ theme }) => theme.spacing(6)};- padding-top: ${({ theme }) => theme.spacing(6)};`;export const SettingsAccountsMessageChannelDetails = ({diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageChannelsContainer.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageChannelsContainer.tsxindex 35768ddccbb..24a5f62fa1b 100644--- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageChannelsContainer.tsx+++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageChannelsContainer.tsx@@ -1,3 +1,4 @@+import styled from '@emotion/styled';import { useRecoilValue } from 'recoil';import { ConnectedAccount } from '@/accounts/types/ConnectedAccount';@@ -12,6 +13,10 @@ import { TabList } from '@/ui/layout/tab/components/TabList';import { useTabList } from '@/ui/layout/tab/hooks/useTabList';import React from 'react';+const StyledMessageContainer = styled.div`+ padding-bottom: ${({ theme }) => theme.spacing(6)};+`;+export const SettingsAccountsMessageChannelsContainer = () => {const { activeTabIdState } = useTabList(SETTINGS_ACCOUNT_MESSAGE_CHANNELS_TAB_LIST_COMPONENT_ID,@@ -54,10 +59,14 @@ export const SettingsAccountsMessageChannelsContainer = () => {return (<>- <TabList- tabListId={SETTINGS_ACCOUNT_MESSAGE_CHANNELS_TAB_LIST_COMPONENT_ID}- tabs={tabs}- />+ {tabs.length > 1 && (+ <StyledMessageContainer>+ <TabList+ tabListId={SETTINGS_ACCOUNT_MESSAGE_CHANNELS_TAB_LIST_COMPONENT_ID}+ tabs={tabs}+ />+ </StyledMessageContainer>+ )}{messageChannels.map((messageChannel) => (<React.Fragment key={messageChannel.id}>{messageChannel.id === activeTabId && (