Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/imodel-browser-react",
"comment": "Update itwinUI version in storybook",
Comment thread
arome marked this conversation as resolved.
Outdated
"type": "none"
}
],
"packageName": "@itwin/imodel-browser-react"
}
11 changes: 8 additions & 3 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/apps/storybook/.storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import addons from "@storybook/addons";
import { themes } from "@storybook/theming";

import { darkTheme, lightTheme } from "./itwinTheme";
import '@itwin/itwinui-react/styles.css';

// get an instance to the communication channel for the manager and preview
const channel = addons.getChannel();
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@itwin/delete-imodel-react": "workspace:*",
"@itwin/delete-itwin-react": "workspace:*",
"@itwin/imodel-browser-react": "workspace:*",
"@itwin/itwinui-react": "^2.12.18",
"@itwin/itwinui-react": "3.18.0",
"@itwin/manage-versions-react": "workspace:*",
"@itwin/storybook-auth-addon": "workspace:*",
"@storybook/addon-actions": "^6.5.16",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
import { IModelTile as C, IModelTileProps } from "@itwin/imodel-browser-react";
import { MiddleTextTruncation } from "@itwin/itwinui-react";
import { Meta, Story } from "@storybook/react/types-6-0";
import React from "react";

Expand All @@ -17,4 +18,8 @@ export default {
const Template: Story<IModelTileProps> = (args) => <IModelTile {...args} />;

export const Primary = Template.bind({});
Primary.args = {};
Primary.args = {
iModel: {
id: "1",
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@ export default {
const Template: Story<ITwinTileProps> = (args) => <ITwinTile {...args} />;

export const Primary = Template.bind({});
Primary.args = {};
Primary.args = {
iTwin: {
id: "1",
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const ITwinTile = ({
return (
<ThemeProvider theme="inherit">
<Tile.Wrapper
key={iTwin?.id}
key={iTwin.id}
isNew={isNew}
isSelected={isSelected}
isLoading={isLoading}
Expand All @@ -118,7 +118,7 @@ export const ITwinTile = ({
aria-disabled={isDisabled}
data-testid={`iTwin-tile-${iTwin.id}`}
>
{name ?? iTwin?.displayName}
{name ?? iTwin.displayName}
</Tile.Action>
</Tile.NameLabel>
</Tile.Name>
Expand All @@ -134,8 +134,8 @@ export const ITwinTile = ({
}
onClick={async () => {
isFavorite
? await removeFromFavorites?.(iTwin?.id)
: await addToFavorites?.(iTwin?.id);
? await removeFromFavorites?.(iTwin.id)
: await addToFavorites?.(iTwin.id);
}}
styleType="borderless"
>
Expand All @@ -144,7 +144,7 @@ export const ITwinTile = ({
</Tile.QuickAction>
<Tile.BadgeContainer>
{badge ??
(iTwin?.status &&
(iTwin.status &&
iTwin.status.toLocaleLowerCase() !== "active" && (
<Badge
backgroundColor={
Expand All @@ -167,7 +167,7 @@ export const ITwinTile = ({
</Tile.ThumbnailArea>
<Tile.ContentArea>
<Tile.Description>
{description ?? iTwin?.number ?? ""}
{description ?? iTwin.number ?? ""}
</Tile.Description>
{metadata && <Tile.Metadata>{metadata}</Tile.Metadata>}
{children}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ export const IModelTile = ({
[iModelOptions, iModel, refetchIModels]
);
const thumbnailApiOverride =
apiOverrides || iModel?.thumbnail
apiOverrides || iModel.thumbnail
? {
...(apiOverrides ?? {}),
data: iModel?.thumbnail,
data: iModel.thumbnail,
}
: undefined;

Expand Down