Skip to content

Commit

Permalink
refactor(base): drop usage of parts from default preview
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed Sep 10, 2021
1 parent b69ad4e commit e279bcf
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@

import React from 'react'
import imageUrlBuilder from '@sanity/image-url'
import assetUrlBuilder from 'part:@sanity/base/asset-url-builder'
import fileIcon from 'part:@sanity/base/file-icon'
import {assetUrlBuilder} from '../../assets'
import FileIcon from '../../components/icons/File'
import {versionedClient} from '../../client/versionedClient'
import {
DefaultPreview,
BlockImagePreview,
Expand All @@ -13,7 +14,6 @@ import {
InlinePreview,
MediaPreview,
} from '../../components/previews'
import {versionedClient} from '../../client/versionedClient'

const previewComponentMap: {[key: string]: React.ComponentType<any>} = {
default: DefaultPreview,
Expand Down Expand Up @@ -85,9 +85,9 @@ export default class SanityDefaultPreview extends React.PureComponent<Props> {
return undefined
}

renderIcon = (options) => {
renderIcon = () => {
const {icon} = this.props
const Icon = icon || fileIcon
const Icon = icon || FileIcon
return Icon && <Icon className="sanity-studio__preview-fallback-icon" />
}

Expand Down

2 comments on commit e279bcf

@vercel
Copy link

@vercel vercel bot commented on e279bcf Sep 10, 2021

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:

test-studio – ./

test-studio-git-next.sanity.build
test-studio.sanity.build

@vercel
Copy link

@vercel vercel bot commented on e279bcf Sep 10, 2021

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:

perf-studio – ./

perf-studio-git-next.sanity.build
perf-studio.sanity.build

Please sign in to comment.