({
showIntroAnimation={
showIntroAnimation(row.original) && enableIntroAnimations
}
- variant="table-line"
>
{row.getVisibleCells().map((cell) => (
({
)
)}
- {table.getFooterGroups().map((footerGroup) => (
-
- {footerGroup.headers.map((header) => (
-
- {flexRender(header.column.columnDef.footer, header.getContext())}
-
- ))}
-
- ))}
);
}
diff --git a/frontend/src/components/tabs/StyledTabs.module.scss b/frontend/src/components/tabs/StyledTabs.module.scss
new file mode 100644
index 00000000..23921256
--- /dev/null
+++ b/frontend/src/components/tabs/StyledTabs.module.scss
@@ -0,0 +1,31 @@
+@import "styles/spacings";
+@import "styles/colors";
+
+.tab {
+ max-width: 120px;
+ padding: $spacing-s !important;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.activeTab {
+ background: $gray-100 !important;
+ border-bottom: 2px solid $violet-100 !important;
+}
+
+.tabLabel {
+ text-align: center;
+}
+
+.tabWrapper {
+}
+
+.tabWrapper, .inactiveTab {
+ background: $gray-110;
+}
+
+.content {
+ padding: $spacing-l;
+ background: $gray-100;
+}
diff --git a/frontend/src/components/tabs/StyledTabs.tsx b/frontend/src/components/tabs/StyledTabs.tsx
new file mode 100644
index 00000000..63c78f75
--- /dev/null
+++ b/frontend/src/components/tabs/StyledTabs.tsx
@@ -0,0 +1,19 @@
+import classes from "./StyledTabs.module.scss";
+import { Tabs, TabsProps } from "./Tabs";
+import React, { ReactElement } from "react";
+
+type StyledTabsProps = TabsProps;
+
+export function StyledTabs(props: StyledTabsProps): ReactElement {
+ return (
+
+ );
+}
diff --git a/frontend/src/components/tab-list/TabList.module.scss b/frontend/src/components/tabs/Tabs.module.scss
similarity index 91%
rename from frontend/src/components/tab-list/TabList.module.scss
rename to frontend/src/components/tabs/Tabs.module.scss
index cccf71f7..4ec30f19 100644
--- a/frontend/src/components/tab-list/TabList.module.scss
+++ b/frontend/src/components/tabs/Tabs.module.scss
@@ -34,7 +34,7 @@
background: none;
border: none;
font-size: $font-size-normal;
- color: #E5E5E5;
+ color: $gray-10;
font-family: $font-family-inter;
font-weight: bold;
width: 100%;
@@ -49,11 +49,11 @@
}
}
.tabButtonActive {
- background: #272B32;
+ background: $gray-100;
}
.tabButtonInactive {
- background: #33383e !important;
- color: rgba(229, 229, 229, 0.56) !important;
+ background: $gray-80 !important;
+ color: $gray-20 !important;
}
.newTabButton {
width: 20px;
diff --git a/frontend/src/components/tab-list/TabList.tsx b/frontend/src/components/tabs/Tabs.tsx
similarity index 73%
rename from frontend/src/components/tab-list/TabList.tsx
rename to frontend/src/components/tabs/Tabs.tsx
index 1e4e74fb..7cca6c57 100644
--- a/frontend/src/components/tab-list/TabList.tsx
+++ b/frontend/src/components/tabs/Tabs.tsx
@@ -1,6 +1,6 @@
import classNames from "classnames";
-import React, { ReactElement } from "react";
-import classes from "./TabList.module.scss";
+import React, { ReactElement, useState } from "react";
+import classes from "./Tabs.module.scss";
import { FlowserIcon } from "../icons/Icons";
export type TabItem = {
@@ -9,7 +9,7 @@ export type TabItem = {
content: React.ReactNode;
};
-type TabListProps = {
+export type TabsProps = {
label?: string;
className?: string;
tabClassName?: string;
@@ -17,25 +17,38 @@ type TabListProps = {
tabLabelClassName?: string;
activeTabClassName?: string;
inactiveTabClassName?: string;
- currentTabId: string | undefined;
- onChangeTab: (tab: TabItem) => void;
+ contentClassName?: string;
+ currentTabId?: string | undefined;
+ onChangeTab?: (tab: TabItem) => void;
onClose?: (tab: TabItem) => void;
onAddNew?: () => void;
tabs: TabItem[];
};
-export function TabList(props: TabListProps): ReactElement {
+export function Tabs(props: TabsProps): ReactElement {
const {
label,
className,
tabWrapperClassName,
tabLabelClassName,
tabs,
- currentTabId,
- onChangeTab,
onClose,
onAddNew,
} = props;
+
+ const [fallbackCurrentTabId, setFallbackCurrentTabId] = useState(
+ props.tabs[0]?.id
+ );
+ const currentTabId = props.currentTabId ?? fallbackCurrentTabId;
+
+ function onChangeTab(tab: TabItem) {
+ if (props.onChangeTab) {
+ props.onChangeTab(tab);
+ } else {
+ setFallbackCurrentTabId(tab.id);
+ }
+ }
+
const currentTab = tabs.find((tab) => tab.id === currentTabId);
return (
@@ -74,7 +87,9 @@ export function TabList(props: TabListProps): ReactElement {
)}
- {currentTab?.content}
+
+ {currentTab?.content}
+
);
}
diff --git a/frontend/src/components/text-area/TextArea.module.scss b/frontend/src/components/text-area/TextArea.module.scss
deleted file mode 100644
index e8f6ee78..00000000
--- a/frontend/src/components/text-area/TextArea.module.scss
+++ /dev/null
@@ -1,26 +0,0 @@
-@import 'styles/rules';
-@import 'styles/colors';
-@import 'styles/typography';
-@import 'styles/spacings';
-
-.root {
- border: 1px solid $color-input-border;
- border-radius: $border-radius-input;
- display: flex;
- width: 100%;
- overflow: hidden;
-
- &:focus-within {
- border-color: $yellow;
- }
-
- & > textarea {
- flex: 1;
- border: none;
- background: none;
- padding: 10px $spacing-base * 2;
- outline: none;
- color: $color-grey;
- font-size: $font-size-small;
- }
-}
diff --git a/frontend/src/components/text-area/TextArea.tsx b/frontend/src/components/text-area/TextArea.tsx
deleted file mode 100644
index 8b4566c3..00000000
--- a/frontend/src/components/text-area/TextArea.tsx
+++ /dev/null
@@ -1,30 +0,0 @@
-import React, { ForwardRefRenderFunction } from "react";
-import classes from "./TextArea.module.scss";
-
-export type TextAreaProps = React.DetailedHTMLProps<
- React.TextareaHTMLAttributes