Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

Commit

Permalink
fix(images): fixes image url in dashboard view
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduardo Campaña committed Dec 24, 2018
1 parent 6ed9e60 commit c0547f1
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 11 deletions.
7 changes: 5 additions & 2 deletions admin/components/Home/WithoutSiteId.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const WithoutSiteId = ({
notifications,
requestAlreadyLinkText,
requestButtonText,
siteUrl,
}) => {
if (siteIdRequested)
return siteIdJustRequested ? <SiteIdJustRequested /> : <SiteIdRequested />;
Expand All @@ -31,7 +32,7 @@ const WithoutSiteId = ({
<>
<Container>
<InnerContainer>
<Image alt="Frontity Theme" src={frontityThemeImage} />
<Image alt="Frontity Theme" src={`${siteUrl}${frontityThemeImage}`} />
<Footer>
<Paragraph margin={{ vertical: "0" }}>
{descriptionImageFooterText}
Expand Down Expand Up @@ -100,9 +101,10 @@ WithoutSiteId.propTypes = {
.isRequired,
requestAlreadyLinkText: string.isRequired,
requestButtonText: string.isRequired,
siteUrl: string.isRequired,
};

export default inject(({ stores: { settings, ui, languages } }) => {
export default inject(({ stores: { general, settings, ui, languages } }) => {
const description = "home.withoutSiteId.description";
const requestForm = "home.withoutSiteId.requestForm";

Expand All @@ -129,6 +131,7 @@ export default inject(({ stores: { settings, ui, languages } }) => {
notifications: languages.get("home.withoutSiteId.notifications"),
requestAlreadyLinkText: languages.get(`${requestForm}.alreadyLink`),
requestButtonText: languages.get(`${requestForm}.requestButton`),
siteUrl: general.site,
};
})(WithoutSiteId);

Expand Down
13 changes: 8 additions & 5 deletions admin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,18 @@ import "@babel/polyfill";

const stores = Stores.create({
general: {
site: window.frontity.plugin.site_url,
page: new URLSearchParams(window.location.search).get("page"),
},
settings: window.frontity.plugin.settings,
ui: {
siteIdStatus: !isEmpty(window.frontity.plugin.settings.site_id, {
ignore_whitespace: true,
})
? "valid"
: undefined,
siteIdStatus:
window.frontity.plugin.settings.site_id &&
!isEmpty(window.frontity.plugin.settings.site_id, {
ignore_whitespace: true,
})
? "valid"
: undefined,
},
});

Expand Down
4 changes: 3 additions & 1 deletion admin/index.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?php
$settings = get_option('frontity_settings');
$settings = get_option('frontity_settings');
$site_url = get_site_url();
?>

<div id='root'></div>
<script>
window.frontity = {
plugin: {
site_url: <?php echo json_encode($site_url); ?> || "",
settings: <?php echo $settings ? json_encode($settings) : json_encode(new stdClass()); ?>
}
};
Expand Down
3 changes: 2 additions & 1 deletion admin/models/general.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { types } from "mobx-state-tree";

export default types.model("General", {
page: ""
site: "",
page: "",
});
4 changes: 2 additions & 2 deletions wp-pwa.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ function plugin_update_completed($upgrader_object, $data) {

// Check if our plugin is being updated.
if (
$data['action'] == 'update' &&
$data['type'] == 'plugin' &&
$data['action'] === 'update' &&
$data['type'] === 'plugin' &&
isset($data['plugins'])
) {
foreach ($data['plugins'] as $plugin) {
Expand Down

0 comments on commit c0547f1

Please sign in to comment.