mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-14 13:44:41 +08:00
fc4b3b56d7
Summary: Fixes: T1334 remove final InboxApp references move out all underscore-plus methods Mass find and replace of underscore-plus sed -i '' -- 's/underscore-plus/underscore/g' **/*.coffee sed -i '' -- 's/underscore-plus/underscore/g' **/*.cjsx Test Plan: edgehill --test Reviewers: bengotow Reviewed By: bengotow Differential Revision: https://phab.nylas.com/D1534
39 lines
1 KiB
CoffeeScript
39 lines
1 KiB
CoffeeScript
React = require 'react'
|
|
_ = require "underscore"
|
|
{Utils, FileDownloadStore, Actions} = require 'nylas-exports'
|
|
{Spinner, EventedIFrame} = require 'nylas-component-kit'
|
|
FileFrameStore = require './file-frame-store'
|
|
|
|
class FileFrame extends React.Component
|
|
@displayName: 'FileFrame'
|
|
|
|
render: =>
|
|
src = if @state.ready then @state.filepath else ''
|
|
if @state.file
|
|
<div className="file-frame-container">
|
|
<EventedIFrame src={src} />
|
|
<Spinner visible={!@state.ready} />
|
|
</div>
|
|
else
|
|
<div></div>
|
|
|
|
constructor: (@props) ->
|
|
@state = @getStateFromStores()
|
|
|
|
componentDidMount: =>
|
|
@_unsubscribers = []
|
|
@_unsubscribers.push FileFrameStore.listen @_onChange
|
|
|
|
componentWillUnmount: =>
|
|
unsubscribe() for unsubscribe in @_unsubscribers
|
|
|
|
getStateFromStores: =>
|
|
file: FileFrameStore.file()
|
|
filepath: FileDownloadStore.pathForFile(FileFrameStore.file())
|
|
ready: FileFrameStore.ready()
|
|
|
|
_onChange: =>
|
|
@setState(@getStateFromStores())
|
|
|
|
|
|
module.exports = FileFrame
|