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
c00e9608
Commit
c00e9608
authored
Jun 27, 2023
by
Joel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: two list scroll ui
parent
2c016606
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
index.tsx
web/app/components/share/chat/sidebar/index.tsx
+5
-3
index.tsx
web/app/components/share/chat/sidebar/list/index.tsx
+2
-1
No files found.
web/app/components/share/chat/sidebar/index.tsx
View file @
c00e9608
...
...
@@ -64,6 +64,8 @@ const Sidebar: FC<ISidebarProps> = ({
checkHasPinned
()
},
[
controlUpdateList
])
const
maxListHeight
=
isInstalledApp
?
'max-h-[30vh]'
:
'max-h-[40vh]'
return
(
<
div
className=
{
...
...
@@ -88,13 +90,13 @@ const Sidebar: FC<ISidebarProps> = ({
<
PencilSquareIcon
className=
"mr-2 h-4 w-4"
/>
{
t
(
'share.chat.newChat'
)
}
</
Button
>
</
div
>
<
div
className=
'flex-grow'
>
<
div
className=
'flex-grow
h-0 overflow-y-auto overflow-x-hidden
'
>
{
/* pinned list */
}
{
hasPinned
&&
(
<
div
className=
'mt-4 px-4'
>
<
div
className=
'mb-1.5 leading-[18px] text-xs text-gray-500 font-medium uppercase'
>
{
t
(
'share.chat.pinnedTitle'
)
}
</
div
>
<
List
className=
'max-h-[40vh]'
className=
{
maxListHeight
}
currentId=
{
currentId
}
onCurrentIdChange=
{
onCurrentIdChange
}
list=
{
pinnedList
}
...
...
@@ -114,7 +116,7 @@ const Sidebar: FC<ISidebarProps> = ({
<
div
className=
'mb-1.5 leading-[18px] text-xs text-gray-500 font-medium uppercase'
>
{
t
(
'share.chat.unpinnedTitle'
)
}
</
div
>
)
}
<
List
className=
{
cn
(
hasPinned
?
'max-h-[40vh]'
:
'flex-grow'
)
}
className=
{
cn
(
hasPinned
?
maxListHeight
:
'flex-grow'
)
}
currentId=
{
currentId
}
onCurrentIdChange=
{
onCurrentIdChange
}
list=
{
list
}
...
...
web/app/components/share/chat/sidebar/list/index.tsx
View file @
c00e9608
...
...
@@ -27,6 +27,7 @@ export type IListProps = {
}
const
List
:
FC
<
IListProps
>
=
({
className
,
currentId
,
onCurrentIdChange
,
list
,
...
...
@@ -60,7 +61,7 @@ const List: FC<IListProps> = ({
return
(
<
nav
ref=
{
listRef
}
className=
"space-y-1 bg-white pb-[60px] overflow-y-auto"
className=
{
cn
(
className
,
'shrink-0 space-y-1 bg-white pb-[60px] overflow-y-auto'
)
}
>
{
list
.
map
((
item
)
=>
{
const
isCurrent
=
item
.
id
===
currentId
...
...
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