Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
6f0bfeb
testing branch develop
LeonardoMessias98 Mar 29, 2021
1319aa7
Merge remote-tracking branch 'origin/hotfix/fixing-main-page-css' int…
Mar 29, 2021
0f58820
branch-screen-login
Mar 30, 2021
c252240
implementing login screen
Mar 30, 2021
0084ab3
Merge pull request #11 from Typext/feature/login-screen
MatheusCampos-450 Mar 30, 2021
738fd44
finishing first recovery login screen
Mar 31, 2021
d5b96f5
NewPassword Screen Front-end
Mar 31, 2021
b71b9cd
conflicts on routes resolved
Mar 31, 2021
14c7bc7
Merge pull request #12 from Typext/feature/implementing-recovery-logi…
LeonardoMessias98 Mar 31, 2021
18a53e0
removing documentation files
Mar 31, 2021
bfeac6d
removing documentation files
Mar 31, 2021
23942ca
invite new user screen
Mar 31, 2021
1cdaf51
resolving routes
Mar 31, 2021
2e30460
Merge pull request #13 from Typext/feature/invite-new-user
hsousadev Mar 31, 2021
3115097
finishing implementing use context
Mar 31, 2021
c483381
select component
Mar 31, 2021
6bc4491
Merge branch 'develop' into feature/implementing-use-context
MatheusCampos-450 Mar 31, 2021
28aa3cc
Merge pull request #14 from Typext/feature/implementing-use-context
hsousadev Mar 31, 2021
9d1690c
finished implement register new user screen
Apr 1, 2021
a055c0c
Merge pull request #15 from Typext/feature/register-new-user
MatheusCampos-450 Apr 1, 2021
d3dd6b4
creating own route component and adjusting header
LeonardoMessias98 Apr 2, 2021
d7fa1b4
Merge pull request #16 from Typext/feature/own-route-component-and-he…
MatheusCampos-450 Apr 2, 2021
45e05e1
hot fix in landing page style
LeonardoMessias98 Apr 2, 2021
2159f3f
adjusting header style
LeonardoMessias98 Apr 2, 2021
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
19 changes: 0 additions & 19 deletions Sprint 1/README.md

This file was deleted.

Binary file not shown.
2 changes: 0 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import React from 'react';

import Header from './components/Header/Header';
import Routes from './routes';
import GlobalStyle from './styles/global';

function App() {
return (
<>
<Header />
<Routes />
<GlobalStyle />
</>
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions src/DTOs/User.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export interface IUser {
name: string;
username: string;
email: string;
}
2 changes: 2 additions & 0 deletions src/DTOs/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './User';
export * from './Minute';
5 changes: 5 additions & 0 deletions src/assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/workInProgress.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import { useHistory } from 'react-router-dom';

import addIcon from '../../assets/add_icon.svg';
import homeIcon from '../../assets/home_icon.svg';
Expand All @@ -8,10 +9,19 @@ import logoutIcon from '../../assets/logout_icon.svg';
import { StyledHeader } from './styles';

const Header = () => {
const history = useHistory();

const handleNavigateToHome = () => {
history.push('/');
};

return (
<StyledHeader>
<section className="shortOptions">
<img src={homeIcon} alt="" />
<button type="button" onClick={handleNavigateToHome}>
<img src={homeIcon} alt="" />
</button>

<img src={addIcon} alt="" />
</section>

Expand Down
11 changes: 11 additions & 0 deletions src/components/Header/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,15 @@ export const StyledHeader = styled.header`
width: 14.375rem;
}
}

button {
border: none;
background: none;
}

.shortOptions {
max-width: 150px;
width: 100%;
justify-content: flex-start;
}
`;
35 changes: 35 additions & 0 deletions src/components/Route/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React from 'react';

import Header from 'components/Header';

import { Route as ReactRoute } from 'react-router-dom';

interface RouteProps {
component: Function;
path: string;
exact?: boolean;
isPrivate?: boolean;
}

const Route = ({ component: Component, isPrivate, ...rest }: RouteProps) => {
return (
<ReactRoute
{...rest}
render={() => {
return (
<>
{isPrivate && <Header />}
<Component />
</>
);
}}
/>
);
};

Route.defaultProps = {
exact: false,
isPrivate: false,
};

export default Route;
39 changes: 39 additions & 0 deletions src/components/Select/Select.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React, { SelectHTMLAttributes } from 'react';
import { StyledSelect } from './styles';

interface SelectProps extends SelectHTMLAttributes<HTMLSelectElement> {
title: string;
color?: string;
Size?: string;
styleWidth?: string;
}

const Select: React.FC<SelectProps> = ({
title,
id,
color,
Size,
styleWidth,
...rest
}: SelectProps) => {
return (
<StyledSelect
SelectWidth={styleWidth || '23.75rem'}
Color={color || 'var(--black)'}
Size={Size || '1.5rem'}
>
<h3>{title}</h3>

<select name={title} id={id} {...rest} />

</StyledSelect>
);
};

Select.defaultProps = {
Size: '',
styleWidth: '23.75rem',
color: '',
};

export default Select;
36 changes: 36 additions & 0 deletions src/components/Select/styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import styled from 'styled-components';

interface Props {
SelectWidth: string;
Color: string;
Size: string;
}

export const StyledSelect = styled.div<Props>`
display: flex;
flex-direction: column;

width: ${props => props.SelectWidth || '23.75rem'};

margin: 0;

select {
display: flex;
align-items: center;
padding-left: 0.625rem;
height: 4.063rem;
background-color: var(--soft-gray);

font-family: Roboto;
font-size: 1.3rem;
font-style: normal;
font-weight: bold;

outline: none;
border: 0;
border-radius: 1.25rem;

width: ${props => props.SelectWidth || '23.75rem'}
}

`;
35 changes: 35 additions & 0 deletions src/contexts/AuthContext.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React, { createContext, useState } from 'react';

import { IUser } from 'DTOs';

interface IAuthProvider {
children: React.ReactNode;
}

interface IAuthContextData {
user: any;
setUser: Function;
}

export const AuthContext = createContext({} as IAuthContextData);

export const AuthProvider: React.FC<IAuthProvider> = ({
children,
}: IAuthProvider) => {
const [user, setUser] = useState<IUser>({
name: '',
username: '',
email: '',
});

return (
<AuthContext.Provider
value={{
user,
setUser,
}}
>
{children}
</AuthContext.Provider>
);
};
60 changes: 55 additions & 5 deletions src/contexts/MainContext.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,64 @@
import React, { createContext } from 'react';
import React, { createContext, useState } from 'react';

export const MainContext = createContext({});
import {
ITopic,
IAddressAndHour,
IProjectInfo,
ISubject,
} from 'DTOs';

interface IMainContext {
interface IMainProvider {
children: React.ReactNode;
}

export const MainProvider: React.FC<IMainContext> = ({ children }: IMainContext) => {
interface IMainContextData {
topics: Array<ITopic>;
setTopics: Function;
showSchedule: Boolean;
setShowSchedule: Function;
addressAndHour: IAddressAndHour;
setAddressAndHour: Function;
projectInfo: IProjectInfo;
setProjectInfo: Function;
subjects: ISubject[];
setSubjects: Function;
distributions: string[];
setDistributions: Function;
}

export const MainContext = createContext({} as IMainContextData);

export const MainProvider: React.FC<IMainProvider> = ({ children }: IMainProvider) => {
const [topics, setTopics] = useState<ITopic[]>([]);
const [showSchedule, setShowSchedule] = useState(false);
const [addressAndHour, setAddressAndHour] = useState<IAddressAndHour>({
local: '',
startDate: '',
startHour: '',
});
const [projectInfo, setProjectInfo] = useState<IProjectInfo>({
projectName: '',
members: [],
});
const [subjects, setSubjects] = useState<ISubject[]>([]);
const [distributions, setDistributions] = useState<string[]>([]);

return (
<MainContext.Provider value="teste">
<MainContext.Provider value={{
topics,
setTopics,
showSchedule,
setShowSchedule,
addressAndHour,
setAddressAndHour,
projectInfo,
setProjectInfo,
subjects,
setSubjects,
distributions,
setDistributions,
}}
>
{children}
</MainContext.Provider>
);
Expand Down
23 changes: 23 additions & 0 deletions src/pages/Home/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React from 'react';
import { useHistory } from 'react-router-dom';

import { Container } from './styles';

const Home = () => {
const history = useHistory();

const handleNavigate = () => {
history.push('/minute');
};

return (
<Container>
Home asd123 12312
<button type="button" onClick={handleNavigate}>
Teste
</button>
</Container>
);
};

export default Home;
3 changes: 3 additions & 0 deletions src/pages/Home/styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import styled from 'styled-components';

export const Container = styled.div``;
47 changes: 47 additions & 0 deletions src/pages/InviteUsers/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import React from 'react';

import Input from 'components/Input/Input';
import Button from 'components/Button/Button';
import Select from 'components/Select/Select';

import StyleInviteUsers from './styles';

function index() {
return (
<StyleInviteUsers>
<h1>Convidar Participante</h1>

<div className="EmailAndPermission">
<Input
title="E-mail"
color="black"
Size="large"
styleWidth="41.875rem"
/>

<Select
title="Nível de permissão"
color="black"
styleWidth="41.875rem"
>
<option value="Admin">Administrador</option>
<option value="Manager">Gerente</option>
<option value="Normal">Comum</option>

</Select>

<Button
color="var(--black)"
colorText="white"
size="23.75rem"
>
Convidar

</Button>

</div>
</StyleInviteUsers>
);
}

export default index;
Loading