-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Juli Ovechkina
authored
Nov 23, 2023
1 parent
87fb74f
commit 5b0c26d
Showing
14 changed files
with
247 additions
and
9 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
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
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,25 @@ | ||
@import '../../../../styles/variables.scss'; | ||
@import '../../../../styles/mixins'; | ||
|
||
$block: '.#{$ns}media-component-iframe'; | ||
|
||
#{$block} { | ||
overflow: hidden; | ||
|
||
&_margins { | ||
margin: $indentSM; | ||
|
||
#{$block}__item { | ||
border-radius: 0; | ||
} | ||
} | ||
|
||
#{$block}__iframe { | ||
border-radius: 0; | ||
} | ||
|
||
&__item { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
} |
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,32 @@ | ||
import React from 'react'; | ||
|
||
import {MediaComponentIframeProps} from '../../../models'; | ||
import {block} from '../../../utils'; | ||
|
||
import i18n from './i18n'; | ||
|
||
import './Iframe.scss'; | ||
|
||
const b = block('media-component-iframe'); | ||
|
||
const Iframe = (props: MediaComponentIframeProps) => { | ||
const {iframe, margins = true} = props; | ||
const {height = 400, src, width, name, title} = iframe; | ||
|
||
return iframe ? ( | ||
<div className={b({margins})} style={{height}}> | ||
<iframe | ||
className={b('item')} | ||
loading="lazy" | ||
title={title || i18n('iframe-title')} | ||
frameBorder={0} | ||
src={src} | ||
width={width} | ||
height={height} | ||
name={name} | ||
/> | ||
</div> | ||
) : null; | ||
}; | ||
|
||
export default 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"iframe-title": "Datalens frame" | ||
} |
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,8 @@ | ||
import {registerKeyset} from '../../../../utils/registerKeyset'; | ||
|
||
import en from './en.json'; | ||
import ru from './ru.json'; | ||
|
||
const COMPONENT = 'Iframe'; | ||
|
||
export default registerKeyset({en, ru}, 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,3 @@ | ||
{ | ||
"iframe-title": "Фрейм данных" | ||
} |
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
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
Oops, something went wrong.