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

Change spacing between content and bottom button #7381

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -7,7 +7,7 @@ import { AccessMethodSetting } from '../../shared/daemon-rpc-types';
import { messages } from '../../shared/gettext';
import { useAppContext } from '../context';
import { useApiAccessMethodTest } from '../lib/api-access-methods';
import { Flex } from '../lib/components';
import { Container, Flex } from '../lib/components';
import { Spacings } from '../lib/foundations';
import { useHistory } from '../lib/history';
import { generateRoutePath } from '../lib/routeHelpers';
Expand All @@ -24,13 +24,7 @@ import {
import ImageView from './ImageView';
import InfoButton from './InfoButton';
import { BackAction } from './KeyboardNavigation';
import {
Layout,
SettingsContainer,
SettingsContent,
SettingsNavigationScrollbars,
SettingsStack,
} from './Layout';
import { Layout, SettingsContainer, SettingsContent, SettingsNavigationScrollbars } from './Layout';
import { ModalAlert, ModalAlertType } from './Modal';
import {
NavigationBar,
Expand All @@ -40,7 +34,7 @@ import {
TitleBarItem,
} from './NavigationBar';
import SettingsHeader, { HeaderSubTitle, HeaderTitle } from './SettingsHeader';
import { SmallButton, SmallButtonColor, SmallButtonGroup } from './SmallButton';
import { SmallButton, SmallButtonColor } from './SmallButton';

const StyledContextMenuButton = styled(Cell.Icon)({
alignItems: 'center',
Expand Down Expand Up @@ -127,7 +121,7 @@ export default function ApiAccessMethods() {
</HeaderSubTitle>
</SettingsHeader>

<SettingsStack>
<Flex $flexDirection="column" $gap={Spacings.spacing6}>
<Cell.Group $noMarginBottom>
<ApiAccessMethod
method={methods.direct}
Expand All @@ -150,11 +144,10 @@ export default function ApiAccessMethods() {
/>
))}
</Cell.Group>

<SmallButtonGroup $noMarginTop>
<Container size="4" $flex={1} $justifyContent="flex-end">
<SmallButton onClick={navigateToNew}>{messages.gettext('Add')}</SmallButton>
</SmallButtonGroup>
</SettingsStack>
</Container>
</Flex>
</SettingsContent>
</SettingsNavigationScrollbars>
</NavigationContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from '../../shared/application-types';
import { messages } from '../../shared/gettext';
import { useAppContext } from '../context';
import { Flex, FootnoteMini } from '../lib/components';
import { Button, Container, Flex, FootnoteMini } from '../lib/components';
import { Colors, Spacings } from '../lib/foundations';
import { useHistory } from '../lib/history';
import { formatHtml } from '../lib/html-formatter';
Expand All @@ -19,6 +19,7 @@ import { IReduxState } from '../redux/store';
import Accordion from './Accordion';
import * as AppButton from './AppButton';
import * as Cell from './cell';
import { measurements } from './common-styles';
import { CustomScrollbarsRef } from './CustomScrollbars';
import ImageView from './ImageView';
import { BackAction } from './KeyboardNavigation';
Expand Down Expand Up @@ -495,42 +496,54 @@ export function SplitTunnelingSettings(props: IPlatformSplitTunnelingSettingsPro
<StyledSearchBar searchTerm={searchTerm} onSearch={setSearchTerm} />
)}

<Accordion expanded={showSplitSection}>
<Cell.Section sectionTitle={excludedTitle}>
<ApplicationList
data-testid="split-applications"
applications={filteredSplitApplications}
rowRenderer={excludedRowRenderer}
/>
</Cell.Section>
</Accordion>

<Accordion expanded={showNonSplitSection}>
<Cell.Section sectionTitle={allTitle}>
<ApplicationList
data-testid="non-split-applications"
applications={filteredNonSplitApplications}
rowRenderer={includedRowRenderer}
/>
</Cell.Section>
</Accordion>

{canEditSplitTunneling && searchTerm !== '' && !showSplitSection && !showNonSplitSection && (
<StyledNoResult>
<StyledNoResultText>
{formatHtml(
sprintf(messages.gettext('No result for <b>%(searchTerm)s</b>.'), { searchTerm }),
)}
</StyledNoResultText>
<StyledNoResultText>{messages.gettext('Try a different search.')}</StyledNoResultText>
</StyledNoResult>
)}
<Flex
$flexDirection="column"
$gap={Spacings.spacing6}
$margin={{ bottom: measurements.verticalViewMargin }}>
<Flex $flexDirection="column" $gap={Spacings.spacing5}>
<Accordion expanded={showSplitSection}>
<Cell.Section sectionTitle={excludedTitle}>
<ApplicationList
data-testid="split-applications"
applications={filteredSplitApplications}
rowRenderer={excludedRowRenderer}
/>
</Cell.Section>
</Accordion>

<Accordion expanded={showNonSplitSection}>
<Cell.Section sectionTitle={allTitle}>
<ApplicationList
data-testid="non-split-applications"
applications={filteredNonSplitApplications}
rowRenderer={includedRowRenderer}
/>
</Cell.Section>
</Accordion>
</Flex>

{canEditSplitTunneling && (
<StyledBrowseButton onClick={addWithFilePicker}>
{messages.pgettext('split-tunneling-view', 'Find another app')}
</StyledBrowseButton>
)}
{canEditSplitTunneling &&
searchTerm !== '' &&
!showSplitSection &&
!showNonSplitSection && (
<StyledNoResult>
<StyledNoResultText>
{formatHtml(
sprintf(messages.gettext('No result for <b>%(searchTerm)s</b>.'), { searchTerm }),
)}
</StyledNoResultText>
<StyledNoResultText>{messages.gettext('Try a different search.')}</StyledNoResultText>
</StyledNoResult>
)}

{canEditSplitTunneling && (
<Container size="3">
<Button onClick={addWithFilePicker}>
{messages.pgettext('split-tunneling-view', 'Find another app')}
</Button>
</Container>
)}
</Flex>
</>
);
}
Expand Down Expand Up @@ -590,10 +603,7 @@ function ApplicationList<T extends IApplication>(props: IApplicationListProps<T>
);
} else {
return (
<Flex
$flexDirection="column"
$margin={{ bottom: Spacings.spacing5 }}
data-testid={props['data-testid']}>
<Flex $flexDirection="column" data-testid={props['data-testid']}>
<List
data-testid={props['data-testid']}
items={props.applications.sort((a, b) => a.name.localeCompare(b.name))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const StyledNoResult = styled(Cell.CellFooter)({
flexDirection: 'column',
paddingTop: 0,
marginTop: 0,
marginBottom: Spacings.spacing12,
marginBottom: Spacings.spacing9,
});

export const StyledNoResultText = styled(Cell.CellFooterText)({
Expand Down
Loading