Skip to content

Commit 68e147e

Browse files
Merge pull request #41 from Typext/develop
Develop
2 parents 1e192ce + 48d13a8 commit 68e147e

File tree

133 files changed

+3637
-692
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+3637
-692
lines changed

.eslintrc.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
"implicit-arrow-linebreak": "off",
3030
"no-confusing-arrow": "off",
3131
"no-nested-ternary": "off",
32+
"object-curly-newline": "off",
3233
"operator-linebreak": "off",
34+
"no-unused-vars": "warn",
3335
"prettier/prettier": [
3436
"off",
3537
{

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,30 @@
66
"@testing-library/jest-dom": "^5.11.4",
77
"@testing-library/react": "^11.1.0",
88
"@testing-library/user-event": "^12.1.10",
9+
"@types/axios": "^0.14.0",
910
"@types/jest": "^26.0.15",
1011
"@types/node": "^12.0.0",
1112
"@types/react": "^17.0.0",
1213
"@types/react-dom": "^17.0.0",
1314
"@types/react-router-dom": "^5.1.7",
1415
"@types/styled-components": "^5.1.9",
16+
"@unform/core": "^2.1.6",
17+
"@unform/web": "^2.1.6",
1518
"antd": "^4.14.1",
19+
"axios": "^0.21.1",
1620
"moment": "^2.29.1",
1721
"moment-js": "^1.1.15",
1822
"prop-types": "^15.7.2",
1923
"react": "^17.0.2",
2024
"react-dom": "^17.0.2",
25+
"react-icons": "^4.2.0",
2126
"react-router-dom": "^5.2.0",
2227
"react-scripts": "4.0.3",
2328
"react-to-print": "^2.12.3",
2429
"styled-components": "^5.2.1",
2530
"typescript": "^4.1.2",
26-
"web-vitals": "^1.0.1"
31+
"web-vitals": "^1.0.1",
32+
"yup": "^0.32.9"
2733
},
2834
"scripts": {
2935
"start": "react-scripts start",

public/app_logo.svg

Lines changed: 3 additions & 0 deletions
Loading

public/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
name="description"
99
content="Web site created using create-react-app"
1010
/>
11+
<link rel="icon" href="%PUBLIC_URL%/app_logo.svg" />
1112
<link rel="preconnect" href="https://fonts.gstatic.com">
1213
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap" rel="stylesheet">
1314

src/App.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
import React from 'react';
22

3+
import ContextProvider from 'contexts';
4+
35
import Routes from './routes';
46
import GlobalStyle from './styles/global';
57

68
function App() {
79
return (
810
<>
9-
<Routes />
11+
<ContextProvider>
12+
<Routes />
13+
</ContextProvider>
14+
1015
<GlobalStyle />
1116
</>
1217
);

src/DTOs/Auth.tsx

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
import { StringifyOptions } from 'node:querystring';
2+
import { ReactNode } from 'react';
3+
4+
export interface AuthState {
5+
token: string;
6+
user: {
7+
id: string;
8+
type: string;
9+
name: string;
10+
email: string;
11+
office: string;
12+
area: string;
13+
company: string;
14+
phone: string;
15+
password: string;
16+
};
17+
}
18+
19+
export interface SignInCredentials {
20+
email: string;
21+
password: string;
22+
}
23+
24+
export interface InviteUserCredentials {
25+
email: string;
26+
name: string;
27+
type: string;
28+
}
29+
30+
export interface SignUpCredentials {
31+
email: string;
32+
name: string;
33+
password: string;
34+
password_confirmation: string;
35+
office: string;
36+
phone: string;
37+
company: string;
38+
area: string;
39+
}
40+
41+
export interface RecoveryCredentials {
42+
email: string;
43+
}
44+
45+
export interface ResetCredentials {
46+
password: string;
47+
confirmPassword: string;
48+
}
49+
50+
interface InvitationData {
51+
error: string;
52+
loader: boolean;
53+
}
54+
interface RegisterData {
55+
error: string;
56+
loader: boolean;
57+
success: boolean;
58+
}
59+
60+
interface RecoveryPassowordData {
61+
error: string;
62+
loader: boolean;
63+
}
64+
65+
interface ResetPasswordData {
66+
error: String;
67+
loader: boolean;
68+
}
69+
70+
export interface AuthContextData {
71+
user: {
72+
id: string;
73+
type: string;
74+
name: string;
75+
email: string;
76+
office: string;
77+
area: string;
78+
company: string;
79+
phone: string;
80+
password: string;
81+
};
82+
invitation: InvitationData;
83+
register: RegisterData;
84+
recovery: RecoveryPassowordData;
85+
reset: ResetPasswordData;
86+
signIn(crendentials: SignInCredentials): Promise<boolean>;
87+
signUp(crendentials: SignUpCredentials): Promise<void>;
88+
signOut(): void;
89+
inviteUser(crendentials: InviteUserCredentials): Promise<void>;
90+
recoveryPassword(crendentials: RecoveryCredentials): Promise<void>;
91+
resetPassword(credentials: ResetCredentials): Promise<void>;
92+
}
93+
export interface AuthProviderProps {
94+
children: ReactNode;
95+
}

src/DTOs/User.tsx

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
1+
import { ReactNode } from 'react';
2+
13
export interface IUser {
4+
id: string;
5+
type: string;
26
name: string;
3-
username: string;
47
email: string;
8+
office: string;
9+
area: string;
10+
company: string;
11+
phone: string;
12+
password: string;
13+
}
14+
15+
export interface UserContextData {
16+
users: Array<IUser>;
17+
updateUserTypeSuccess: boolean;
18+
deleteUserLoader: boolean;
19+
deleteUserError: string;
20+
updateUserInfoLoader: boolean;
21+
updateUserInfoError: string;
22+
getUsers(): void;
23+
clearAllSuccessStatus(): void;
24+
deleteUser(id: string): void;
25+
updateUserType(credentials: { id: string; userType: string }): void;
26+
updateUserInfo(credentials: IUser): void;
27+
}
28+
29+
export interface UserProviderProps {
30+
children: ReactNode;
531
}

src/DTOs/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export * from './User';
22
export * from './Minute';
3+
export * from './Auth';

src/assets/astronaut.png

392 KB
Loading

src/assets/dislike.svg

Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)