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

feat: Add Divider component #3014

Closed
Closed
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
6 changes: 6 additions & 0 deletions packages/bruno-app/src/components/Divider/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { useTheme } from 'providers/Theme/index';

export function Divider() {
const { theme } = useTheme();
return <hr className={`m-1 opacity-50 border-[${theme.divider.borderColor}]`} />;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import EnvironmentSettings from '../EnvironmentSettings';
import toast from 'react-hot-toast';
import { useDispatch } from 'react-redux';
import StyledWrapper from './StyledWrapper';
import { Divider } from 'components/Divider/index';

const EnvironmentSelector = ({ collection }) => {
const dispatch = useDispatch();
Expand Down Expand Up @@ -77,7 +78,8 @@ const EnvironmentSelector = ({ collection }) => {
<IconDatabaseOff size={18} strokeWidth={1.5} />
<span className="ml-2">No Environment</span>
</div>
<div className="dropdown-item border-top" onClick={handleSettingsIconClick}>
<Divider/>
<div className="dropdown-item" onClick={handleSettingsIconClick}>
<div className="pr-2 text-gray-600">
<IconSettings size={18} strokeWidth={1.5} />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import StyledWrapper from './StyledWrapper';
import Dropdown from 'components/Dropdown';
import CloneCollectionItem from 'components/Sidebar/Collections/Collection/CollectionItem/CloneCollectionItem/index';
import NewRequest from 'components/Sidebar/NewRequest/index';
import { Divider } from 'components/Divider/index';

const RequestTab = ({ tab, collection, tabIndex, collectionRequestTabs, folderUid }) => {
const dispatch = useDispatch();
Expand Down Expand Up @@ -301,9 +302,7 @@ function RequestTabMenu({ onDropdownCreate, collectionRequestTabs, tabIndex, col
>
Clone Request
</button>
<button className="dropdown-item w-full" onClick={(e) => handleCloseTab(e, currentTabUid)}>
Close
</button>
<Divider />
<button disabled={!hasOtherTabs} className="dropdown-item w-full" onClick={handleCloseOtherTabs}>
Close Others
</button>
Expand All @@ -313,12 +312,16 @@ function RequestTabMenu({ onDropdownCreate, collectionRequestTabs, tabIndex, col
<button disabled={!hasRightTabs} className="dropdown-item w-full" onClick={handleCloseTabsToTheRight}>
Close to the Right
</button>
<button className="dropdown-item w-full" onClick={handleCloseSavedTabs}>
Close Saved
<Divider />
<button className="dropdown-item w-full" onClick={(e) => handleCloseTab(e, currentTabUid)}>
Close
</button>
<button className="dropdown-item w-full" onClick={handleCloseAllTabs}>
Close All
</button>
<button className="dropdown-item w-full" onClick={handleCloseSavedTabs}>
Close Saved
</button>
</Dropdown>
</Fragment>
);
Expand Down
2 changes: 2 additions & 0 deletions packages/bruno-app/src/components/Sidebar/TitleBar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { useDispatch } from 'react-redux';
import { showHomePage } from 'providers/ReduxStore/slices/app';
import { openCollection, importCollection } from 'providers/ReduxStore/slices/collections/actions';
import StyledWrapper from './StyledWrapper';
import { Divider } from 'components/Divider/index';

const TitleBar = () => {
const [importedCollection, setImportedCollection] = useState(null);
Expand Down Expand Up @@ -121,6 +122,7 @@ const TitleBar = () => {
>
Import Collection
</div>
<Divider />
<div
className="dropdown-item"
onClick={(e) => {
Expand Down
4 changes: 4 additions & 0 deletions packages/bruno-app/src/themes/dark.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ const darkTheme = {

scrollbar: {
color: 'rgb(52 51 49)'
},

divider: {
borderColor: '#a3a3a3'
}
};

Expand Down
4 changes: 4 additions & 0 deletions packages/bruno-app/src/themes/light.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ const lightTheme = {

scrollbar: {
color: 'rgb(152 151 149)'
},

divider: {
borderColor: '#0a0a0a'
}
};

Expand Down