Skip to content

Commit fbbee30

Browse files
committed
Change tab styles
1 parent 5bc84cd commit fbbee30

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

packages/mini-editor/src/editor-frame.tsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ function TabsContainer({
183183
}}
184184
onClick={onTabClick && (() => onTabClick(title))}
185185
>
186-
<div>{title}</div>
186+
<TabTitle title={title} />
187187
</div>
188188
))}
189189
<div style={{ flex: 1 }} />
@@ -192,6 +192,23 @@ function TabsContainer({
192192
)
193193
}
194194

195+
function TabTitle({ title }: { title: string }) {
196+
if (!title) {
197+
return <div />
198+
}
199+
200+
const separatorIndex = title.lastIndexOf("/") + 1
201+
const filename = title.substring(separatorIndex)
202+
const folder = title.substring(0, separatorIndex)
203+
204+
return (
205+
<div>
206+
<span style={{ opacity: 0.5 }}>{folder}</span>
207+
{filename}
208+
</div>
209+
)
210+
}
211+
195212
type TabsSnapshot = Record<
196213
string,
197214
{ left: number; active: boolean; width: number }

0 commit comments

Comments
 (0)