diff --git a/rollup.config.js b/rollup.config.js index 6978afc..e666780 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -127,22 +127,22 @@ export default { /* ** Service worker */ - ...(!dev && { - serviceworker: { - input: sapperConfig.serviceworker.input(), - output: sapperConfig.serviceworker.output(), - plugins: [ - resolve(), - replace({ - 'process.browser': false, - ...replaceOptions - }), - aliases, - glslify(), - commonjs(), - !dev && terser() - ], - onwarn, - } - }) + // ...(!dev && { + // serviceworker: { + // input: sapperConfig.serviceworker.input(), + // output: sapperConfig.serviceworker.output(), + // plugins: [ + // resolve(), + // replace({ + // 'process.browser': false, + // ...replaceOptions + // }), + // aliases, + // glslify(), + // commonjs(), + // !dev && terser() + // ], + // onwarn, + // } + // }) } diff --git a/src/atoms/Badge.svelte b/src/atoms/Badge.svelte new file mode 100644 index 0000000..8855fb5 --- /dev/null +++ b/src/atoms/Badge.svelte @@ -0,0 +1,9 @@ + + +
+ {text} +
\ No newline at end of file diff --git a/src/molecules/Location.svelte b/src/molecules/Location.svelte index 68a779f..0c54205 100644 --- a/src/molecules/Location.svelte +++ b/src/molecules/Location.svelte @@ -1,19 +1,30 @@
Flag of {country.name} +

{name}

+

{country.name}

+ + {#if dateOlderThan(last_updated, timeLimit)} + + {/if}
diff --git a/src/molecules/Newsletter.svelte b/src/molecules/Newsletter.svelte deleted file mode 100644 index 1bff26b..0000000 --- a/src/molecules/Newsletter.svelte +++ /dev/null @@ -1,46 +0,0 @@ - - -
-
-

{$site.newsletter_text}

-
- -
- {#if title} -

- -

- {/if} - - - - - - - - -
-
\ No newline at end of file diff --git a/src/molecules/NewsletterForm.svelte b/src/molecules/NewsletterForm.svelte new file mode 100644 index 0000000..ad4a834 --- /dev/null +++ b/src/molecules/NewsletterForm.svelte @@ -0,0 +1,41 @@ + + +
+ {#if title} +

+ +

+ {/if} + +
+ + +
+ +
+

No spam, we promise!

+
+ + + + +
\ No newline at end of file diff --git a/src/organisms/Locations.svelte b/src/organisms/Locations.svelte index 73658cf..01905d5 100644 --- a/src/organisms/Locations.svelte +++ b/src/organisms/Locations.svelte @@ -7,6 +7,7 @@ // Components import Button from 'atoms/Button' import Location from 'molecules/Location' + import Newsletter from 'organisms/Newsletter' // Animations import { animateIn } from 'animations/Locations' @@ -58,12 +59,11 @@
{#each filteredLocations as location (location.id)} -
+
{/each}
+ + \ No newline at end of file diff --git a/src/organisms/Newsletter.svelte b/src/organisms/Newsletter.svelte new file mode 100644 index 0000000..bf25df1 --- /dev/null +++ b/src/organisms/Newsletter.svelte @@ -0,0 +1,22 @@ + + +
+
+ + + +
+
\ No newline at end of file diff --git a/src/organisms/Pagination.svelte b/src/organisms/Pagination.svelte index 5b10434..7667bcf 100644 --- a/src/organisms/Pagination.svelte +++ b/src/organisms/Pagination.svelte @@ -2,7 +2,7 @@ import { onMount, createEventDispatcher } from 'svelte' import { site, currentLocation } from 'utils/store' // Components - import Newsletter from 'molecules/Newsletter' + import Newsletter from 'organisms/Newsletter' // Props export let photos export let paginatedPhotos @@ -58,12 +58,9 @@ {:else if $currentLocation}
-

That's all folks!

-
{/if} diff --git a/src/routes/_layout.svelte b/src/routes/_layout.svelte index a25c5c2..0cd3322 100644 --- a/src/routes/_layout.svelte +++ b/src/routes/_layout.svelte @@ -1,6 +1,6 @@ @@ -112,30 +154,6 @@ '/fonts/M-Light.woff2', ] } - - - /* - ** Manipulate data - */ - if (process.browser) { - if ($countries) { - $countries.forEach(country => { - const matchingContinent = $continents.find(continent => continent.id === country.continent.id) - // Replace continent with request data - country.continent = matchingContinent - // Add countries to each continents - matchingContinent.countries = [] - matchingContinent.countries.push(country) - }) - } - - if ($locations) { - // Replace each location's country with request data - $locations.forEach(location => { - location.country = $countries.find(country => country.id === location.country.id) - }) - } - }