Skip to content

Commit

Permalink
Merge pull request marceloodomingos#3 from henriq4/feat/refactoring-t…
Browse files Browse the repository at this point in the history
…o-monorepo

Feat/refactoring to monorepo
  • Loading branch information
gelzinn authored Feb 22, 2023
2 parents 084bd34 + ef991bf commit bd25fb0
Show file tree
Hide file tree
Showing 15 changed files with 235 additions and 138 deletions.
61 changes: 61 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,64 @@ pnpm i
```bash
pnpm dev
```
## Membros

<table>
<tr>
<td valign="top">
<img src="https://github.com/gelzinn.png?size=120" width=120>
</td>
<td valign="center">
<p><b>@gelzinn</b><br>Designer & Developer</p>
</td>
<td valign="center">
<a href="https://gelzin.com" target="_blank"><img src="https://img.shields.io/badge/-gelzin.com-black?&style=for-the-badge"></a>
<a href="https://www.github.com/gelzinn" target="_blank"><img src="https://img.shields.io/badge/GitHub-%23333333.svg?&style=for-the-badge&logo=github&logoColor=white" alt="@gelzinn on GitHub"></a>
<a href="https://www.youtube.com/c/gelzinn_" target="_blank"><img src="https://img.shields.io/badge/YouTube-FF0000?style=for-the-badge&logo=youtube&logoColor=white" target="_blank"></a>
<a href="https://instagram.com/gelzinn" target="_blank"><img src="https://img.shields.io/badge/-Instagram-%23E4405F?style=for-the-badge&logo=instagram&logoColor=white" target="_blank"></a>
<a href="https://twitter.com/gelzinn_" target="_blank"><img src="https://img.shields.io/badge/twitter-%231DA1F2.svg?&style=for-the-badge&logo=twitter&logoColor=white" target="_blank"></a>
<a href="https://www.linkedin.com/in/gelzin" target="_blank"><img src="https://img.shields.io/badge/-LinkedIn-%230077B5?style=for-the-badge&logo=linkedin&logoColor=white" target="_blank"></a>
</td>
</tr>

<tr>
<td valign="top">
<img src="https://github.com/henriq4.png?size=120" width=120>
</td>
<td valign="center">
<p><b>@henriq4</b><br>Developer</p>
</td>
<td valign="center">
<a href="https://henriquegc.dev" target="_blank"><img src="https://img.shields.io/badge/-henriquegc.dev-black?&style=for-the-badge"></a>
<a href="https://www.github.com/henriq4" target="_blank"><img src="https://img.shields.io/badge/GitHub-%23333333.svg?&style=for-the-badge&logo=github&logoColor=white" alt="@Henrique GC on web"></a>
<a href="https://www.linkedin.com/in/henriq4" target="_blank"><img src="https://img.shields.io/badge/-LinkedIn-%230077B5?style=for-the-badge&logo=linkedin&logoColor=white" target="_blank"></a>
</td>
</tr>

<tr>
<td valign="top">
<img src="https://github.com/danielspng.png?size=120" width=120>
</td>
<td valign="center">
<p><b>@danielspng</b><br>Designer</p>
</td>
<td valign="center">
<a href="https://www.github.com/danielspng" target="_blank"><img src="https://img.shields.io/badge/GitHub-%23333333.svg?&style=for-the-badge&logo=github&logoColor=white" alt="@danielspng on GitHub"></a>
<a href="https://www.instagram.com/daniells.png" target="_blank"><img src="https://img.shields.io/badge/Instagram-%23E4405F.svg?&style=for-the-badge&logo=instagram&logoColor=white" alt="@daniells.png on Instagram"></a>
<a href="https://www.twiiter.com/danielsann0" target="_blank"><img src="https://img.shields.io/badge/Twitter-%231877F2.svg?&style=for-the-badge&logo=twitter&logoColor=white" alt="@danielsann0 on Twitter"></a>
</td>
</tr>

<tr>
<td valign="top">
<img src="https://github.com/luannzin.png?size=120" width=120>
</td>
<td valign="center">
<p><b>@luannzin</b><br>Content creator</p>
</td>
<td valign="center">
<a href="https://www.github.com/luannzin" target="_blank"><img src="https://img.shields.io/badge/GitHub-%23333333.svg?&style=for-the-badge&logo=github&logoColor=white" alt="@luannzin on GitHub"></a>
<a href="https://www.instagram.com/__luannzin" target="_blank"><img src="https://img.shields.io/badge/Instagram-%23E4405F.svg?&style=for-the-badge&logo=instagram&logoColor=white" alt="@__luannzin on Instagram"></a>
</td>
</tr>
</table>
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"styled-components": "^5.3.5"
},
"devDependencies": {
"@pizy/tsconfig": "workspace*",
"@pizy/tsconfig": "workspace:*",
"@types/node": "18.7.16",
"@types/react": "18.0.19",
"typescript": "^4.9.5"
Expand Down
8 changes: 7 additions & 1 deletion apps/web/src/components/Buttons/Glassmorphism/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { ReactNode } from "react";

import { GlassButton } from "./styles";

export default function GlassmorphismButton({ children }) {
export default function GlassmorphismButton({
children,
}: {
children: ReactNode;
}) {
return <GlassButton>{children}</GlassButton>;
}
4 changes: 3 additions & 1 deletion apps/web/src/components/Buttons/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { ReactNode } from "react";

import { ButtonContainer } from "./styles";

export default function Button({ children }) {
export default function Button({ children }: { children: ReactNode }) {
return <ButtonContainer>{children}</ButtonContainer>;
}
40 changes: 22 additions & 18 deletions apps/web/src/components/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ export default function Header() {
} = user;

const getGitHubData = async () => {
if (!user.photoURL) {
return;
}

const response = await axios.get(
`https://api.github.com/user/${
user.photoURL
Expand Down Expand Up @@ -51,23 +55,23 @@ export default function Header() {
};
}, []);

useEffect(() => {
try {
const projectsDb = () =>
db
.collection("projects")
.get()
.then(response => {
setProjects(
response.docs.map(doc => ({ ...doc.data(), id: doc.id })),
);
});
// useEffect(() => {
// try {
// const projectsDb = () =>
// db
// .collection("projects")
// .get()
// .then(response => {
// return setProjects(
// response.docs.map(doc => ({ ...doc.data(), id: doc.id })),
// );
// });

projectsDb();
} catch (error) {
console.log(error);
}
}, []);
// projectsDb();
// } catch (error) {
// console.log(error);
// }
// }, []);

const year = new Date().getFullYear();

Expand Down Expand Up @@ -132,7 +136,7 @@ export default function Header() {
{projects && projects.length > 0 && (
<div>
<span>Feitos pela PIZY</span>
<ul>
{/* <ul>
{projects.slice(0, 4).map(project => (
<a
key={project.name}
Expand All @@ -143,7 +147,7 @@ export default function Header() {
{project.name}
</a>
))}
</ul>
</ul> */}
</div>
)}
</div>
Expand Down
12 changes: 7 additions & 5 deletions apps/web/src/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ export default function Header(props: HeaderProps) {
} = user;

const getGitHubData = async () => {
if (!user.photoURL) return;

const response = await axios.get(
`https://api.github.com/user/${
user.photoURL
Expand Down Expand Up @@ -108,7 +110,7 @@ export default function Header(props: HeaderProps) {
<img src="../../pizy-group-logo-not-filled.png" alt="PIZY Group" />
</a>

<ul className={openMenu ? "menu-opened" : null}>
{/* <ul className={openMenu ? "menu-opened" : null}>
<div className="links">
<a href="/" className="active">
Início
Expand All @@ -122,9 +124,9 @@ export default function Header(props: HeaderProps) {
<a href="/blog" className="">
Blog
</a>
</div>
</div> */}

{/* <NavigationMenu.Root>
{/* <NavigationMenu.Root>
<NavigationMenu.List>
<NavigationMenu.Item>
<NavigationMenu.Trigger>Item one</NavigationMenu.Trigger>
Expand All @@ -142,7 +144,7 @@ export default function Header(props: HeaderProps) {
<NavigationMenu.Viewport />
</NavigationMenu.Root> */}

<div className="actions">
{/* <div className="actions">
{user ? (
<>
<a href="https://pizy.vercel.app/" onClick={handleLogout}>
Expand Down Expand Up @@ -174,7 +176,7 @@ export default function Header(props: HeaderProps) {
</a>
)}
</div>
</ul>
</ul> */}
<button
type="button"
className={
Expand Down
8 changes: 4 additions & 4 deletions apps/web/src/components/Header/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const HeaderContainer = styled.header<HeaderProps>`
height: 100px;
z-index: 10;
position: ${(props) => props.absolute && "absolute"};
position: ${props => props.absolute && "absolute"};
top: 0;
background: var(--black-full);
Expand Down Expand Up @@ -49,7 +49,7 @@ export const HeaderContainer = styled.header<HeaderProps>`
pointer-events: none;
user-select: none;
filter: ${(props) => props.light && "invert(1)"};
filter: ${props => props.light && "invert(1)"};
}
}
Expand Down Expand Up @@ -87,7 +87,7 @@ export const HeaderContainer = styled.header<HeaderProps>`
align-items: center;
text-decoration: none;
color: ${(props) => (props.light ? "var(--white)" : "var(--black)")};
color: ${props => (props.light ? "var(--white)" : "var(--black)")};
padding: 1rem 1.5rem;
border-radius: 0.5rem;
Expand Down Expand Up @@ -255,7 +255,7 @@ export const HeaderContainer = styled.header<HeaderProps>`
max-width: 2rem;
height: 1px;
background: ${(props) =>
background: ${props =>
props.light ? "var(--white)" : "var(--black)"};
transition: all 0.3s cubic-bezier(0.4, 0.01, 0.165, 0.99);
transition-delay: 0s;
Expand Down
8 changes: 7 additions & 1 deletion apps/web/src/contexts/AuthContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ export function AuthContextProvider(props: AuthContextProviderProps) {
} = user;

const getGitHubData = async () => {
if (!user.photoURL) return;

const response = await axios.get(
`https://api.github.com/user/${
user.photoURL
Expand All @@ -68,7 +70,11 @@ export function AuthContextProvider(props: AuthContextProviderProps) {
`https://api.github.com/orgs/pizygroup/members`,
);

if (checkRole.data.find(role => role.login === data.login)) {
if (
checkRole.data.find(
(role: { login: any }) => role.login === data.login,
)
) {
setAdmin(true);

setUser({
Expand Down
42 changes: 22 additions & 20 deletions apps/web/src/pages/blog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@ import LoadingLemon from "../../components/Loaders/LoadingLemon";
import { db } from "../../services/firebase";

function Blog() {
const [posts, setPosts] = useState([]);

useEffect(() => {
const getBlogPosts = async () => {
db.collection("posts")
.get()
.then(response => {
setPosts(
response.docs.map(doc => ({
...doc.data(),
id: doc.id,
})),
);
});
};

getBlogPosts();
}, []);
// const [posts, setPosts] = useState([]);

// useEffect(() => {
// const getBlogPosts = async () => {
// db.collection("posts")
// .get()
// .then(response => {
// return setPosts(
// response.docs.map(doc => ({
// ...doc.data(),
// id: doc.id,
// })),
// );
// });
// };

// getBlogPosts();
// }, []);

return (
<>
Expand All @@ -38,7 +38,7 @@ function Blog() {

<main>
<h1>Blog</h1>
{posts && posts.length > 0 ? (
{/* {posts && posts.length > 0 ? (
posts.map(post => {
return (
<div key={post.id}>
Expand All @@ -49,7 +49,9 @@ function Blog() {
})
) : (
<LoadingLemon />
)}
)} */}

<LoadingLemon />
</main>
</>
);
Expand Down
Loading

0 comments on commit bd25fb0

Please sign in to comment.