How to use the @edtr-io/ui.styled.img function in @edtr-io/ui

To help you get started, we’ve selected a few @edtr-io/ui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github edtr-io / edtr-io / packages / plugin-image / src / renderer.tsx View on Github external
import { styled } from '@edtr-io/ui'
import * as React from 'react'

import { imageState } from '.'
import { ImageLoaded } from './upload'

const ImgWrapper = styled.div<{ maxWidth: number }>(props => {
  return {
    maxWidth: props.maxWidth > 0 ? props.maxWidth + 'px' : undefined,
    display: 'block',
    marginLeft: 'auto',
    marginRight: 'auto'
  }
})

const Img = styled.img({
  maxWidth: '100%',
  display: 'block',
  marginLeft: 'auto',
  marginRight: 'auto'
})

export class ImageRenderer extends React.Component {
  public render() {
    const { state, imagePreview, disableMouseEvents } = this.props
    const image = (
      
        <img alt="{state.description.value}" src="{imagePreview">
github edtr-io / edtr-io / packages / plugin-geogebra / src / renderer.tsx View on Github external
cache[src] = data
        setApiResponse(data)
      })
  },
  500
)

const Geogebra = styled.iframe({
  position: 'absolute',
  top: 0,
  left: 0,
  width: '100%',
  height: '100%',
  border: 'none'
})
const PreviewImage = styled.img({
  maxWidth: '100%',
  height: 'auto'
})
const ScaleContainer = styled.div(
  ({
    disableCursorEvents,
    aspectRatio
  }: {
    disableCursorEvents?: boolean
    aspectRatio: number
  }) => ({
    position: 'relative',
    padding: '0',
    paddingTop: `${100 / aspectRatio}%`,
    display: 'block',
    height: '0',