Skip to content

Commit 4d34bda

Browse files
committed
WIP vertical tabs linkeditor
1 parent f53180f commit 4d34bda

File tree

4 files changed

+51
-6
lines changed

4 files changed

+51
-6
lines changed

packages/neos-ui-link-editor-core/src/application/Dialog/Dialog.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ const ActiveLinkEditorDialog: React.FC<{
7676
return {
7777
isDirty: form.isOptionsDirty || (model ? linkType.isDirty(model) : false),
7878
isValid: model ? linkType.isValid(model) : false,
79-
initialLinkWasDeleted: form.initialLinkWasDeleted
79+
initialLinkWasDeleted: form.initialLinkWasDeleted,
80+
activeLinkTypeId: form.activeLinkTypeId
8081
};
8182
}), []);
8283

@@ -115,13 +116,15 @@ const ActiveLinkEditorDialog: React.FC<{
115116
return null;
116117
}
117118

119+
const currentLinkType = availableLinkTypes.find(linkType => linkType.id === formStatus.activeLinkTypeId)!;
120+
118121
return (
119122
<Dialog
120123
id="neos-LinkEditor"
121124
isOpen={true}
122125
preventClosing={formStatus.isDirty}
123126
onRequestClose={dismiss}
124-
title={<div>{translate('Neos.Neos.Ui:LinkEditor.Main:dialog.title', '')}</div>}
127+
title={<div>{(initialValue === null && initialLinkType === null) || initialLinkType?.id !== currentLinkType.id || formStatus.initialLinkWasDeleted ? `Create ${currentLinkType.getTitle()} Link` : `Edit ${currentLinkType.getTitle()} Link`}</div>}
125128
style="wide"
126129
autoFocus={true}
127130
actions={[
@@ -183,6 +186,7 @@ const DialogWithEmptyValue: React.FC<{
183186
<Tabs
184187
activeTab={activeTab}
185188
onActiveTabChange={setActiveTab}
189+
vertical
186190
>
187191
{props.availableLinkTypes.map((linkType) => {
188192
const {Editor} = linkType;
@@ -271,6 +275,7 @@ const DialogWithValue: React.FC<{
271275
<Tabs
272276
activeTab={activeTab}
273277
onActiveTabChange={setActiveTab}
278+
vertical
274279
>
275280
{props.availableLinkTypes.map((linkType) => {
276281
const {Editor, LoadingEditor} = linkType;

packages/neos-ui-link-editor-core/src/presentation/Layout/style.module.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
}
44

55
.stack {
6-
margin-top: 16px;
76
> * + * {
87
margin-top: 16px;
98
}

packages/react-ui-components/src/Tabs/style.module.css

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@
33
height: 100%;
44
}
55

6+
.tabs--vertical {
7+
display: flex;
8+
gap: var(--spacing-Full);
9+
}
10+
611
.tabs__content {
712
composes: reset from '../reset.module.css';
813
overflow-y: auto;
14+
flex-grow: 1;
915
}
1016

1117
.tabNavigation {
@@ -26,6 +32,13 @@
2632
clear: both;
2733
}
2834
}
35+
36+
.tabs--vertical .tabNavigation {
37+
display: flex;
38+
flex-direction: column;
39+
border-left: 1px solid var(--colors-ContrastDark);
40+
}
41+
2942
.tabNavigation__item {
3043
composes: reset from '../reset.module.css';
3144
position: relative;
@@ -56,6 +69,27 @@
5669
color: var(--colors-PrimaryBlue);
5770
}
5871
}
72+
73+
.tabs--vertical .tabNavigation__item {
74+
border-left: 1px solid var(--colors-ContrastDark);
75+
border-right: unset;
76+
}
77+
78+
.tabs--vertical .tabNavigation__item--isActive {
79+
80+
&:after {
81+
display: block;
82+
content: ' ';
83+
position: absolute;
84+
top: 0;
85+
left: 0;
86+
right: -1px;
87+
height: 100%;
88+
width: 2px;
89+
background: var(--colors-PrimaryBlue);
90+
}
91+
}
92+
5993
.tabNavigation__itemBtn {
6094
composes: reset from '../reset.module.css';
6195
display: inline-block;

packages/react-ui-components/src/Tabs/tabs.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ export interface TabsProps {
1919
/**
2020
* An optional className to render on the wrapping div.
2121
*/
22-
readonly className?: string;
22+
readonly className?: string
23+
24+
readonly vertical?: boolean;
2325

2426
/**
2527
* The children panels to render.
@@ -146,8 +148,13 @@ export default class Tabs extends PureComponent<TabsProps> {
146148
}
147149

148150
public render(): JSX.Element {
149-
const {theme, className} = this.props;
150-
const finalClassName = mergeClassNames(theme!.tabs, className);
151+
const {theme, className, vertical} = this.props;
152+
const finalClassName = mergeClassNames(
153+
theme!.tabs, {
154+
[theme!['tabs--vertical']]: vertical
155+
},
156+
className
157+
);
151158

152159
return (
153160
<div className={finalClassName} role="tablist">

0 commit comments

Comments
 (0)