Skip to content

Commit

Permalink
Merge pull request #29 from Daniel-Alvarenga/main
Browse files Browse the repository at this point in the history
Add Search Users Page
  • Loading branch information
Daniel-Alvarenga authored Jul 6, 2024
2 parents a0cbfc8 + 27d5030 commit 8a02921
Show file tree
Hide file tree
Showing 13 changed files with 376 additions and 37 deletions.
16 changes: 8 additions & 8 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/src/components/aluno/AsideDashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</router-link>
</li>
<li :class="getClassForPage('pesquisa')">
<router-link to="">
<router-link to="/buscar">
<img :src="icons.search">
<p v-if="showPs">Pesquisa</p>
</router-link>
Expand Down
6 changes: 6 additions & 0 deletions client/src/router/routes/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Home from '../../views/shared/Home.vue';
import NotFound from '../../views/shared/NotFound.vue';
import PublicPerfilAluno from '../../views/shared/PerfilAluno.vue';
import PublicPerfilProfessor from '../../views/shared/PerfilProfessor.vue';
import Pesquisa from '../../views/shared/Pesquisa.vue';
import { isAuthSomebody } from '../guards/guards';

export const sharedRoutes = [
Expand All @@ -28,6 +29,11 @@ export const sharedRoutes = [
name: "PublicPerfilProfessor",
component: PublicPerfilProfessor
},
{
path: '/buscar',
name: 'Pesquisa',
component: Pesquisa
},
{
path: '/:pathMatch(.*)*',
name: 'NotFound',
Expand Down
18 changes: 1 addition & 17 deletions client/src/scss/pages/aluno/_rede.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,6 @@ main {
border-radius: 10px;
color: $secondary-color-dark;
border: solid 1px $primary-color-orange;
transition: 0.1s linear;
@include line;
@include flex-center;
@include m-screen(1120px) {
padding: 8px 18px;
}

// &:after {
// height: 0;
// }

// &:hover {
// background-color: transparent;
// border: solid 1px $primary-color-orange;
// color: $primary-color-orange;
// }
}
}

Expand All @@ -112,4 +96,4 @@ main {
}
}
}
}
}
156 changes: 156 additions & 0 deletions client/src/scss/pages/shared/_pesquisa.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
#app{
height: 100vh;

main {
@include flex(row, flex-start, start);
width: 100vw;
height: 100vh;
min-height: calc(100vh - 80px);
border-bottom: 1px solid #0000008f;
background-color: $primary-color-dark;
position: relative;

.content {
@include flex(column, flex-start, start);
width: calc(100% - 300px);
height: 100%;

@include m-screen(1200px) {
width: 100%;
}

.search {
@include flex(row, center, start);
height: 50px;
width: 62%;
padding: 20px 30px 20px 80px;

.box{
@include flex(row, cen, start);
height: 50px;
border-radius: 25px;
width: calc(100% - 40px);
background-color: $secondary-color-dark;

input {
color: $font-color-dark-2;
width: 94%;
height: 100%;
padding-inline: 15px;
outline: none;
background: transparent;
border: none;
font-size: medium
}

button {
@include flex-center;
height: 100%;
background-color: transparent;
border: none;

img {
height: 55%;
object-fit: cover;
opacity: 0.8;
filter: invert(100%)
}
}
}
}

>.box {
@include flex(column, flex-start, start);
padding: 50px 0px 0px 100px;
width: 70%;
height: 100%;

@include m-screen(1400px) {
@include flex(column, center, center);
padding: 50px 0px 0px 0px;
width: 100%;
}

.resultado {
@include flex(column, flex-end, start);
color: $secondary-color-orange;
margin-right: 10px;
margin-bottom: 10px;
height: 100%;
font-size: small;
font-weight: 200;
@include font-inter(600);
}


.user {
@include flex(column, flex-start, start);
width: 80%;
height: 90px;
margin-bottom: 10px;

@include m-screen(1400px) {
width: 70%;
}

@include m-screen(800px) {
width: 90%;
}

a {
@include flex(row, flex-start, start);
width: 100%;
height: 100%;
background-color: $secondary-color-dark;
padding: 15px;
border-radius: 5px;
text-decoration: none;
color: $font-color-dark;

img {
height: 60px;
width: 60px;
object-fit: cover;
border-radius: 50%;
margin-right: 20px;
}

.infoAluno {
@include flex(row, space-between, start);
width: calc(100% - 60px);
height: 100%;

.who {
color: $primary-color-orange;
margin-right: 10px;
margin-bottom: 10px;
}

.contentAluno {
@include flex(column, flex-start, start);
}

.box-button{
height: 100%;
@include flex(column, center, center);

button{
background-color: $primary-color-orange;
padding: 10px 20px;
border-radius: 10px;
color: $secondary-color-dark;
border: solid 1px $primary-color-orange;
}
}

}

p {
@include font-inter(600);
}
}
}
}
}
}
}
2 changes: 1 addition & 1 deletion client/src/services/api/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const loginAdmin = async(userAdmin) => {
const response = await api.post('admin/login', userAdmin);
return response;
} catch (error) {
return error.data;
return error.response.data;
}
}

Expand Down
12 changes: 11 additions & 1 deletion client/src/services/api/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,14 @@ export const getBanner = async (info) => {
} catch (error) {
return error.response.data;
}
}
}

export const getUsers = async () => {
try {
const response = await api.get('shared/users');
console.log(response.data.alunos);
return response;
} catch (error) {
return error.response.data;
}
}
8 changes: 3 additions & 5 deletions client/src/views/shared/PerfilAluno.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ export default {
this.calcularIdade(this.aluno.nascimento);
this.aluno.nome = response.data.nome;
} else {
router.push({path: "/notfound"});
// router.push({path: "/notfound"});
}
} catch (error) {
router.push({path: "/notfound"});
// router.push({path: "/notfound"});
}
try {
Expand All @@ -138,15 +138,13 @@ export default {
if (response.status >= 200 && response.status < 300) {
this.aluno.imageUrl = response.data.url;
} else {
// router.push({path: "/notfound"});
}
if (responseBanner.status >= 200 && responseBanner.status < 300) {
this.aluno.bannerUrl = responseBanner.data.url;
}
} catch (error) {
// router.push({path: "/notfound"});
router.push({path: "/notfound"});
}
},
calcularIdade(nascimento) {
Expand Down
Loading

0 comments on commit 8a02921

Please sign in to comment.