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

UI fixes #6714

Merged
merged 6 commits into from
Nov 29, 2022
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
@@ -1,5 +1,9 @@
@import '~@teambit/ui-foundation.ui.constants.z-indexes/z-indexes.module.scss';

.versionDropdown {
height: 100%;
z-index: $modal-z-index;

> div {
height: 100%;
display: flex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// otherwise when the dropdown is open it clashes with the content of the tree
// (this is bizarre, the tree has no position absolute)
z-index: $nav-z-index;
border-radius: 8px;

&.disabled {
> div {
cursor: unset;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
.laneGalleryIcon {
display: flex;
flex: 0;
border-radius: 8px;
font-size: 14px;

> span:first-child {
margin-right: 0px;
Expand Down
13 changes: 10 additions & 3 deletions scopes/lanes/ui/navigation/lane-switcher/lane-switcher.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { HTMLAttributes } from 'react';
import React, { HTMLAttributes, useEffect, useState } from 'react';
import { useLanes } from '@teambit/lanes.hooks.use-lanes';
import { LaneId } from '@teambit/lane-id';
import { LaneSelector } from '@teambit/lanes.ui.inputs.lane-selector';
Expand All @@ -14,13 +14,20 @@ export type LaneSwitcherProps = {

export function LaneSwitcher({ className, groupByScope = true, ...rest }: LaneSwitcherProps) {
const { lanesModel } = useLanes();
const [viewedLane, setViewedLane] = useState(lanesModel?.viewedLane);

useEffect(() => {
if (viewedLane?.id && !lanesModel?.viewedLane?.id.isEqual(viewedLane?.id)) {
setViewedLane(lanesModel?.viewedLane);
}
}, [lanesModel?.viewedLane?.id.toString()]);
JoshK2 marked this conversation as resolved.
Show resolved Hide resolved

const mainLaneId = lanesModel?.getDefaultLane()?.id;
const nonMainLaneIds = lanesModel?.getNonMainLanes().map((lane) => lane.id) || [];

const lanes: Array<LaneId> = (mainLaneId && [mainLaneId, ...nonMainLaneIds]) || nonMainLaneIds;

const selectedLaneId = lanesModel?.viewedLane?.id || mainLaneId;
const selectedLaneId = viewedLane?.id || mainLaneId;
const selectedLaneGalleryHref = selectedLaneId && LanesModel.getLaneUrl(selectedLaneId);

return (
Expand All @@ -35,7 +42,7 @@ export function LaneSwitcher({ className, groupByScope = true, ...rest }: LaneSw
<MenuLinkItem
exact={true}
className={styles.laneGalleryIcon}
icon="comps"
icon="eye"
href={selectedLaneGalleryHref}
></MenuLinkItem>
</div>
Expand Down
5 changes: 5 additions & 0 deletions scopes/ui-foundation/use-box/dropdown/dropdown.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
@import '~@teambit/base-ui.layout.breakpoints/_breakpoints.scss';
@import '~@teambit/ui-foundation.ui.constants.z-indexes/z-indexes.module.scss';

.useBox {
z-index: $modal-z-index;
}

.menu {
padding: 0;
Expand Down
6 changes: 6 additions & 0 deletions scopes/ui-foundation/use-box/menu/menu.module.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
@import '~@teambit/ui-foundation.ui.constants.z-indexes/z-indexes.module.scss';

.container {
z-index: $modal-z-index;
}

.top {
padding: 16px 24px 24px 24px;
color: var(--bit-text-color-heavy, #2b2b2b);
Expand Down
3 changes: 2 additions & 1 deletion scopes/ui-foundation/use-box/menu/menu.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useState, useMemo, ReactNode } from 'react';
import classNames from 'classnames';
import { Icon } from '@teambit/evangelist.elements.icon';
import orderBy from 'lodash.orderby';
import flatten from 'lodash.flatten';
Expand Down Expand Up @@ -33,7 +34,7 @@ export function Menu({ methods, componentName, ...rest }: MenuProps) {
const { Component } = OrderedMethods[activeTab] || {};

return (
<div {...rest}>
<div {...rest} className={classNames(rest.className, styles.container)}>
JoshK2 marked this conversation as resolved.
Show resolved Hide resolved
<div className={styles.top}>
<div className={styles.title}>
<Icon of="terminal" />
Expand Down
2 changes: 1 addition & 1 deletion scopes/workspace/workspace/workspace.ui.runtime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export class WorkspaceUI {
component: function Gallery() {
return (
<MenuLinkItem exact href="/" icon="comps">
Workspace Overview
Workspace overview
</MenuLinkItem>
);
},
Expand Down