Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
f4702d60
Commit
f4702d60
authored
Jun 30, 2023
by
Joel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: tab header to new ui
parent
d2bceb97
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
16 deletions
+26
-16
index.tsx
web/app/components/base/tab-header/index.tsx
+25
-16
index.tsx
web/app/components/share/text-generation/index.tsx
+1
-0
No files found.
web/app/components/base/tab-header/index.tsx
View file @
f4702d60
...
...
@@ -5,12 +5,15 @@ import cn from 'classnames'
import
s
from
'./style.module.css'
type
Item
=
{
id
:
string
name
:
string
isRight
?:
boolean
extra
?:
React
.
ReactNode
}
export
type
ITabHeaderProps
=
{
items
:
{
id
:
string
name
:
string
extra
?:
React
.
ReactNode
}[]
items
:
Item
[]
value
:
string
onChange
:
(
value
:
string
)
=>
void
}
...
...
@@ -20,18 +23,24 @@ const TabHeader: FC<ITabHeaderProps> = ({
value
,
onChange
,
})
=>
{
const
renderItem
=
({
id
,
name
,
extra
}:
Item
)
=>
(
<
div
key=
{
id
}
className=
{
cn
(
id
===
value
?
`${s.itemActive} text-gray-900`
:
'text-gray-500'
,
'relative flex items-center pb-1.5 leading-6 cursor-pointer'
)
}
onClick=
{
()
=>
onChange
(
id
)
}
>
<
div
className=
'text-base font-semibold'
>
{
name
}
</
div
>
{
extra
||
''
}
</
div
>
)
return
(
<
div
className=
'flex space-x-4 border-b border-gray-200 '
>
{
items
.
map
(({
id
,
name
,
extra
})
=>
(
<
div
key=
{
id
}
className=
{
cn
(
id
===
value
?
`${s.itemActive} text-gray-900`
:
'text-gray-500'
,
'relative flex items-center pb-1.5 leading-6 cursor-pointer'
)
}
onClick=
{
()
=>
onChange
(
id
)
}
>
<
div
className=
'text-base font-semibold'
>
{
name
}
</
div
>
{
extra
||
''
}
</
div
>
))
}
<
div
className=
'flex justify-between border-b border-gray-200 '
>
<
div
className=
'flex space-x-4'
>
{
items
.
filter
(
item
=>
!
item
.
isRight
).
map
(
renderItem
)
}
</
div
>
<
div
className=
'flex space-x-4'
>
{
items
.
filter
(
item
=>
item
.
isRight
).
map
(
renderItem
)
}
</
div
>
</
div
>
)
}
...
...
web/app/components/share/text-generation/index.tsx
View file @
f4702d60
...
...
@@ -316,6 +316,7 @@ const TextGeneration: FC<IMainProps> = ({
{
id
:
'saved'
,
name
:
t
(
'share.generation.tabs.saved'
),
isRight
:
true
,
extra
:
savedMessages
.
length
>
0
?
(
<
div
className=
'ml-1 flext items-center h-5 px-1.5 rounded-md border border-gray-200 text-gray-500 text-xs font-medium'
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment