Skip to content

Commit

Permalink
Merge branch 'develop' into document-alert-messages
Browse files Browse the repository at this point in the history
  • Loading branch information
nikkothari22 committed Dec 17, 2024
2 parents 053acae + 73d962a commit a49e74c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
10 changes: 6 additions & 4 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,18 @@ function App() {

const [appearance, setAppearance] = useStickyState<'light' | 'dark' | 'inherit'>('dark', 'appearance');

// We need to pass sitename only if the Frappe version is v15 or above.
// We not need to pass sitename if the Frappe version is v14.

const getSiteName = () => {
// @ts-ignore
if (window.frappe?.boot?.versions?.frappe && (window.frappe.boot.versions.frappe.startsWith('15') || window.frappe.boot.versions.frappe.startsWith('16'))) {
if (window.frappe?.boot?.versions?.frappe.startsWith('14')) {
return import.meta.env.VITE_SITE_NAME
}
// @ts-ignore
else {
// @ts-ignore
return window.frappe?.boot?.sitename ?? import.meta.env.VITE_SITE_NAME
}
return import.meta.env.VITE_SITE_NAME

}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export const MessageItem = ({ message, setDeleteMessage, isHighlighted, onReplyM
rounded-md`, isHighlighted ? 'bg-yellow-50 hover:bg-yellow-50 dark:bg-yellow-300/20 dark:hover:bg-yellow-300/20' : !isDesktop && isHovered ? 'bg-gray-2 dark:bg-gray-3' : '', isEmojiPickerOpen ? 'bg-gray-2 dark:bg-gray-3' : '')}>
<Flex className='gap-2.5 sm:gap-3 items-start'>
<MessageLeftElement message={message} user={user} isActive={isActive} />
<Flex direction='column' className='gap-0.5' justify='center' width='100%'>
<Flex direction='column' className='gap-0.5 w-[90%]' justify='center'>
{!is_continuation ? <Flex align='center' gap='2' mt='-1'>
<UserHoverCard
user={user}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,15 @@ const LinkPreview = memo(({ messageID }: { messageID: string }) => {
if (linkPreview && linkPreview.site_name && linkPreview.description) {

const image = linkPreview.absolute_image || linkPreview.image
return <Box pt='2' width={{
return <Box pt='2' maxWidth={{
md: '580px',
}} position='relative' className='group/linkpreview sm:max-w-[580px] max-w-[356px]'>
<Card asChild className='p-0 sm:p-3'>
<a href={href} target='_blank' className='flex sm:items-center flex-col sm:flex-row sm:gap-4 gap-0 sm:pr-4'>
{image && <img src={image} alt={linkPreview.title}
className='sm:w-[220px] w-full h-full object-cover sm:object-center sm:h-auto sm:-ml-3 sm:-mt-3 sm:-mb-3'
className='sm:max-w-[220px] w-full h-full object-cover sm:object-center sm:h-auto sm:-ml-3 sm:-mt-3 sm:-mb-3'
style={{
display: "block",
// marginLeft: '-12px',
// marginTop: '-12px',
// marginBottom: '-12px',
// width: "220px",
// height: "auto",
backgroundColor: "var(--gray-5)",
}} />
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/layout/Sidebar/SidebarFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const SidebarFooter = () => {

const navigate = useNavigate()

return <Stack className='mx-auto py-2' align='center' gap='3'>
return <Stack className='mx-auto py-0' align='center' gap='3'>
<Box>
<Tooltip content="Workspace Explorer" side='right'>
<IconButton aria-label='Workspace Explorer' size='3' color='gray' variant='ghost' onClick={() => navigate('/workspace-explorer')}>
Expand All @@ -43,7 +43,7 @@ export const SidebarFooter = () => {
</Tooltip>
</Box>
<Separator size='4' className={`bg-gray-4 dark:bg-gray-6`} />
<Box className='pb-4'>
<Box className='pb-4 sm:pb-0 pt-2'>
<DropdownMenu.Root>
<Tooltip content="Options" side='right'>
<DropdownMenu.Trigger>
Expand Down

0 comments on commit a49e74c

Please sign in to comment.