Skip to content

Commit 2bcfccc

Browse files
committed
fix(index): fixed index function + refactor
1 parent 89cdb09 commit 2bcfccc

File tree

11 files changed

+18
-20
lines changed

11 files changed

+18
-20
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { GraphValue, ValueType } from "@/runtime/runtime";
77
import { compost as c } from "compostjs";
88
import { useEffect, useState } from "react";
99
import styled from "styled-components";
10-
import { CellId } from "./spreadsheet/spreadsheet.model";
10+
import { CellId } from "../spreadsheet/spreadsheet.model";
1111

1212
const GRAPH_RENDERER_ID = "graph-renderer";
1313

src/components/projects-sidebar.tsx renamed to src/components/sidebars/projects.sidebar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
import { useModal } from "@/hooks/useModal";
44
import { useProjects } from "@/hooks/useProjects";
5-
import { DeleteProjectModal } from "@/modals/delete-project.modal";
5+
import { DeleteProjectModal } from "@/components/modals/delete-project.modal";
66
import { ExternalLink, Trash2 } from "lucide-react";
77
import { useRouter, useSearchParams } from "next/navigation";
88
import styled from "styled-components";
9-
import { useSidebar } from "../hooks/useSidebar";
10-
import { StatusIcon } from "./status-icon";
9+
import { useSidebar } from "../../hooks/useSidebar";
10+
import { StatusIcon } from "../status-icon";
1111

1212
export const ProjectsSidebar = () => {
1313
const router = useRouter();

src/components/spreadsheet/spreadsheet.wrapper.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,15 +648,17 @@ export const SpreadsheetWrapper = () => {
648648
);
649649
};
650650

651-
const Cell = styled(SpreadsheetCell)<{
651+
interface CellProps {
652652
$selected: boolean;
653653
$referenced: boolean;
654654
$bold: boolean;
655655
$italic: boolean;
656656
$underline: boolean;
657657
$color?: string;
658658
$error: boolean;
659-
}>`
659+
}
660+
661+
const Cell = styled(SpreadsheetCell)<CellProps>`
660662
position: relative;
661663
662664
color: var(--text-1);

src/components/tabs/tabs.component.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,21 +116,16 @@ const TabLabel = styled.div`
116116
const Background = styled.div`
117117
position: absolute;
118118
119-
transition: all 150ms;
120-
121-
border-radius: 7px;
122-
123-
background-color: var(--color-1);
124-
125119
border: 1px solid var(--color-2);
120+
border-radius: 7px;
126121
127122
background-color: var(--color-1);
128123
124+
transition: all 150ms;
129125
z-index: 2;
130126
`;
131127

132128
const Content = styled.div`
133129
width: 100%;
134-
135130
padding: 10px;
136131
`;

src/components/toolbar/toolbar.component.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
"use client";
22

3-
import { ProjectsSidebar } from "@/components/projects-sidebar";
3+
import { ProjectsSidebar } from "@/components/sidebars/projects.sidebar";
44
import { Tab, Tabs } from "@/components/tabs/tabs.component";
55
import { useModal } from "@/hooks/useModal";
66
import { useOnboarding } from "@/hooks/useOnboarding";
77
import { useSpreadsheet } from "@/hooks/useSpreadsheet";
8-
import { OnboardingModal } from "@/modals/onboarding.modal";
9-
import { SaveProjectModal } from "@/modals/save-project.modal";
8+
import { OnboardingModal } from "@/components/modals/onboarding.modal";
9+
import { SaveProjectModal } from "@/components/modals/save-project.modal";
1010
import { createClientClient } from "@/utils/supabase/client";
1111
import { User } from "@supabase/supabase-js";
1212
import { useRouter, useSearchParams } from "next/navigation";
1313
import styled from "styled-components";
1414
import { useSidebar } from "../../hooks/useSidebar";
15-
import { GraphSidebar } from "../graph-sidebar";
15+
import { GraphSidebar } from "../sidebars/graph.sidebar";
1616
import { HomeTab } from "./home.tab";
1717
import { ImportExportTab } from "./import-export.tab";
1818
import { SimulationTab } from "./simulation.tab";
@@ -202,5 +202,5 @@ const RightContent = styled.div`
202202
display: flex;
203203
flex-direction: row;
204204
align-items: center;
205-
gap: 15px;
205+
gap: 10px;
206206
`;

src/hooks/useOnboarding.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
useState,
99
} from "react";
1010
import { useModal } from "./useModal";
11-
import { OnboardingModal } from "@/modals/onboarding.modal";
11+
import { OnboardingModal } from "@/components/modals/onboarding.modal";
1212
import { useLocalStorage } from "./useLocalStorage";
1313

1414
type OnboardingContextType = {

src/runtime/functions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ export namespace Functions {
507507
const lookupRange = expectRange(args, 0);
508508
const index = expectNumber(args, 1);
509509

510-
if (index.value < 0 && index.value > lookupRange.value.length - 1) {
510+
if (index.value < 0 || index.value > lookupRange.value.length - 1) {
511511
return createNumber(-1);
512512
}
513513

0 commit comments

Comments
 (0)