Skip to content

Commit 41a8ca1

Browse files
authored
Merge pull request #3670 from Vizzuality/feature/cross-origin-widgets
Feature/widgets simplified for other platforms
2 parents 3cd787b + 339be21 commit 41a8ca1

File tree

3 files changed

+23
-15
lines changed

3 files changed

+23
-15
lines changed

app/javascript/app/layouts/root/component.jsx

+14-12
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const PageComponent = universal(
2929

3030
class App extends PureComponent {
3131
render() {
32-
const { route, loggedIn, metadata } = this.props;
32+
const { route, loggedIn, metadata, isGFW } = this.props;
3333
const { component, embed } = route;
3434
const isMapPage = component === 'map';
3535
return (
@@ -68,17 +68,18 @@ class App extends PureComponent {
6868
/>
6969
</div>
7070
{!embed && <MyGFWProvider />}
71-
{embed && (
72-
<div className="embed-footer">
73-
<p>For more info</p>
74-
<Button
75-
className="embed-btn"
76-
extLink={window.location.href.replace('/embed', '')}
77-
>
78-
EXPLORE ON GFW
79-
</Button>
80-
</div>
81-
)}
71+
{embed &&
72+
!isGFW && (
73+
<div className="embed-footer">
74+
<p>For more info</p>
75+
<Button
76+
className="embed-btn"
77+
extLink={window.location.href.replace('/embed', '')}
78+
>
79+
EXPLORE ON GFW
80+
</Button>
81+
</div>
82+
)}
8283
<Meta {...metadata} />
8384
</div>
8485
)}
@@ -90,6 +91,7 @@ class App extends PureComponent {
9091
App.propTypes = {
9192
route: PropTypes.object.isRequired,
9293
loggedIn: PropTypes.bool,
94+
isGFW: PropTypes.bool,
9395
metadata: PropTypes.object
9496
};
9597

app/javascript/app/layouts/root/selectors.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,18 @@ import { buildFullLocationName } from 'utils/format';
66

77
const selectLoggedIn = state => !isEmpty(state.myGfw.data) || null;
88
const selectLocation = state => state.location && state.location.payload;
9+
const selectQuery = state => state.location && state.location.query;
910
const selectedCountries = state => state.countryData.countries;
1011
const selectedRegions = state => state.countryData.regions;
1112
const selectedSubRegion = state => state.countryData.subRegions;
1213
const selectPageLocation = state =>
1314
state.location && state.location.routesMap[state.location.type];
1415

15-
// get lists selected
16+
export const getIsGFW = createSelector(
17+
selectQuery,
18+
query => query && query.gfw
19+
);
20+
1621
export const getMetadata = createSelector(
1722
[
1823
selectPageLocation,
@@ -53,5 +58,6 @@ export const getMetadata = createSelector(
5358
export const getPageProps = createStructuredSelector({
5459
loggedIn: selectLoggedIn,
5560
route: selectPageLocation,
56-
metadata: getMetadata
61+
metadata: getMetadata,
62+
isGFW: getIsGFW
5763
});

app/javascript/styles/base.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ body {
88
line-height: 1.5;
99
font-size: rem(18px);
1010
color: $slate;
11-
background: $white;
11+
background: transparent;
1212
-webkit-font-smoothing: antialiased;
1313
-moz-osx-font-smoothing: grayscale;
1414
}

0 commit comments

Comments
 (0)