Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create sidebar #32

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
9354e28
Create dashboard vue and sidebar component
djhonantanparreira Aug 3, 2024
c6ed4d8
Refactor App.vue: add sidebar component for dashboard navigation
djhonantanparreira Aug 25, 2024
7d0b533
refactor: remove unused routes and components from sidebar navigation
djhonantanparreira Sep 28, 2024
52784af
Refactor sidebar navigation: remove unused routes and components
djhonantanparreira Oct 14, 2024
7754b6e
Refactor sidebar navigation: remove unused routes and components; add…
djhonantanparreira Oct 14, 2024
a9555f5
Add VITE_API_URL to .env.example
djhonantanparreira Oct 15, 2024
62abd39
refactor: improve localization, error handling, and UI messaging
djhonantanparreira Oct 15, 2024
925e5d4
Refactor user profile and registry views: handle empty fields gracefully
djhonantanparreira Oct 15, 2024
663b224
Refactor LoginView: update logo visibility for responsive design
djhonantanparreira Oct 31, 2024
57b35e2
Refactor auth store: store user data in localStorage and update auth …
djhonantanparreira Oct 31, 2024
5ad2d4b
Refactor auth store: update role retrieval to use permission instead …
djhonantanparreira Oct 31, 2024
6bf6b1f
Refactor auth store: remove user data from localStorage on logout
djhonantanparreira Oct 31, 2024
32695c7
Refactor router: simplify authentication check by accessing auth.name…
djhonantanparreira Oct 31, 2024
33595d1
Refactor router: access authentication name through auth.auth for cla…
djhonantanparreira Oct 31, 2024
f5adbea
Refactor router: enhance authentication check and error handling duri…
djhonantanparreira Nov 1, 2024
e5c1eb7
Refactor auth store: improve error handling by displaying specific er…
djhonantanparreira Nov 1, 2024
5fc1bae
Refactor profile update: streamline profile data handling and improve…
djhonantanparreira Nov 1, 2024
327e8aa
Refactor product store: add success snackbar notifications for produc…
djhonantanparreira Nov 1, 2024
74df8e5
Refactor App and Sidebar components: improve layout responsiveness an…
djhonantanparreira Nov 1, 2024
c7eeeaf
Refactor App and Sidebar components: enhance layout responsiveness an…
djhonantanparreira Nov 25, 2024
3c4feab
Fix: update isHomePage condition to include login and registry paths
djhonantanparreira Nov 25, 2024
0b29175
Merge pull request #1 from djhonantanparreira/migracao-nova-api
djhonantanparreira Nov 25, 2024
b10805b
Fix: adjust padding in main container for improved layout
djhonantanparreira Nov 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .env

This file was deleted.

1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_API_URL=http://localhost:9501
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dist
dist-ssr
coverage
*.local
.env

/cypress/videos/
/cypress/screenshots/
Expand Down
112 changes: 74 additions & 38 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<template>
<v-app :class="ef">
<HeaderMenu />
<component :is="currentLayout" />
<transition name="fade" mode="out-in">
<v-main class="d-flex flex-grow-1 main-container" style="margin-top: 64px">
<v-main class="main-container" :class="{ 'route-content-style': !isHomePage }">
<RouterView />
<v-snackbar v-model="snackbarStore.snack.show" v-bind="snackbarStore.snack" location="top right">
<v-snackbar
v-model="snackbarStore.snack.show"
v-bind="snackbarStore.snack"
location="top right"
>
{{ text }}
<template #actions>
<v-btn variant="text" @click="snackbar = false">
Close
</v-btn>
<v-btn variant="text" @click="snackbarStore.hideSnackbar">Fechar</v-btn>
</template>
</v-snackbar>
</v-main>
Expand All @@ -18,19 +20,51 @@
</template>

<script setup>
import { computed } from 'vue'
import { ref, computed, onMounted } from 'vue'
import { useRoute } from 'vue-router'
import { useTheme } from 'vuetify'
import { useSnackbarStore } from '@/stores/snackbar'
import HeaderMenu from '@/components/HeaderMenu.vue'
import SideMenu from '@/components/dashboard/Sidebar.vue'

const theme = useTheme()
const snackbarStore = useSnackbarStore()
const route = useRoute()

const currentTheme = computed(() => theme.current.value)
const sideMenuRoutes = [
'/profile',
'/onboarding',
'/products',
'/product/:uuid',
'/product/create',
'/squads/:uuid',
'/squad/:uuid',
'/squad/create/:productUuid',
'/squad/:uuid/update'
]

const ef = computed(() => (route.path === '/' ? 'homeBackgroundEffect' : ''))
const currentLayout = computed(() =>
route.matched.some((record) =>
sideMenuRoutes.some((pattern) =>
new RegExp(pattern.replace(':uuid', '[^/]+')).test(record.path)
)
)
? SideMenu
: HeaderMenu
)

const isHomePage = computed(() => {
return ['/', '/login', '/registry'].includes(route.path)
})
const ef = computed(() => (route.path === '/' ? 'homeBackgroundEffect' : ''))

const isMobile = ref(window.innerWidth <= 960)

onMounted(() => {
window.addEventListener('resize', () => {
isMobile.value = window.innerWidth <= 960
})
})
</script>

<style lang="scss">
Expand All @@ -40,62 +74,64 @@ const ef = computed(() => (route.path === '/' ? 'homeBackgroundEffect' : ''))
}

.main-container {
margin-left: 240px;
margin-right: 240px;
padding: 0;
margin: 64px auto;
padding: 0 250px;
max-width: 100vw;
width: 100%;

@media (max-width: 1500px) {
margin-left: 120px;
margin-right: 120px;
padding: 0 120px;
}

@media (max-width: 1300px) {
margin-left: 64px;
margin-right: 64px;
padding: 0 64px;
}

@media (max-width: 968px) {
margin-left: 32px;
margin-right: 32px;
padding: 0 32px;
}

@media (max-width: 600px) {
margin-left: 16px;
margin-right: 16px;
padding: 0 16px;
}
}

h2 {
font-size: 36px;
font-family: 'Radio Canada', sans-serif;
font-weight: 700;
color: #62d4a4;
.route-content-style {
padding: 0px 0px 0px 250px;
@media (max-width: 968px) {
padding: 0 32px;
}

@media (max-width: 600px) {
padding: 0 16px;
}
}

h3 {
font-size: 32px;
h2,
h3,
h4,
h5,
h6 {
font-family: 'Radio Canada', sans-serif;
font-weight: 700;
color: #62d4a4;
}

h2 {
font-size: 2.25rem;
}
h3 {
font-size: 2rem;
}
h4 {
font-size: 22px;
font-family: 'Radio Canada', sans-serif;
font-weight: 700;
font-size: 1.375rem;
}

h5 {
font-size: 40px;
font-family: 'Inter', sans-serif;
font-weight: 600;
font-size: 2.5rem;
color: #ffffff;
}

h6 {
font-size: 20px;
font-family: 'Radio Canada', sans-serif;
font-weight: 600;
font-size: 1.25rem;
color: #ffffff;
}
</style>
Binary file added src/assets/default-avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
179 changes: 93 additions & 86 deletions src/components/HeaderMenu.vue
Original file line number Diff line number Diff line change
@@ -1,67 +1,74 @@
<template>
<v-app-bar class="header" color="transparent" app elevation="4">
<div class="w-100 d-flex align-center justify-space-between main-container">
<a class="d-flex align-center logo" @click="navigateToHome">
<v-img height="36" width="36" :src="imgUrl" alt="Logo SouJunior" />
<h1 class="text-h5 font-weight-bold font-semibold primary-color ml-3 logo-text">
SouJunior Labs
</h1>
</a>
<div class="d-flex align-center ga-2" v-if="!isMobile">
<v-btn variant="text" class="font-weight-semibold" :to="{ name: 'home' }"> Home </v-btn>
<v-btn v-if="logged" variant="text" class="font-weight-semibold" :to="{ name: 'onboarding' }">
Onboarding
</v-btn>
<v-btn v-if="!logged" variant="text" class="font-weight-semibold" :to="{ name: 'login' }">
Login
</v-btn>
<v-btn variant="text" class="font-weight-semibold" :to="{ name: 'products' }"> Produtos </v-btn>
<v-menu v-if="logged" open-on-hover>
<template #activator="{ props }">
<v-btn variant="text" class="font-weight-semibold" v-bind="props">
{{ auth.getName() }}
<v-icon right>mdi-chevron-down</v-icon>
</v-btn>
</template>
<v-list>
<v-list-item link :to="{ name: 'profile' }">
<v-list-item-title>Profile</v-list-item-title>
</v-list-item>
<v-list-item link @click="auth.logout()">
<v-list-item-title>Logout</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
</div>
<v-menu v-else>
<template #activator="{ props }">
<v-btn icon v-bind="props">
<v-icon>mdi-menu</v-icon>
</v-btn>
</template>
<v-list>
<v-list-item link :to="{ name: 'home' }">
<v-list-item-title>Home</v-list-item-title>
</v-list-item>
<v-list-item link v-if="logged" :to="{ name: 'onboarding' }">
<v-list-item-title>Onboarding</v-list-item-title>
</v-list-item>
<v-list-item link v-if="!logged" :to="{ name: 'login' }">
<v-list-item-title>Login</v-list-item-title>
</v-list-item>
<v-list-item link :to="{ name: 'products' }">
<v-list-item-title>Produtos</v-list-item-title>
</v-list-item>
<v-list-item link v-if="logged" :to="{ name: 'profile' }">
<v-list-item-title>Profile</v-list-item-title>
</v-list-item>
<v-list-item link v-if="logged" @click="auth.logout()">
<v-list-item-title>Logout</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
</div>
</v-app-bar>
<v-app-bar class="header" color="transparent" app elevation="4">
<div class="w-100 d-flex align-center justify-space-between main-container">
<a class="d-flex align-center logo" @click="navigateToHome">
<v-img height="36" width="36" :src="imgUrl" alt="Logo SouJunior" />
<h1 class="text-h5 font-weight-bold font-semibold primary-color ml-3 logo-text">
SouJunior Labs
</h1>
</a>
<div class="d-flex align-center ga-2" v-if="!isMobile">
<v-btn variant="text" class="font-weight-semibold" :to="{ name: 'home' }"> Home </v-btn>
<v-btn
v-if="logged"
variant="text"
class="font-weight-semibold"
:to="{ name: 'onboarding' }"
>
Onboarding
</v-btn>
<v-btn v-if="!logged" variant="text" class="font-weight-semibold" :to="{ name: 'login' }">
Login
</v-btn>
<v-btn v-if="logged" variant="text" class="font-weight-semibold" :to="{ name: 'products' }">
Produtos
</v-btn>
<v-menu v-if="logged" open-on-hover>
<template #activator="{ props }">
<v-btn variant="text" class="font-weight-semibold" v-bind="props">
{{ auth.getName() }}
<v-icon right>mdi-chevron-down</v-icon>
</v-btn>
</template>
<v-list>
<v-list-item link :to="{ name: 'profile' }">
<v-list-item-title>Profile</v-list-item-title>
</v-list-item>
<v-list-item link @click="auth.logout()">
<v-list-item-title>Logout</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
</div>
<v-menu v-else>
<template #activator="{ props }">
<v-btn icon v-bind="props">
<v-icon>mdi-menu</v-icon>
</v-btn>
</template>
<v-list>
<v-list-item link :to="{ name: 'home' }">
<v-list-item-title>Home</v-list-item-title>
</v-list-item>
<v-list-item link v-if="logged" :to="{ name: 'onboarding' }">
<v-list-item-title>Onboarding</v-list-item-title>
</v-list-item>
<v-list-item link v-if="!logged" :to="{ name: 'login' }">
<v-list-item-title>Login</v-list-item-title>
</v-list-item>
<v-list-item link v-if="!logged" :to="{ name: 'products' }">
<v-list-item-title>Produtos</v-list-item-title>
</v-list-item>
<v-list-item link v-if="logged" :to="{ name: 'profile' }">
<v-list-item-title>Profile</v-list-item-title>
</v-list-item>
<v-list-item link v-if="logged" @click="auth.logout()">
<v-list-item-title>Logout</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
</div>
</v-app-bar>
</template>

<script setup>
Expand All @@ -78,49 +85,49 @@ const auth = useAuthStore()
const logged = computed(() => auth.getName() != '')

const navigateToHome = () => {
router.push({ name: 'home' })
router.push({ name: 'home' })
}

const isMobile = computed(() => window.innerWidth <= 960)
</script>

<style lang="scss">
.header {
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
}

.main-container {
margin-left: 240px;
margin-right: 240px;
padding: 0;
margin-left: 240px;
margin-right: 240px;
padding: 0;

@media (max-width: 1600px) {
margin-left: 120px;
margin-right: 120px;
}
@media (max-width: 1600px) {
margin-left: 120px;
margin-right: 120px;
}

@media (max-width: 600px) {
margin-left: 16px;
margin-right: 16px;
}
@media (max-width: 600px) {
margin-left: 16px;
margin-right: 16px;
}
}

.primary-color {
color: #06d7a0;
color: #06d7a0;
}

.logo {
cursor: pointer;
transition: ease-in-out 0.2s;
cursor: pointer;
transition: ease-in-out 0.2s;

&:hover {
filter: brightness(1.25);
transition: ease-in-out 0.2s;
}
&:hover {
filter: brightness(1.25);
transition: ease-in-out 0.2s;
}
}

.logo-text {
font-family: 'Radio Canada', serif !important;
font-family: 'Radio Canada', serif !important;
}
</style>
</style>
Loading