Skip to content

Commit

Permalink
Fix app UI (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
saskliutas authored Dec 18, 2024
1 parent a643f39 commit 3e64b70
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 21 deletions.
12 changes: 2 additions & 10 deletions app/frontend/src/app/IModelBrowser/IModelBrowser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ export function IModelTile(props: IModelTileProps): React.ReactElement {
<Tile
name={props.name}
description={props.description ?? <Text isSkeleton />}
thumbnail={thumbnail ? <img style={{ objectFit: "cover" }} src={thumbnail} alt="" /> : <div ref={divRef} id="imodel-thumbnail-placeholder" />}
thumbnail={thumbnail ? thumbnail : <div ref={divRef} id="imodel-thumbnail-placeholder" />}
isActionable
onClick={async () => navigation.openRulesetEditor({ iTwinId: props.iTwinId, iModelId: props.iModelId })}
/>
Expand All @@ -307,22 +307,14 @@ export interface IModelSnapshotTileProps {

export function IModelSnapshotTile(props: IModelSnapshotTileProps): React.ReactElement {
const navigation = React.useContext(appNavigationContext);
const handleTileClick = async (event: React.MouseEvent) => {
// This function is called whenever any element within the tile is clicked
if ((event.target as Element).matches("button[aria-label='More options'], button[aria-label='More options'] *")) {
return;
}

await navigation.openRulesetEditor(props.name);
};

return (
<Tile
name={props.name}
description="Snapshot iModel"
thumbnail={<SvgImodel />}
isActionable
onClick={async (event) => handleTileClick(event)}
onClick={async () => navigation.openRulesetEditor(props.name)}
moreOptions={[
<MenuItem key="open-folder" onClick={props.openSnapshotsFolder}>
Open containing folder
Expand Down
19 changes: 9 additions & 10 deletions app/frontend/src/app/IModelBrowser/ITwinIModelBrowser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,15 @@ function ITwinBrowserGridView(props: ITwinBrowserGridViewProps): React.ReactElem
return (
<FluidGrid>
{props.iTwins.map((iTwin) => (
<div key={iTwin.id}>
<Tile
name={iTwin.displayName}
variant="folder"
isActionable
thumbnail={iTwin.image ?? <SvgProject />}
description={iTwin.number}
onClick={async () => navigate(iTwin.id)}
/>
</div>
<Tile
key={iTwin.id}
name={iTwin.displayName}
variant="folder"
isActionable
thumbnail={iTwin.image ?? <SvgProject />}
description={iTwin.number}
onClick={async () => navigate(iTwin.id)}
/>
))}
</FluidGrid>
);
Expand Down
2 changes: 1 addition & 1 deletion app/frontend/src/app/ITwinJsApp/InitializedApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ const defaultRuleset: Ruleset = {
classes: {
schemaName: "BisCore",
classNames: ["Element"],
arePolymorphic: true,
},
arePolymorphic: true,
groupByClass: true,
},
],
Expand Down

0 comments on commit 3e64b70

Please sign in to comment.