Commit 674c21f1 authored by lucashleal's avatar lucashleal
Browse files

merge com a develop

parents 955671dd dccdb45a
Showing with 126 additions and 83 deletions
+126 -83
......@@ -3,5 +3,6 @@
"trailingComma": "es5",
"singleQuote": true,
"tabWidth": 2,
"useTabs": false
"useTabs": false,
"endOfLine": "auto"
}
import { Box, Button, Flex, Text } from '@chakra-ui/react';
import limit from '@utils/limit';
import { useRouter } from 'next/router';
import limit from 'old_src/utils/limit';
interface ArticleCardProps {
title: string;
......
import { Flex, Grid, GridItem, Spinner } from '@chakra-ui/react';
import { Article } from '@interfaces/Article';
import { Article } from 'old_src/interfaces/Article';
import ArticleCard from './ArticleCard';
export default function ArticleGrid({
......
......@@ -14,7 +14,7 @@ import {
Text,
useColorModeValue,
useDisclosure,
VStack
VStack,
} from '@chakra-ui/react';
import { IconType } from 'react-icons';
import * as icons from 'react-icons/fi';
......@@ -37,16 +37,16 @@ const SIDE_ITENS: Array<SideItem> = [
{
icon: icons.FiHome,
name: 'Home',
href: '/',
href: '/admin',
},
{
icon: icons.FiFileText,
name: 'Questionários',
sub: [
{ name: 'Listar', href: '/' },
{ name: 'Listar', href: '/admin' },
{
name: 'Adicionar',
href: '/',
href: '/admin',
},
],
},
......@@ -54,10 +54,10 @@ const SIDE_ITENS: Array<SideItem> = [
icon: icons.FiUser,
name: 'Pesquisadores',
sub: [
{ name: 'Listar', href: '/' },
{ name: 'Listar', href: '/admin' },
{
name: 'Adicionar',
href: '/',
href: '/admin',
},
],
},
......@@ -65,10 +65,10 @@ const SIDE_ITENS: Array<SideItem> = [
icon: icons.FiUser,
name: 'Linhas de Pesquisa',
sub: [
{ name: 'Listar', href: '/' },
{ name: 'Listar', href: '/admin' },
{
name: 'Adicionar',
href: '/',
href: '/admin',
},
],
},
......@@ -91,8 +91,7 @@ function NavItem(props: NavProps): JSX.Element {
style={{ textDecoration: 'none' }}
_focus={{ boxShadow: 'none' }}
>
<Box
alignContent="space-around"
<Flex
p="4"
mx="4"
borderRadius="lg"
......@@ -102,18 +101,14 @@ function NavItem(props: NavProps): JSX.Element {
bg: 'gray.100',
}}
backgroundColor={isOpen ? 'gray.100' : 'white'}
align="center"
justify="space-between"
>
{icon && <Icon mr="4" fontSize="16" as={icon} />}
{name}
{sub && (
<Icon
alignSelf="flex-end"
mr="4"
fontSize="16"
as={icons.FiChevronDown}
/>
)}
</Box>
<Flex>
{icon && <Icon mr="4" fontSize="16" as={icon} />}
{name}
</Flex>
</Flex>
</Link>
{sub && (
<Collapse in={isOpen} animateOpacity>
......@@ -261,6 +256,7 @@ export default function SidebarWithHeader({
minH="100vh"
bg={useColorModeValue('gray.100', 'gray.900')}
boxShadow="2xl"
w="full"
>
<Box>
<SidebarContent />
......
import {
Button,
FormControl,
FormLabel,
IconButton,
Modal,
ModalBody,
ModalCloseButton,
ModalContent,
ModalFooter,
ModalHeader,
ModalOverlay,
useDisclosure,
VStack,
Button,
FormControl,
FormLabel,
IconButton,
Modal,
ModalBody,
ModalCloseButton,
ModalContent,
ModalFooter,
ModalHeader,
ModalOverlay,
useDisclosure,
VStack
} from '@chakra-ui/react';
import api from '@lib/api';
import { Select } from 'chakra-react-select';
import { useFormik } from 'formik';
import api from 'old_src/lib/api';
import { useEffect, useRef, useState } from 'react';
import { FiFilter } from 'react-icons/fi';
......
......@@ -6,18 +6,18 @@ import {
Link,
Stack,
Tag,
Text,
Text
} from '@chakra-ui/react';
import { Member, Social } from '@interfaces/Member';
import { FiFacebook, FiInstagram, FiLinkedin } from 'react-icons/fi';
import { Member, Social } from 'src/types/Member';
function TagsStack({ tags }: { tags: string[] }): JSX.Element {
export function TagsStack({ tags }: { tags: string[] }): JSX.Element {
if (!tags) {
return <Box />;
}
function getColor(index: number): string {
switch (index) {
switch (index % 3) {
case 0:
return 'blue';
case 1:
......
import { Flex, Text } from '@chakra-ui/react';
import { Member } from '@interfaces/Member';
import { Member } from 'src/types/Member';
import MemberCard from './MemberCard';
interface MemberCardCaroselProps {
......
import { CheckCircleIcon, TimeIcon } from '@chakra-ui/icons';
import { Box, Flex, HStack, Tag, Text } from '@chakra-ui/react';
import { Projects } from 'old_src/interfaces/Projects';
import { Pesquisadores } from 'old_src/interfaces/Reasercher';
export interface Projects {
id: string;
titulo: string;
descricao?: string;
estado?: string;
tag?: Array<Tags>;
pesquisadoresIds?: Array<Pesquisadores>;
// afiliacoes?: Array<Afiliacoes>; ainda nao tem no banco
}
interface Tags {
titulo: string;
color: string;
}
interface Pesquisadores {
nome: string;
}
interface Afiliacoes {
nome: string;
}
function TagsStack({ tags }: { tags: Tags[] | undefined }): JSX.Element {
if (!tags) {
function TagsStack({ tag }: { tag: string[] | undefined }): JSX.Element {
if (tag.length == 0) {
return <Box />;
}
return (
<HStack direction="row" justify="center" paddingBottom="24px">
{tags.map((sm) => {
{tag.map((sm) => {
return (
<Tag
size="sm"
variant="solid"
colorScheme={sm.color}
colorScheme="teal"
fontSize="sm"
fontWeight="bold"
>
{sm.titulo}
{sm}
</Tag>
);
})}
......@@ -62,7 +41,7 @@ function ResearcherStack({
<Text>
{pesquisadores
.map((pesquisador) => {
return pesquisador;
return pesquisador.nome;
})
.join(', ')}
</Text>
......@@ -74,7 +53,7 @@ function ResearcherStack({
function AfiliacoesStack({
afiliacoes,
}: {
afiliacoes: Afiliacoes[] | undefined;
afiliacoes: Pesquisadores[] | undefined;
}): JSX.Element {
if (!afiliacoes) {
return <Box />;
......@@ -91,13 +70,12 @@ function AfiliacoesStack({
});
*/
const afiliacoesUnicas = Array.from(new Set(afiliacoes));
return (
<HStack direction="row" justify="center" paddingBottom="24px">
<Text>
{afiliacoesUnicas
{afiliacoes
.map((afiliacao) => {
return afiliacao;
return afiliacao.afiliacao;
})
.join(', ')}
</Text>
......@@ -161,13 +139,12 @@ function ProjectItem({ project }: { project: Projects }): JSX.Element {
maxW="300.px"
m="auto"
>
<TagsStack tags={project.tag} />
<ResearcherStack pesquisadores={project.pesquisadoresIds} />
<TagsStack tag={project.tag} />
<ResearcherStack pesquisadores={project.pesquisadores} />
<AfiliacoesStack afiliacoes={project.pesquisadores} />
</Flex>
</Box>
);
}
// <AfiliacoesStack afiliacoes={project.afiliacoes} />
export default ProjectItem;
import { Button, Flex, Input } from '@chakra-ui/react';
import { FilterProps } from '@components/Filter';
import api from '@lib/api';
import { useFormik } from 'formik';
import { FilterProps } from 'old_src/components/Filter';
import api from 'old_src/lib/api';
import { useEffect, useState } from 'react';
interface SearchInputProps {
......
File moved
File moved
import { Pesquisadores } from 'old_src/interfaces/Reasercher';
export interface Projects {
id: string;
titulo: string;
descricao?: string;
estado?: string;
tag?: Array<string>;
pesquisadores?: Array<Pesquisadores>;
}
export interface Pesquisadores {
nome: string;
afiliacao: string;
}
......@@ -3,7 +3,7 @@ import axios from 'axios';
const api = axios.create({
baseURL:
process.env.NODE_ENV === 'development'
? 'http://localhost:3000/api/mock'
? 'http://localhost:4000/api'
: // : 'URL PRODUCCION',
'http://127.0.0.1:3000/api/mock',
});
......
import api from 'old_src/lib/api';
export default async function getAllResearchers() {
const res = await api.get('/pesquisadores');
const researchers = await res.data;
return researchers;
}
import api from 'old_src/lib/api';
async function getAllProjects() {
const res = await api.get('/projetos');
const projects = await res.data;
return projects;
}
export default {
getAllProjects,
};
import { ChakraProvider, Flex } from '@chakra-ui/react';
import type { AppProps } from 'next/app';
import { useRouter } from 'next/router';
import SidebarWithHeader from 'old_src/components/Dashboard/Sidebar';
import Footer from 'old_src/components/Footer';
import Navbar from 'old_src/components/Navbar';
function MyApp({ Component, pageProps }: AppProps): React.ReactNode {
const router = useRouter();
const renderNavFooter = !(
router.pathname.includes('/auth') || router.pathname.includes('/admin')
);
const isDashboard = router.pathname.includes('/admin');
return (
<ChakraProvider>
<Flex direction={isDashboard ? 'row' : 'column'} h="100vh" w="full">
{renderNavFooter && <Navbar />}
{isDashboard ? (
<SidebarWithHeader>
<Flex w="full" h="full" direction="column" justify="space-between">
<Component {...pageProps} />
{renderNavFooter && <Footer />}
</Flex>
</SidebarWithHeader>
) : (
<Flex h="full" direction="column" justify="space-between">
<Component {...pageProps} />
{renderNavFooter && <Footer />}
</Flex>
)}
</Flex>
</ChakraProvider>
);
}
export default MyApp;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment