Skip to content

Commit

Permalink
Fixed geometry
Browse files Browse the repository at this point in the history
  • Loading branch information
roll committed Dec 23, 2024
1 parent 48ac324 commit 4ecee89
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 18 deletions.
22 changes: 13 additions & 9 deletions client/components/Application/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,18 @@ export default function Content() {
const indexing = store.useStore((state) => state.indexing)
const path = store.useStore((state) => state.path)

return indexing ? (
<LoadingContent />
) : record && path ? (
<FileContent />
) : (
<EmptyContent />
const Content = indexing ? LoadingContent : record && path ? FileContent : EmptyContent

return (
<Box
id="content"
sx={{
height: '100vh',
overflow: 'hidden',
}}
>
<Content />
</Box>
)
}

Expand Down Expand Up @@ -66,9 +72,7 @@ function FileContent() {
store.onFileLeave()
}}
>
<Box>
<Controller />
</Box>
<Controller />
</ClickAwayListener>
</ErrorBoundary>
)
Expand Down
15 changes: 11 additions & 4 deletions client/components/Application/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as React from 'react'
import * as store from '@client/store'
import Box from '@mui/material/Box'
import Sidebar from './Sidebar'
import * as React from 'react'
import Content from './Content'
import Dialog from './Dialog'
import Error from './Error'
import * as store from '@client/store'
import Sidebar from './Sidebar'

export const fileMenuWidth = 284

Expand All @@ -17,7 +17,14 @@ export default function Layout() {
<React.Fragment>
<Error />
<Dialog />
<Box sx={{ display: 'grid', gridTemplateColumns: `${fileMenuWidth}px 1fr` }}>
<Box
sx={{
height: '100vh',
overflow: 'hidden',
display: 'grid',
gridTemplateColumns: `${fileMenuWidth}px 1fr`,
}}
>
<Sidebar />
<Content />
</Box>
Expand Down
1 change: 1 addition & 0 deletions client/components/Application/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default function Sidebar() {
id="sidebar"
sx={{
height: '100vh',
overflow: 'hidden',
borderRight: 'solid 1px #ddd',
}}
>
Expand Down
2 changes: 1 addition & 1 deletion client/components/Controllers/Base/Panels/Report.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Box from '@mui/material/Box'
import Report from '../../../Views/Report'
import * as types from '../../../../types'
import Report from '../../../Views/Report'

export interface ReportPanelProps {
report?: types.IReport
Expand Down
4 changes: 2 additions & 2 deletions client/components/Parts/Tooltips/Light.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ interface AllTooltipProps extends TooltipProps {
export default styled(({ className, ...props }: AllTooltipProps) => (
<Tooltip
arrow
{...props}
classes={{ popper: className }}
TransitionProps={{ timeout: 0 }}
placement="bottom"
{...props}
/>
))(({ theme, type }) => ({
[`& .${tooltipClasses.tooltip}`]: {
Expand All @@ -20,7 +20,7 @@ export default styled(({ className, ...props }: AllTooltipProps) => (
color: type == 'fileMenu' ? theme.palette.common.white : 'rgba(0, 0, 0, 0.87)',
boxShadow: theme.shadows[1],
fontSize: 16,
maxWidth: '50dvw',
maxWidth: '50vw',
},
[`& .${tooltipClasses.arrow}`]: {
color: theme.palette.OKFNCoolGray.main,
Expand Down
7 changes: 5 additions & 2 deletions client/components/Views/Report/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@ export default function ReportTable(props: ReportTableProps) {
})}
>
{value.length > 50 ? (
<LightTooltip title={value}>
<div className="cell-content" style={{ lineClamp: 1 }}>
<LightTooltip title={truncate(value, { length: 1000 })}>
<div
className="cell-content"
style={{ lineClamp: 1, cursor: 'pointer' }}
>
{truncate(value, { length: 50 })}
</div>
</LightTooltip>
Expand Down

0 comments on commit 4ecee89

Please sign in to comment.