Skip to content

Commit

Permalink
finding the spot
Browse files Browse the repository at this point in the history
  • Loading branch information
VargaJoe committed Oct 9, 2023
1 parent e698fe7 commit 116cce0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion apps/sensenet/src/components/content/Explore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export function Explore({
const contentTypeName = useQuery().get('content-type')
const pathFromUrl = useQuery().get('path')
const snRoute = useSnRoute()
const activeAction = snRoute.match!.params.action
let activeAction = snRoute.match!.params.action

const onActivateItemOverride = async (activeItem: GenericContent) => {
const expandedItem = await repository.load({
Expand All @@ -113,6 +113,11 @@ export function Explore({

const onTreeLoadingChange = useCallback((isLoading) => setIsTreeLoading(isLoading), [])

console.log('!!!', snRoute, activeContent)
if (activeContent.endsWith('png') || activeContent.endsWith('jpg') || activeContent.endsWith('jpeg')) {
activeAction = 'image'
}

const renderContent = () => {
switch (activeAction) {
case 'browse':
Expand Down Expand Up @@ -152,6 +157,8 @@ export function Explore({
return <VersionView key={activeContent} contentPath={`${rootPath}${activeContent}`} />
case 'setpermissions':
return <PermissionView key={activeContent} contentPath={`${rootPath}${activeContent}`} />
case 'image':
return <img src={`${repository.configuration.repositoryUrl}${rootPath}${activeContent}`} alt="" />
case 'preview':
return <DocumentViewer key={activeContent} contentPath={`${rootPath}${activeContent}`} />
case 'edit-binary':
Expand Down

0 comments on commit 116cce0

Please sign in to comment.