Skip to content

Commit

Permalink
feat: added text ellipsis to File Explorer title
Browse files Browse the repository at this point in the history
  • Loading branch information
EduardIvanov22 committed Nov 9, 2021
1 parent cb6f06e commit 9fcc3da
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
16 changes: 5 additions & 11 deletions src/components/atoms/SplitView/SplitView.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
import React, {
useState,
useLayoutEffect,
MouseEvent,
TouchEvent,
ReactElement,
FunctionComponent,
useEffect,
} from 'react';
import {FunctionComponent, MouseEvent, ReactElement, TouchEvent, useEffect, useLayoutEffect, useState} from 'react';
import styled from 'styled-components';

import {useAppDispatch, useAppSelector} from '@redux/hooks';
import {setLeftMenuIsActive, setPaneConfiguration, setRightMenuIsActive} from '@redux/reducers/ui';

import {AppBorders} from '@styles/Borders';
import {useAppSelector, useAppDispatch} from '@redux/hooks';
import {setPaneConfiguration, setRightMenuIsActive, setLeftMenuIsActive} from '@redux/reducers/ui';

const MIN_WIDTH = 300;
const MIN_LEFT_PANE_WIDTH = 300;
Expand Down
11 changes: 9 additions & 2 deletions src/components/organisms/FileTreePane/FileTreePane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,13 @@ const TitleBarContainer = styled.div`
justify-content: space-between;
`;

const Title = styled.span`
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
padding-right: 10px;
`;

const RightButtons = styled.div`
display: flex;
align-items: center;
Expand Down Expand Up @@ -412,7 +419,7 @@ const FileTreePane = () => {
<MonoPaneTitleCol>
<MonoPaneTitle>
<TitleBarContainer>
<span>File Explorer</span>
<Title>File Explorer</Title>
<RightButtons>
<Tooltip mouseEnterDelay={TOOLTIP_DELAY} title={BrowseFolderTooltip}>
<BrowseButton
Expand All @@ -422,7 +429,7 @@ const FileTreePane = () => {
ghost
onClick={openFileExplorer}
>
Browse
{Number(uiState.paneConfiguration.leftWidth.toFixed(2)) < 0.2 ? '' : 'Browse'}
</BrowseButton>
</Tooltip>
<Tooltip mouseEnterDelay={TOOLTIP_DELAY} title={ReloadFolderTooltip}>
Expand Down

0 comments on commit 9fcc3da

Please sign in to comment.