forked from lobehub/lobe-chat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c68788d
commit c7745c7
Showing
9 changed files
with
69 additions
and
72 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
src/app/chat/(desktop)/features/ChatInput/Footer/LocalFiles.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
7 changes: 1 addition & 6 deletions
7
...app/chat/components/FileList/Lightbox.tsx → src/components/FileList/Lightbox.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { memo } from 'react'; | ||
|
||
import LightBox from '@/components/FileList/Lightbox'; | ||
|
||
import FileItem from './FileItem'; | ||
import { useStyles } from './style'; | ||
|
||
interface FileListProps { | ||
alwaysShowClose?: boolean; | ||
editable?: boolean; | ||
items: string[]; | ||
} | ||
|
||
const FileList = memo<FileListProps>(({ items, editable = true, alwaysShowClose }) => { | ||
const { styles } = useStyles(); | ||
|
||
return ( | ||
<div className={styles.container}> | ||
<LightBox items={items}> | ||
{items.map((i) => ( | ||
<FileItem alwaysShowClose={alwaysShowClose} editable={editable} id={i} key={i} /> | ||
))} | ||
</LightBox> | ||
</div> | ||
); | ||
}); | ||
|
||
export default FileList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { createStyles } from 'antd-style'; | ||
|
||
import { MIN_IMAGE_SIZE } from './FileItem.style'; | ||
|
||
export const MAX_SIZE = 640; | ||
export const GAP = 8; | ||
|
||
export const useStyles = createStyles(({ css }) => ({ | ||
container: css` | ||
display: grid; | ||
grid-gap: ${GAP}px; | ||
grid-template-columns: repeat(6, 1fr); | ||
width: 100%; | ||
max-width: ${MAX_SIZE}px; | ||
& > div { | ||
grid-column: span 2; | ||
width: 100%; | ||
min-width: ${MIN_IMAGE_SIZE}px; | ||
min-height: ${MIN_IMAGE_SIZE}px; | ||
max-height: ${(MAX_SIZE - GAP) / 2}px; | ||
} | ||
& > div:nth-child(1):nth-last-child(2), | ||
& > div:nth-child(2):nth-last-child(1) { | ||
grid-column: span 3; | ||
max-height: ${(MAX_SIZE - 2 * GAP) / 3}px; | ||
} | ||
& > :nth-child(1):nth-last-child(1) { | ||
grid-column: span 6; | ||
max-height: ${MAX_SIZE}px; | ||
} | ||
`, | ||
})); |