Skip to content

Commit 3912b31

Browse files
committed
make the color of the top navbar and home button consistent
1 parent bae3816 commit 3912b31

File tree

6 files changed

+21
-8
lines changed

6 files changed

+21
-8
lines changed

src/packages/frontend/app/page.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ export const Page: React.FC = () => {
203203
return (
204204
<NavTab
205205
name="admin"
206-
label={"Admin"}
207206
label_class={NAV_CLASS}
208207
icon={"users"}
209208
active_top_tab={active_top_tab}

src/packages/frontend/app/use-context.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export function calcStyle(isNarrow: boolean): PageStyle {
5555

5656
const topBarStyle = {
5757
height: `${height}px`,
58+
background: "#fafafa",
5859
} as const;
5960

6061
const fileUseStyle = {

src/packages/frontend/components/sortable-tabs.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,14 @@ export function SortableTabs(props: Props) {
130130
);
131131
}
132132

133-
export function SortableTab({ children, id }) {
133+
export function SortableTab({ children, id, style }) {
134134
const { attributes, listeners, setNodeRef, transform, transition, active } =
135135
useSortable({ id });
136136
return (
137137
<div
138138
ref={setNodeRef}
139139
style={{
140+
...style,
140141
transform: transform
141142
? `translate3d(${transform.x}px, ${transform.y}px, 0)`
142143
: undefined,
@@ -151,11 +152,11 @@ export function SortableTab({ children, id }) {
151152
);
152153
}
153154

154-
export function renderTabBar(tabBarProps, DefaultTabBar) {
155+
export function renderTabBar(tabBarProps, DefaultTabBar, styles?) {
155156
return (
156157
<DefaultTabBar {...tabBarProps}>
157158
{(node) => (
158-
<SortableTab key={node.key} id={node.key}>
159+
<SortableTab key={node.key} id={node.key} style={styles?.[node.key]}>
159160
{node}
160161
</SortableTab>
161162
)}

src/packages/frontend/project/page/activity-bar-tabs.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export default function ProjectTabs(props: PTProps) {
5151
const openFiles = useTypedRedux({ project_id }, "open_files_order");
5252
const activeTab = useTypedRedux({ project_id }, "active_project_tab");
5353

54-
if (openFiles.size == 0) return <></>;
54+
//if (openFiles.size == 0) return <></>;
5555

5656
return (
5757
<div
@@ -207,8 +207,8 @@ export function VerticalFixedTabs({
207207
const spacing: string = showActBarLabels
208208
? "5px"
209209
: condensed
210-
? "8px" // margin for condensed mode
211-
: "12px"; // margin for normal mode
210+
? "8px" // margin for condensed mode
211+
: "12px"; // margin for normal mode
212212

213213
const tab = (
214214
<FileTab

src/packages/frontend/project/page/home-page/button.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export default function HomePageButton({ project_id, active, width }) {
3232
fontSize: "24px",
3333
color: active ? COLORS.ANTD_LINK_BLUE : COLORS.FILE_ICON,
3434
transitionDuration: "0s",
35+
background: "#fafafa",
3536
}}
3637
onClick={() => {
3738
// Showing homepage in flyout only mode, otherwise the files as usual

src/packages/frontend/projects/projects-nav.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,17 @@ export function ProjectsNav(props: ProjectsNavProps) {
295295
}
296296
}
297297

298+
function renderTabBar0(tabBarProps, DefaultTabBar) {
299+
return renderTabBar(tabBarProps, DefaultTabBar, {
300+
[activeTopTab]: {
301+
border: "1px solid #d3d3d3",
302+
borderRadius: "10px",
303+
// negative margin to prevent moving when adding the border above.
304+
margin: "-1px -1px 0 -1px",
305+
},
306+
});
307+
}
308+
298309
return (
299310
<div
300311
style={{
@@ -318,7 +329,7 @@ export function ProjectsNav(props: ProjectsNavProps) {
318329
actions.set_active_tab(project_id);
319330
}}
320331
type={"editable-card"}
321-
renderTabBar={renderTabBar}
332+
renderTabBar={renderTabBar0}
322333
items={items}
323334
/>
324335
</SortableTabs>

0 commit comments

Comments
 (0)