Skip to content

Commit

Permalink
buttonNewNote&goToHome
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardo committed Mar 22, 2024
1 parent ca4e5ef commit fa55e4a
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 76 deletions.
6 changes: 4 additions & 2 deletions src/pages/New/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function New() {
}

function handleBack(){
navigate(-1)
navigate()
}

/**função que manda para o backend */
Expand All @@ -79,6 +79,7 @@ export function New() {
});

alert("Nota cadastrada com sucesso!");
navigate("/");
}

return (
Expand Down Expand Up @@ -151,7 +152,8 @@ export function New() {

<Button
title="Salvar"
onClick={handleNewNote}/>
onClick={handleNewNote}
/>

</Form>
</main>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/home/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ export function Home(){
<NewNote to="/new">

<FiPlus />

Criar Nota
Criar Nota

</NewNote>

Expand Down
147 changes: 75 additions & 72 deletions src/pages/home/style.js
Original file line number Diff line number Diff line change
@@ -1,72 +1,75 @@
import styled from "styled-components";
import { Link } from 'react-router-dom'


export const Container = styled.div`
width: 100%;
height: 100vh;
display: grid;
grid-template-columns: 250px auto;
grid-template-rows: 105px 128px auto 64px;
grid-template-areas:
"brand header"
"menu search"
"menu content"
"newnote content";
background-color: ${({ theme }) => theme.COLORS.BACKGROUND_800};
`
export const Brand = styled.div`
grid-area: brand;
display: flex;
justify-content: center;
align-items: center;
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: ${({ theme }) => theme.COLORS.BACKGROUND_700};
background-color: ${({ theme }) => theme.COLORS.BACKGROUND_900};
> h1 {
font-size: 24px;
color: ${({ theme }) => theme.COLORS.ORANGE};
}
`
export const Menu = styled.ul`
grid-area: menu;
background-color: ${({ theme }) => theme.COLORS.BACKGROUND_900};
padding-top:64px;
text-align: center;
>li{
margin-bottom:24px;
}
`
export const Search = styled.div`
grid-area: search;
padding: 64px 64px 0 ;
`
export const Content = styled.div`
grid-area: content;
padding: 0 64px ;
overflow-y:auto;
`
export const NewNote = styled(Link)`
grid-area: newnote;
background: ${({ theme }) => theme.COLORS.ORANGE};
border: none;
display: flex;
align-items: center;
justify-content: center;
svg{
margin-right:8px;
}
`
import styled from "styled-components";
import { Link } from 'react-router-dom'


export const Container = styled.div`
width: 100%;
height: 100vh;
display: grid;
grid-template-columns: 250px auto;
grid-template-rows: 105px 128px auto 64px;
grid-template-areas:
"brand header"
"menu search"
"menu content"
"newnote content";
background-color: ${({ theme }) => theme.COLORS.BACKGROUND_800};
`
export const Brand = styled.div`
grid-area: brand;
display: flex;
justify-content: center;
align-items: center;
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: ${({ theme }) => theme.COLORS.BACKGROUND_700};
background-color: ${({ theme }) => theme.COLORS.BACKGROUND_900};
> h1 {
font-size: 24px;
color: ${({ theme }) => theme.COLORS.ORANGE};
}
`
export const Menu = styled.ul`
grid-area: menu;
background-color: ${({ theme }) => theme.COLORS.BACKGROUND_900};
padding-top:64px;
text-align: center;
>li{
margin-bottom:24px;
}
`
export const Search = styled.div`
grid-area: search;
padding: 64px 64px 0 ;
`
export const Content = styled.div`
grid-area: content;
padding: 0 64px ;
overflow-y:auto;
`
export const NewNote = styled(Link)`
grid-area: newnote;
background: ${({ theme }) => theme.COLORS.ORANGE};
border: none;
display: flex;
align-items: center;
justify-content: center;
text-decoration: none; /* Remove sublinhado */
color: ${({ theme }) => theme.COLORS.BACKGROUND_900};
svg{
margin-right:8px;
}
`

0 comments on commit fa55e4a

Please sign in to comment.