Convert image URLs in React to require calls
This allows Webpack to insert the proper image URL after builds steps like adding a hash and so on. The path you supply to `require` is relative to the JS source file, just like any other would be.
This commit is contained in:
@@ -152,7 +152,7 @@ export default class Stickerpicker extends React.Component {
|
||||
className='mx_Stickers_contentPlaceholder'>
|
||||
<p>{ _t("You don't currently have any stickerpacks enabled") }</p>
|
||||
<p className='mx_Stickers_addLink'>{ _t("Add some now") }</p>
|
||||
<img src='img/stickerpack-placeholder.png' alt="" />
|
||||
<img src={require("../../../../res/img/stickerpack-placeholder.png")} alt="" />
|
||||
</AccessibleButton>
|
||||
);
|
||||
}
|
||||
@@ -351,7 +351,7 @@ export default class Stickerpicker extends React.Component {
|
||||
onClick={this._onHideStickersClick}
|
||||
ref='target'
|
||||
title={_t("Hide Stickers")}>
|
||||
<TintableSvg src="img/feather-icons/face.svg" width="20" height="20" />
|
||||
<TintableSvg src={require("../../../../res/img/feather-icons/face.svg")} width="20" height="20" />
|
||||
</AccessibleButton>;
|
||||
} else {
|
||||
// Show show-stickers button
|
||||
@@ -362,7 +362,7 @@ export default class Stickerpicker extends React.Component {
|
||||
className="mx_MessageComposer_stickers"
|
||||
onClick={this._onShowStickersClick}
|
||||
title={_t("Show Stickers")}>
|
||||
<TintableSvg src="img/feather-icons/face.svg" width="20" height="20" />
|
||||
<TintableSvg src={require("../../../../res/img/feather-icons/face.svg")} width="20" height="20" />
|
||||
</AccessibleButton>;
|
||||
}
|
||||
return <div>
|
||||
|
||||
Reference in New Issue
Block a user