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
a6af8e5d
Unverified
Commit
a6af8e5d
authored
Jul 18, 2023
by
zxhlyh
Committed by
GitHub
Jul 18, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix/new conversation in mobile phone (#593)
parent
3e1d5ac5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
9 deletions
+40
-9
header.tsx
web/app/components/share/header.tsx
+40
-9
No files found.
web/app/components/share/header.tsx
View file @
a6af8e5d
import
type
{
FC
}
from
'react'
import
React
from
'react'
import
{
Bars3Icon
,
PencilSquareIcon
,
}
from
'@heroicons/react/24/solid'
import
AppIcon
from
'@/app/components/base/app-icon'
export
type
IHeaderProps
=
{
title
:
string
customerIcon
?:
React
.
ReactNode
...
...
@@ -8,6 +13,8 @@ export type IHeaderProps = {
icon_background
:
string
isMobile
?:
boolean
isEmbedScene
?:
boolean
onShowSideBar
?:
()
=>
void
onCreateNewChat
?:
()
=>
void
}
const
Header
:
FC
<
IHeaderProps
>
=
({
title
,
...
...
@@ -16,22 +23,25 @@ const Header: FC<IHeaderProps> = ({
icon
,
icon_background
,
isEmbedScene
=
false
,
onShowSideBar
,
onCreateNewChat
,
})
=>
{
return
!
isMobile
?
null
:
(
if
(
!
isMobile
)
return
null
if
(
isEmbedScene
)
{
return
(
<
div
className=
{
`shrink-0 flex items-center justify-between h-12 px-3 bg-gray-100 ${
isEmbedScene ? 'bg-gradient-to-r from-blue-600 to-sky-500' : ''
}`
}
className=
{
`
shrink-0 flex items-center justify-between h-12 px-3 bg-gray-100
bg-gradient-to-r from-blue-600 to-sky-500
`
}
>
<
div
></
div
>
<
div
className=
"flex items-center space-x-2"
>
{
customerIcon
||
<
AppIcon
size=
"small"
icon=
{
icon
}
background=
{
icon_background
}
/>
}
<
div
className=
{
`text-sm text-gray-800 font-bold ${
isEmbedScene ? 'text-white' : ''
}`
}
className=
{
'text-sm font-bold text-white'
}
>
{
title
}
</
div
>
...
...
@@ -39,6 +49,27 @@ const Header: FC<IHeaderProps> = ({
<
div
></
div
>
</
div
>
)
}
return
(
<
div
className=
"shrink-0 flex items-center justify-between h-12 px-3 bg-gray-100"
>
<
div
className=
'flex items-center justify-center h-8 w-8 cursor-pointer'
onClick=
{
()
=>
onShowSideBar
?.()
}
>
<
Bars3Icon
className=
"h-4 w-4 text-gray-500"
/>
</
div
>
<
div
className=
'flex items-center space-x-2'
>
<
AppIcon
size=
"small"
icon=
{
icon
}
background=
{
icon_background
}
/>
<
div
className=
" text-sm text-gray-800 font-bold"
>
{
title
}
</
div
>
</
div
>
<
div
className=
'flex items-center justify-center h-8 w-8 cursor-pointer'
onClick=
{
()
=>
onCreateNewChat
?.()
}
>
<
PencilSquareIcon
className=
"h-4 w-4 text-gray-500"
/>
</
div
>
</
div
>
)
}
export
default
React
.
memo
(
Header
)
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