diff --git a/.babelrc b/.babelrc
new file mode 100644
index 0000000..84c2e57
--- /dev/null
+++ b/.babelrc
@@ -0,0 +1,16 @@
+{
+ "env": {
+ "test": {
+ "presets": [
+ [
+ "@babel/preset-env",
+ {
+ "targets": {
+ "node": "current"
+ }
+ }
+ ]
+ ]
+ }
+ }
+}
diff --git a/.browserslistrc b/.browserslistrc
deleted file mode 100644
index 214388f..0000000
--- a/.browserslistrc
+++ /dev/null
@@ -1,3 +0,0 @@
-> 1%
-last 2 versions
-not dead
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..5d12634
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,13 @@
+# editorconfig.org
+root = true
+
+[*]
+indent_style = space
+indent_size = 2
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[*.md]
+trim_trailing_whitespace = false
diff --git a/.eslintrc.js b/.eslintrc.js
index b85d772..8cc5d3a 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -1,22 +1,18 @@
module.exports = {
root: true,
env: {
+ browser: true,
node: true
},
- extends: [
- "plugin:vue/vue3-essential",
- "eslint:recommended",
- "@vue/typescript/recommended",
- "@vue/prettier",
- "@vue/prettier/@typescript-eslint"
- ],
parserOptions: {
- ecmaVersion: 2020
+ parser: 'babel-eslint'
},
- rules: {
- "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
- "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
- "@typescript-eslint/no-explicit-any": "off",
- "@vue/no-deprecated-filter": "off",
- }
-};
+ extends: [
+ '@nuxtjs',
+ 'plugin:nuxt/recommended'
+ ],
+ plugins: [
+ ],
+ // add your custom rules here
+ rules: {}
+}
diff --git a/.gitignore b/.gitignore
index 403adbc..e8f682b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,23 +1,90 @@
-.DS_Store
-node_modules
-/dist
-
-
-# local env files
-.env.local
-.env.*.local
-
-# Log files
+# Created by .ignore support plugin (hsz.mobi)
+### Node template
+# Logs
+/logs
+*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
-pnpm-debug.log*
-# Editor directories and files
+# Runtime data
+pids
+*.pid
+*.seed
+*.pid.lock
+
+# Directory for instrumented libs generated by jscoverage/JSCover
+lib-cov
+
+# Coverage directory used by tools like istanbul
+coverage
+
+# nyc test coverage
+.nyc_output
+
+# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
+.grunt
+
+# Bower dependency directory (https://bower.io/)
+bower_components
+
+# node-waf configuration
+.lock-wscript
+
+# Compiled binary addons (https://nodejs.org/api/addons.html)
+build/Release
+
+# Dependency directories
+node_modules/
+jspm_packages/
+
+# TypeScript v1 declaration files
+typings/
+
+# Optional npm cache directory
+.npm
+
+# Optional eslint cache
+.eslintcache
+
+# Optional REPL history
+.node_repl_history
+
+# Output of 'npm pack'
+*.tgz
+
+# Yarn Integrity file
+.yarn-integrity
+
+# dotenv environment variables file
+.env
+
+# parcel-bundler cache (https://parceljs.org/)
+.cache
+
+# next.js build output
+.next
+
+# nuxt.js build output
+.nuxt
+
+# Nuxt generate
+dist
+
+# vuepress build output
+.vuepress/dist
+
+# Serverless directories
+.serverless
+
+# IDE / Editor
.idea
-.vscode
-*.suo
-*.ntvs*
-*.njsproj
-*.sln
-*.sw?
+
+# Service worker
+sw.*
+
+# macOS
+.DS_Store
+
+# Vim swap files
+*.swp
diff --git a/README.md b/README.md
index a902836..fcb7273 100644
--- a/README.md
+++ b/README.md
@@ -1,16 +1,27 @@
-# Full Skies
-This small-scale application is used to consume the API. Its functionnalities for now are only about exploiting the API endpoints to display data.
+# full-skies
+Ce projet a pour but d'exploiter [l'API Le Système Solaire](https://api.le-systeme-solaire.net/) et de proposer une interface simple pour selectionner des favoris.
-In the future, users could be able to register and create their own list of astral bodies.
+- [Dependencies](#dependencies)
+- [How to install](#how-to-install)
## Dependencies
-- [Vue](https://vuejs.org/) - Front-end framework
-- [Vuex](https://vuex.vuejs.org/) - Store
-
+* Vue.js
+* Nuxt
+* Axios
+* Jest
-## Usage
-**TBI**
-## Contributors
-- [AlexisNP](https://github.com/AlexisNP)
+## How to install
+To install and run the project, you need to clone this project and run these commands in the root folder.
-## Credits
-**TBI**
\ No newline at end of file
+```bash
+# Install the npm packages
+$ npm install
+
+# FOR DEVELOPPERS
+# Runs an instance of the app on localhost:3000 that hot reloads
+$ npm run dev
+
+# FOR PRODUCTION
+# Compiles and builds for production and starts app
+$ npm run build
+$ npm run start
+```
diff --git a/api/le-systeme-solaire/index.js b/api/le-systeme-solaire/index.js
new file mode 100644
index 0000000..aa3dc89
--- /dev/null
+++ b/api/le-systeme-solaire/index.js
@@ -0,0 +1,40 @@
+import axios from 'axios'
+import { addCelestialType, addCelestialsType } from '@/plugins/methods'
+
+/**
+ * Fetches the API for all celestial bodies and adds its type
+ * @returns Array of celestials in the API
+ */
+export const fetchCelestials = () => {
+ return axios
+ .get('https://api.le-systeme-solaire.net/rest/bodies/')
+ .then((res) => {
+ return addCelestialsType(res.data.bodies)
+ })
+}
+
+/**
+ * Fetches the API for all celestial bodies and adds its type
+ * @returns Array of celestials in the API
+ */
+export const fetchCelestial = (slug) => {
+ return axios
+ .get(`https://api.le-systeme-solaire.net/rest/bodies/${slug}`)
+ .then((res) => {
+ const celestial = addCelestialType(res.data)
+ const moons = []
+ if (celestial.moons) {
+ celestial.moons.forEach(async (moon) => {
+ const moonRes = await axios.get(moon.rel)
+ moons.push(addCelestialType(moonRes.data))
+ })
+ celestial.moons = moons
+ }
+ return celestial
+ })
+}
+
+export default {
+ fetchCelestials,
+ fetchCelestial
+}
diff --git a/assets/README.md b/assets/README.md
new file mode 100644
index 0000000..34766f9
--- /dev/null
+++ b/assets/README.md
@@ -0,0 +1,7 @@
+# ASSETS
+
+**This directory is not required, you can delete it if you don't want to use it.**
+
+This directory contains your un-compiled assets such as LESS, SASS, or JavaScript.
+
+More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#webpacked).
diff --git a/src/assets/scss/_animations.scss b/assets/scss/_animations.scss
similarity index 100%
rename from src/assets/scss/_animations.scss
rename to assets/scss/_animations.scss
diff --git a/assets/scss/_fonts.scss b/assets/scss/_fonts.scss
new file mode 100644
index 0000000..4ab3c03
--- /dev/null
+++ b/assets/scss/_fonts.scss
@@ -0,0 +1,2 @@
+@import url(https://fonts.googleapis.com/icon?family=Material+Icons|Material+Icons+Round);
+@import url(https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,700;1,400;1,700&family=Poppins:wght@400;600;700;800;900&display=swap);
\ No newline at end of file
diff --git a/src/assets/scss/_global.scss b/assets/scss/_global.scss
similarity index 99%
rename from src/assets/scss/_global.scss
rename to assets/scss/_global.scss
index 8da6a8e..77015e3 100644
--- a/src/assets/scss/_global.scss
+++ b/assets/scss/_global.scss
@@ -1,7 +1,6 @@
@import 'libs/normalize';
@import 'fonts';
-@import 'variables';
@import 'animations';
* {
diff --git a/src/assets/scss/_variables.scss b/assets/scss/_variables.scss
similarity index 89%
rename from src/assets/scss/_variables.scss
rename to assets/scss/_variables.scss
index bec6060..3a46133 100644
--- a/src/assets/scss/_variables.scss
+++ b/assets/scss/_variables.scss
@@ -20,6 +20,9 @@ $danger: $red;
$primary: $space-blue-700;
$primary-light: $space-blue-600;
+$primary-xlight: $space-blue-500;
+$primary-xxlight: $space-blue-300;
+
$heading-font-family: 'Poppins', serif;
$body-font-family: 'Open Sans', sans-serif;
diff --git a/src/assets/scss/libs/_normalize.scss b/assets/scss/libs/_normalize.scss
similarity index 100%
rename from src/assets/scss/libs/_normalize.scss
rename to assets/scss/libs/_normalize.scss
diff --git a/babel.config.js b/babel.config.js
deleted file mode 100644
index 397abca..0000000
--- a/babel.config.js
+++ /dev/null
@@ -1,3 +0,0 @@
-module.exports = {
- presets: ["@vue/cli-plugin-babel/preset"]
-};
diff --git a/src/components/Navbar.vue b/components/Navbar.vue
similarity index 78%
rename from src/components/Navbar.vue
rename to components/Navbar.vue
index 6ea9b50..6e736c5 100644
--- a/src/components/Navbar.vue
+++ b/components/Navbar.vue
@@ -2,34 +2,38 @@
-
diff --git a/components/celestials/CelestialCardIcon.vue b/components/celestials/CelestialCardIcon.vue
new file mode 100644
index 0000000..1f98f90
--- /dev/null
+++ b/components/celestials/CelestialCardIcon.vue
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
diff --git a/src/components/celestials/CelestialFilters.vue b/components/celestials/CelestialFilters.vue
similarity index 77%
rename from src/components/celestials/CelestialFilters.vue
rename to components/celestials/CelestialFilters.vue
index 11b29d6..5168d94 100644
--- a/src/components/celestials/CelestialFilters.vue
+++ b/components/celestials/CelestialFilters.vue
@@ -19,7 +19,7 @@
src="icons/saturn-planet-shape-white.svg"
alt=""
class="fs-icon icon-sm"
- />
+ >
+ >
+ >
-
diff --git a/src/components/toast/ToastCard.vue b/components/toast/ToastCard.vue
similarity index 72%
rename from src/components/toast/ToastCard.vue
rename to components/toast/ToastCard.vue
index a9b3d68..528b67b 100644
--- a/src/components/toast/ToastCard.vue
+++ b/components/toast/ToastCard.vue
@@ -10,46 +10,47 @@
diff --git a/pages/astres/index.vue b/pages/astres/index.vue
new file mode 100644
index 0000000..fc66741
--- /dev/null
+++ b/pages/astres/index.vue
@@ -0,0 +1,54 @@
+
+
+
+
+ Le système solaire
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/favoris/index.vue b/pages/favoris/index.vue
new file mode 100644
index 0000000..47d0037
--- /dev/null
+++ b/pages/favoris/index.vue
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
diff --git a/src/views/Home.vue b/pages/index.vue
similarity index 80%
rename from src/views/Home.vue
rename to pages/index.vue
index 42970ba..bf750ad 100644
--- a/src/views/Home.vue
+++ b/pages/index.vue
@@ -1,7 +1,9 @@
-
Full Skies
+
+ Full Skies
+
Explorez les cieux et le système solaire avec Full Skies !
@@ -13,12 +15,10 @@
-
diff --git a/src/components/celestials/CelestialsList.vue b/src/components/celestials/CelestialsList.vue
deleted file mode 100644
index 224ef4c..0000000
--- a/src/components/celestials/CelestialsList.vue
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/main.ts b/src/main.ts
deleted file mode 100644
index 04ba1a5..0000000
--- a/src/main.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import { createApp } from "vue";
-import App from "./App.vue";
-import router from "./router";
-import store from "./store";
-
-import "@/assets/scss/libs/_normalize.scss";
-import "@/assets/scss/_global.scss";
-
-createApp(App)
- .use(store)
- .use(router)
- .mount("#app");
diff --git a/src/plugins/methods/index.ts b/src/plugins/methods/index.ts
deleted file mode 100644
index acdde32..0000000
--- a/src/plugins/methods/index.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-export const addCelestialType = (celestial: any) => {
- if (celestial.isPlanet) {
- if (celestial.moons) {
- celestial.type = "planète à lunes";
- } else {
- celestial.type = "planète";
- }
-
- // Check if element is moon
- } else if (celestial.aroundPlanet != null) {
- celestial.type = "lune";
-
- // Check if element is star
- } else if (celestial.id === "soleil") {
- celestial.type = "étoile";
-
- // ...else, body is "other"
- } else {
- celestial.type = "autre";
- }
- return celestial;
-};
-
-export const addCelestialsType = (celestials: any) => {
- return celestials.map((e: any) => addCelestialType(e));
-};
-
-export default {
- addCelestialType,
- addCelestialsType
-};
diff --git a/src/router/index.ts b/src/router/index.ts
deleted file mode 100644
index d6f1be3..0000000
--- a/src/router/index.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
-
-import Home from "../views/Home.vue";
-import About from "../views/About.vue";
-import Profile from "../views/Profile.vue";
-
-import Celestials from "../views/celestials/Celestials.vue";
-import Celestial from "../views/celestials/Celestial.vue";
-
-const routes: Array
= [
- {
- path: "/",
- name: "Home",
- component: Home
- },
- {
- path: "/a-propos",
- name: "About",
- component: About
- },
- {
- path: "/astres",
- name: "CelesteAll",
- component: Celestials
- },
- {
- path: "/astres/:slug",
- name: "CelesteSingle",
- component: Celestial,
- props: true
- },
- {
- path: "/profil",
- name: "Profile",
- component: Profile
- }
-];
-
-const router = createRouter({
- history: createWebHistory(),
- routes
-});
-
-export default router;
diff --git a/src/shims-vue.d.ts b/src/shims-vue.d.ts
deleted file mode 100644
index 60e7c14..0000000
--- a/src/shims-vue.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-/* eslint-disable */
-declare module '*.vue' {
- import type { DefineComponent } from 'vue'
- const component: DefineComponent<{}, {}, any>
- export default component
-}
-declare module 'uuid';
diff --git a/src/store/index.ts b/src/store/index.ts
deleted file mode 100644
index 76ae223..0000000
--- a/src/store/index.ts
+++ /dev/null
@@ -1,52 +0,0 @@
-import { createStore } from "vuex";
-
-import toastStore from "./toasts";
-
-export default createStore({
- state: () => ({
- user: {
- avatarUrl: "",
- favourites: Array<{ id: string }>()
- }
- }),
- getters: {
- // Returns the number of favs for the user
- favCount: (state): number => {
- return state.user.favourites.length;
- },
- // Returns true if celestial is fav
- isFav: state => (celestialId: string) => {
- return state.user.favourites.find(fav => fav.id === celestialId);
- }
- },
- mutations: {
- addFav: (state, celestialId: string) => {
- state.user.favourites.push({ id: celestialId });
- },
- removeFav: (state, celestialId: string) => {
- state.user.favourites = state.user.favourites.filter(
- fav => fav.id != celestialId
- );
- }
- },
- actions: {
- toggleFav: ({ commit, getters }, celestialId: string) => {
- // If the celestial is not faved
- if (!getters.isFav(celestialId)) {
- // ... favs it
- commit("addFav", celestialId);
- } else {
- // ...else unfavs
- commit("removeFav", celestialId);
- }
- }
- },
- modules: {
- toasts: {
- namespaced: true,
- state: toastStore.state,
- mutations: toastStore.mutations,
- actions: toastStore.actions
- }
- }
-});
diff --git a/src/store/toasts/index.ts b/src/store/toasts/index.ts
deleted file mode 100644
index e3e229b..0000000
--- a/src/store/toasts/index.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-export default {
- state: {
- queue: Array<{
- id: string;
- title: string;
- message: string;
- category: string;
- timer: number;
- }>()
- },
- mutations: {
- pushToast: (state: any, toast: any) => {
- state.queue.push(toast);
- },
- purgeToast: (state: any, toastId: string) => {
- state.queue = state.queue.filter((toast: any) => toast.id != toastId);
- }
- },
- actions: {
- pushToast: ({ commit }: any, toast: any) => {
- commit("pushToast", toast);
- },
- purgeToast: ({ commit }: any, toastId: string) => {
- commit("purgeToast", toastId);
- }
- }
-};
diff --git a/src/views/About.vue b/src/views/About.vue
deleted file mode 100644
index 2af234b..0000000
--- a/src/views/About.vue
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
diff --git a/src/views/Profile.vue b/src/views/Profile.vue
deleted file mode 100644
index 1d91b78..0000000
--- a/src/views/Profile.vue
+++ /dev/null
@@ -1,163 +0,0 @@
-
-
-
-
-
-
![]()
-
-
-
- {{ user.name }} possède {{ user.repos.length }} repos.
-
-
-
-
-
Âge : {{ user.age }} (Extrêmement vieux)
-
-
-
Âge : {{ user.age }} (Enfant)
-
-
-
Âge : {{ user.age }} (Doué pour utiliser un clavier)
-
-
-
-
-
-
-
-
-
-
-
Friends of {{ user.name }}
-
-
-
- | Nom |
- UUID |
- Supprimer l'ami |
-
-
-
-
-
- | {{ friend.name }} |
- {{ friend.uuid }} |
-
-
- |
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/celestials/Celestial.vue b/src/views/celestials/Celestial.vue
deleted file mode 100644
index 02c8dda..0000000
--- a/src/views/celestials/Celestial.vue
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
Une erreur est survenue : {{ error }}
-
{{ celestial }}
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/celestials/Celestials.vue b/src/views/celestials/Celestials.vue
deleted file mode 100644
index 57685a1..0000000
--- a/src/views/celestials/Celestials.vue
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
Une erreur est survenue : {{ error }}
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/static/README.md b/static/README.md
new file mode 100644
index 0000000..cf00435
--- /dev/null
+++ b/static/README.md
@@ -0,0 +1,11 @@
+# STATIC
+
+**This directory is not required, you can delete it if you don't want to use it.**
+
+This directory contains your static files.
+Each file inside this directory is mapped to `/`.
+Thus you'd want to delete this README.md before deploying to production.
+
+Example: `/static/robots.txt` is mapped as `/robots.txt`.
+
+More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#static).
diff --git a/public/celestials_bg-min.jpg b/static/celestials_bg-min.jpg
similarity index 100%
rename from public/celestials_bg-min.jpg
rename to static/celestials_bg-min.jpg
diff --git a/public/celestials_bg.jpg b/static/celestials_bg.jpg
similarity index 100%
rename from public/celestials_bg.jpg
rename to static/celestials_bg.jpg
diff --git a/public/favicon.ico b/static/favicon.ico
similarity index 100%
rename from public/favicon.ico
rename to static/favicon.ico
diff --git a/public/home_bg-min.jpg b/static/home_bg-min.jpg
similarity index 100%
rename from public/home_bg-min.jpg
rename to static/home_bg-min.jpg
diff --git a/public/home_bg.jpg b/static/home_bg.jpg
similarity index 100%
rename from public/home_bg.jpg
rename to static/home_bg.jpg
diff --git a/public/icons/galaxy-spiral-shape-white.svg b/static/icons/galaxy-spiral-shape-white.svg
similarity index 100%
rename from public/icons/galaxy-spiral-shape-white.svg
rename to static/icons/galaxy-spiral-shape-white.svg
diff --git a/public/icons/galaxy-spiral-shape.svg b/static/icons/galaxy-spiral-shape.svg
similarity index 100%
rename from public/icons/galaxy-spiral-shape.svg
rename to static/icons/galaxy-spiral-shape.svg
diff --git a/public/icons/moon-and-stars-in-a-cloud-white.svg b/static/icons/moon-and-stars-in-a-cloud-white.svg
similarity index 100%
rename from public/icons/moon-and-stars-in-a-cloud-white.svg
rename to static/icons/moon-and-stars-in-a-cloud-white.svg
diff --git a/public/icons/moon-and-stars-in-a-cloud.svg b/static/icons/moon-and-stars-in-a-cloud.svg
similarity index 100%
rename from public/icons/moon-and-stars-in-a-cloud.svg
rename to static/icons/moon-and-stars-in-a-cloud.svg
diff --git a/public/icons/saturn-and-other-planets-white.svg b/static/icons/saturn-and-other-planets-white.svg
similarity index 100%
rename from public/icons/saturn-and-other-planets-white.svg
rename to static/icons/saturn-and-other-planets-white.svg
diff --git a/public/icons/saturn-and-other-planets.svg b/static/icons/saturn-and-other-planets.svg
similarity index 100%
rename from public/icons/saturn-and-other-planets.svg
rename to static/icons/saturn-and-other-planets.svg
diff --git a/public/icons/saturn-planet-shape-white.svg b/static/icons/saturn-planet-shape-white.svg
similarity index 100%
rename from public/icons/saturn-planet-shape-white.svg
rename to static/icons/saturn-planet-shape-white.svg
diff --git a/public/icons/saturn-planet-shape.svg b/static/icons/saturn-planet-shape.svg
similarity index 100%
rename from public/icons/saturn-planet-shape.svg
rename to static/icons/saturn-planet-shape.svg
diff --git a/public/icons/stars-group-white.svg b/static/icons/stars-group-white.svg
similarity index 100%
rename from public/icons/stars-group-white.svg
rename to static/icons/stars-group-white.svg
diff --git a/public/icons/stars-group.svg b/static/icons/stars-group.svg
similarity index 100%
rename from public/icons/stars-group.svg
rename to static/icons/stars-group.svg
diff --git a/public/icons/sun-shape-white.svg b/static/icons/sun-shape-white.svg
similarity index 100%
rename from public/icons/sun-shape-white.svg
rename to static/icons/sun-shape-white.svg
diff --git a/public/icons/sun-shape.svg b/static/icons/sun-shape.svg
similarity index 100%
rename from public/icons/sun-shape.svg
rename to static/icons/sun-shape.svg
diff --git a/public/nav-bg.png b/static/nav-bg.png
similarity index 100%
rename from public/nav-bg.png
rename to static/nav-bg.png
diff --git a/store/index.js b/store/index.js
new file mode 100644
index 0000000..7c67051
--- /dev/null
+++ b/store/index.js
@@ -0,0 +1,46 @@
+export const state = () => ({
+ user: {
+ avatarUrl: '',
+ favourites: []
+ }
+})
+
+export const getters = {
+ // Returns the number of favs for the user
+ favCount: (state) => {
+ return state.user.favourites.length
+ },
+ // Returns true if celestial is fav
+ isFav: state => (celestialId) => {
+ return state.user.favourites.find(fav => fav.id === celestialId)
+ }
+}
+
+export const mutations = {
+ addFav: (state, celestialId) => {
+ state.user.favourites.push({ id: celestialId })
+ },
+ removeFav: (state, celestialId) => {
+ state.user.favourites = state.user.favourites.filter(
+ fav => fav.id !== celestialId
+ )
+ }
+}
+
+export const actions = {
+ toggleFav: ({ commit, getters }, celestialId) => {
+ // If the celestial is not faved
+ if (!getters.isFav(celestialId)) {
+ commit('addFav', celestialId)
+ } else {
+ commit('removeFav', celestialId)
+ }
+ }
+}
+
+export default {
+ state,
+ getters,
+ mutations,
+ actions
+}
diff --git a/store/toasts.js b/store/toasts.js
new file mode 100644
index 0000000..d6d9791
--- /dev/null
+++ b/store/toasts.js
@@ -0,0 +1,27 @@
+export const state = () => ({
+ queue: []
+})
+
+export const mutations = {
+ pushToast: (state, toast) => {
+ state.queue.push(toast)
+ },
+ purgeToast: (state, toastId) => {
+ state.queue = state.queue.filter(toast => toast.id !== toastId)
+ }
+}
+
+export const actions = {
+ pushToast: ({ commit }, toast) => {
+ commit('pushToast', toast)
+ },
+ purgeToast: ({ commit }, toastId) => {
+ commit('purgeToast', toastId)
+ }
+}
+
+export default {
+ state,
+ mutations,
+ actions
+}
diff --git a/test/Logo.spec.js b/test/Logo.spec.js
new file mode 100644
index 0000000..c5fbeeb
--- /dev/null
+++ b/test/Logo.spec.js
@@ -0,0 +1,9 @@
+import { mount } from '@vue/test-utils'
+import Logo from '@/components/Logo.vue'
+
+describe('Logo', () => {
+ test('is a Vue instance', () => {
+ const wrapper = mount(Logo)
+ expect(wrapper.vm).toBeTruthy()
+ })
+})
diff --git a/tsconfig.json b/tsconfig.json
deleted file mode 100644
index e621cbc..0000000
--- a/tsconfig.json
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "compilerOptions": {
- "target": "esnext",
- "module": "esnext",
- "strict": true,
- "jsx": "preserve",
- "importHelpers": true,
- "moduleResolution": "node",
- "skipLibCheck": true,
- "esModuleInterop": true,
- "allowSyntheticDefaultImports": true,
- "sourceMap": true,
- "baseUrl": ".",
- "types": [
- "webpack-env"
- ],
- "paths": {
- "@/*": [
- "src/*"
- ]
- },
- "lib": [
- "esnext",
- "dom",
- "dom.iterable",
- "scripthost"
- ]
- },
- "include": [
- "src/**/*.ts",
- "src/**/*.tsx",
- "src/**/*.vue",
- "tests/**/*.ts",
- "tests/**/*.tsx"
- ],
- "exclude": [
- "node_modules"
- ]
-}
diff --git a/vue.config.js b/vue.config.js
deleted file mode 100644
index 0c20511..0000000
--- a/vue.config.js
+++ /dev/null
@@ -1,9 +0,0 @@
-module.exports = {
- css: {
- loaderOptions: {
- scss: {
- additionalData: `@import "src/assets/scss/_variables.scss";`
- }
- }
- }
-};