-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1066 from datopian/feature/iframe-component
Created Iframe component
- Loading branch information
Showing
5 changed files
with
53 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@portaljs/components': patch | ||
--- | ||
|
||
Created Iframe component |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { CSSProperties } from "react"; | ||
|
||
export interface IframeProps { | ||
url: string; | ||
style?: CSSProperties; | ||
} | ||
|
||
export function Iframe({ | ||
url, style | ||
}: IframeProps) { | ||
return ( | ||
<iframe src={url} style={style ?? { width: `100%`, height: `100%` }}></iframe> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { type Meta, type StoryObj } from '@storybook/react'; | ||
|
||
import { Iframe, IframeProps } from '../src/components/Iframe'; | ||
|
||
const meta: Meta = { | ||
title: 'Components/Iframe', | ||
component: Iframe, | ||
tags: ['autodocs'], | ||
argTypes: { | ||
url: { | ||
description: | ||
'Page to display inside of the component', | ||
}, | ||
style: { | ||
description: | ||
'Style of the component', | ||
}, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<IframeProps>; | ||
|
||
export const Normal: Story = { | ||
name: 'Iframe', | ||
args: { | ||
url: 'https://app.powerbi.com/view?r=eyJrIjoiYzBmN2Q2MzYtYzE3MS00ODkxLWE5OWMtZTQ2MjBlMDljMDk4IiwidCI6Ijk1M2IwZjgzLTFjZTYtNDVjMy04MmM5LTFkODQ3ZTM3MjMzOSIsImMiOjh9', | ||
style: {width: `100%`, height: `100%`} | ||
}, | ||
}; |
7049917
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
portaljs-storybook – ./packages/components/
portaljs-storybook-git-main-datopian1.vercel.app
portaljs-storybook-datopian1.vercel.app
portaljs-storybook.vercel.app
storybook.portaljs.org