Skip to content
Snippets Groups Projects
Commit b7f4debe authored by heikkkk's avatar heikkkk
Browse files

refactor: remove 'Component' from names

parent 92cf6dcd
No related branches found
No related tags found
1 merge request!76Refactor/folder structure
Showing
with 15 additions and 152 deletions
<script setup lang="ts">
import '@fortawesome/fontawesome-free/css/all.css'
import { RouterLink } from 'vue-router'
import {logDOM} from "@testing-library/vue";
const ifNotLoggedInLogin = () => {
/* if (useUserInfoStore.isActive) {
return '/discover'
}
return '/login'*/
return '/login'
}
const ifLoggedInDiscover = () => {
/*if (store.isActive) {
return '/discover'
}
return '/'*/
return '/'
}
const ifLoggedInReset = () => {
/*if (store.isActive) {
store.resetAll()
}*/
return '/login'
}
</script>
<template>
<div class="footer footer-wrapper fixed-bottom" style="background-color: #3B71CA">
<div class="links-wrapper">
<p class="links-header">Links</p>
<div class="links-container">
<RouterLink class="router" id="home" :to="ifLoggedInDiscover">Home</RouterLink>
<RouterLink class="router" id="discover" :to="ifNotLoggedInLogin()">Discover</RouterLink>
<RouterLink class="router" id="login" to="/login" @click="ifLoggedInReset()">Login</RouterLink>
</div>
</div>
<div class="support-wrapper">
<p class="support-header">Support us</p>
<div class="support-container">
<a href="https://twitter.com" target="_blank">
<i class="fab fa-twitter"></i>
Twitter
</a>
<a href="https://instagram.com" target="_blank">
<i class="fab fa-instagram"></i>
Instagram
</a>
<a href="https://facebook.com" target="_blank">
<i class="fab fa-facebook"></i>
Facebook
</a>
<a href="https://discord.gg" target="_blank">
<i class="fab fa-discord"></i>
Discord
</a>
</div>
</div>
<div class="info-wrapper">
<p class="info-header">Company</p>
<div class="info-container">
<RouterLink class="router" to="/about-us">About us</RouterLink>
<RouterLink class="router" to="/privacy-policy">Privacy</RouterLink>
</div>
</div>
</div>
</template>
<style scoped>
:root {
--footer-margin: 2rem
}
.footer-wrapper {
width: 100%;
display: grid;
grid-template-columns: 1fr 1fr 1fr;
background-size: cover;
justify-content: center;
}
.links-header, .support-header, .info-header {
font-family: Inter,sans-serif;
font-size: 26px;
font-weight: 600;
color: #FFFFFF;
margin: var(--footer-margin);
padding-left: 10px;
}
.links-container, .support-container, .info-container {
display: flex;
flex-direction: column;
margin: var(--footer-margin);
}
.support-container a i {
margin-right: 0.7rem;
}
.router, .support-container a {
width: 100%;
height: 39px;
font-family: 'Inter', serif;
font-weight: 500;
font-size: 18px;
text-decoration: none;
border-radius: 10px;
align-content: center;
color: #FFFFFF;
border: 1px solid #3B71CA;
padding-left: 10px;
}
.router:hover, .support-container a:hover {
background-color: #FFFFFF;
color: #3B71CA;
font-weight: 500;
font-size: 18px;
}
@media (max-width: 588px) {
.footer-wrapper {
display: flex;
flex-direction: column;
}
}
</style>
import { describe, it, expect } from 'vitest' import { describe, it, expect } from 'vitest'
import { mount } from '@vue/test-utils' import { mount } from '@vue/test-utils'
import FooterComponent from '../FooterComponent.vue' import FooterComponent from '../BaseFooter.vue'
describe('FooterComponent', () => { describe('FooterComponent', () => {
it('renders properly and includes the correct copyright notice', () => { it('renders properly and includes the correct copyright notice', () => {
......
...@@ -3,7 +3,7 @@ import { mount } from '@vue/test-utils'; ...@@ -3,7 +3,7 @@ import { mount } from '@vue/test-utils';
import { createRouter, createMemoryHistory } from 'vue-router'; import { createRouter, createMemoryHistory } from 'vue-router';
import { createPinia, setActivePinia } from 'pinia'; import { createPinia, setActivePinia } from 'pinia';
import { useUserInfoStore } from '@/stores/UserStore'; import { useUserInfoStore } from '@/stores/UserStore';
import MyComponent from '../MenuComponent.vue'; // Adjust path as needed import MyComponent from '../NavBar.vue'; // Adjust path as needed
import router from '@/router/index'; // Adjust path as needed import router from '@/router/index'; // Adjust path as needed
import { access } from 'fs'; import { access } from 'fs';
import { render, screen } from '@testing-library/vue'; import { render, screen } from '@testing-library/vue';
......
...@@ -2,7 +2,7 @@ import { describe, it, expect, beforeEach, vi } from 'vitest'; ...@@ -2,7 +2,7 @@ import { describe, it, expect, beforeEach, vi } from 'vitest';
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import { createRouter, createMemoryHistory } from 'vue-router'; import { createRouter, createMemoryHistory } from 'vue-router';
import { createPinia, setActivePinia } from 'pinia'; import { createPinia, setActivePinia } from 'pinia';
import Leaderboard from '../Leaderboard.vue'; import Leaderboard from '../LeaderboardTable.vue';
import { useUserInfoStore } from '../../../stores/UserStore'; import { useUserInfoStore } from '../../../stores/UserStore';
import router from '../../../router'; import router from '../../../router';
......
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import MyComponent from '../NewsComponent.vue'; // Adjust the import path according to your setup import MyComponent from '../NewsFeed.vue'; // Adjust the import path according to your setup
global.fetch = vi.fn(() => global.fetch = vi.fn(() =>
Promise.resolve( Promise.resolve(
......
...@@ -3,7 +3,7 @@ import { mount } from '@vue/test-utils'; ...@@ -3,7 +3,7 @@ import { mount } from '@vue/test-utils';
import { createRouter, createMemoryHistory } from 'vue-router'; import { createRouter, createMemoryHistory } from 'vue-router';
import { createPinia, setActivePinia } from 'pinia'; import { createPinia, setActivePinia } from 'pinia';
import { useUserInfoStore } from '@/stores/UserStore'; import { useUserInfoStore } from '@/stores/UserStore';
import MyComponent from '@/components/UserProfile/UserProfileLayout.vue'; // Adjust path as needed import MyComponent from '../MyProfile.vue'; // Adjust path as needed
import router from '@/router/index'; // Adjust path as needed import router from '@/router/index'; // Adjust path as needed
describe('MyComponent and Router Tests', () => { describe('MyComponent and Router Tests', () => {
......
...@@ -26,7 +26,7 @@ const routes = [ ...@@ -26,7 +26,7 @@ const routes = [
{ {
path: 'profile', path: 'profile',
name: 'profile', name: 'profile',
component: () => import('@/views/User/UserProfileView.vue'), component: () => import('@/views/User/MyProfileView.vue'),
}, },
{ {
path: '/settings', path: '/settings',
...@@ -90,7 +90,7 @@ const routes = [ ...@@ -90,7 +90,7 @@ const routes = [
{ {
path: '/profile/:id', path: '/profile/:id',
name: 'friend-profile', name: 'friend-profile',
component: () => import('@/views/User/UserProfileForeignView.vue'), component: () => import('@/views/User/ExternalProfileView.vue'),
}, },
{ {
path: 'friends', path: 'friends',
...@@ -142,12 +142,12 @@ const routes = [ ...@@ -142,12 +142,12 @@ const routes = [
{ {
path: '/commitment', path: '/commitment',
name: 'commitment', name: 'commitment',
component: () => import('@/components/Configuration/ConfigurationSteps/Commitment.vue'), component: () => import('@/components/Configuration/ConfigurationSteps/ConfigurationCommitment.vue'),
}, },
{ {
path: '/experience', path: '/experience',
name: 'experience', name: 'experience',
component: () => import('@/components/Configuration/ConfigurationSteps/Experience.vue'), component: () => import('@/components/Configuration/ConfigurationSteps/ConfigurationExperience.vue'),
}, },
{ {
path: '/suitable-challenges', path: '/suitable-challenges',
...@@ -157,7 +157,7 @@ const routes = [ ...@@ -157,7 +157,7 @@ const routes = [
{ {
path: '/first-saving-goal', path: '/first-saving-goal',
name: 'first saving goal', name: 'first saving goal',
component: () => import('@/components/Configuration/ConfigurationSteps/FirstSavingGoal.vue'), component: () => import('@/components/Configuration/ConfigurationSteps/ConfigurationSavingGoal.vue'),
} }
] ]
}, },
......
<script setup lang="ts"> <script setup lang="ts">
import Footer from '@/components/BaseComponents/FooterComponent.vue' import Footer from '@/components/BaseComponents/BaseFooter.vue'
import Menu from '@/components/BaseComponents/MenuComponent.vue' import Menu from '@/components/BaseComponents/NavBar.vue'
import Login from '@/components/Login/Login.vue' import Login from '@/components/Login/LoginParent.vue'
</script> </script>
<template> <template>
......
<script setup lang="ts"> <script setup lang="ts">
import { RouterView } from 'vue-router' import { RouterView } from 'vue-router'
import Footer from '@/components/BaseComponents/FooterComponent.vue' import Footer from '@/components/BaseComponents/BaseFooter.vue'
import Menu from '@/components/BaseComponents/MenuComponent.vue' import Menu from '@/components/BaseComponents/NavBar.vue'
import { useUserInfoStore } from '@/stores/UserStore'; import { useUserInfoStore } from '@/stores/UserStore';
</script> </script>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment