-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(project): layout and miragejs implementation
- Loading branch information
Lucas Eduardo
committed
Nov 21, 2020
1 parent
c4a26ef
commit c214e31
Showing
39 changed files
with
1,514 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Container, Header, Main, Footer } from './styles'; | ||
|
||
const Layout: React.FC = ({ children }) => ( | ||
<Container> | ||
<Header /> | ||
|
||
<Main>{children}</Main> | ||
|
||
<Footer /> | ||
</Container> | ||
); | ||
|
||
export { Layout }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const Container = styled.div` | ||
display: grid; | ||
width: 100%; | ||
height: 100%; | ||
grid-template-columns: 1fr; | ||
grid-template-rows: 8rem auto 4rem; | ||
grid-template-areas: | ||
'HEADER' | ||
'MAIN' | ||
'FOOTER'; | ||
`; | ||
|
||
export const Header = styled.div` | ||
display: flex; | ||
grid-area: HEADER; | ||
background-color: #3c3845; | ||
box-shadow: -1rem -0.7rem 1.4rem #3778cd; | ||
`; | ||
|
||
export const Main = styled.div` | ||
grid-area: MAIN; | ||
width: 100%; | ||
max-width: 1150rem; | ||
min-width: 100vw; | ||
padding: 2rem 4rem; | ||
`; | ||
|
||
export const Footer = styled.div` | ||
display: flex; | ||
grid-area: FOOTER; | ||
background-color: #3c3845; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
declare module 'miragejs' { | ||
function createServer(obj: any): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { IconType } from 'react-icons'; | ||
|
||
export interface IButtonActionProps { | ||
Icon?: IconType; | ||
text: string; | ||
callback: () => void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { IButtonActionProps } from './IButtonAction'; | ||
|
||
import { Container } from './styles'; | ||
|
||
const ButtonAction = ({ Icon, text, callback }: IButtonActionProps) => { | ||
return ( | ||
<Container onClick={callback}> | ||
{Icon && <Icon />} <span>{text}</span> | ||
</Container> | ||
); | ||
}; | ||
|
||
export { ButtonAction }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import styled from 'styled-components'; | ||
import { shade } from 'polished'; | ||
|
||
const buttonColor = '#3778cd'; | ||
|
||
export const Container = styled.button` | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
width: 100%; | ||
max-width: 250px; | ||
height: 60px; | ||
background-color: ${buttonColor}; | ||
border-radius: 0.4rem; | ||
border: 0; | ||
transition: background-color 0.2s ease-in-out; | ||
cursor: pointer; | ||
svg { | ||
margin-right: 1rem; | ||
width: 2.5rem; | ||
height: 2.5rem; | ||
color: #fff; | ||
} | ||
span { | ||
font-size: 2.2rem; | ||
color: #fff; | ||
} | ||
&:hover { | ||
background-color: ${shade(0.2, buttonColor)}; | ||
} | ||
@media (max-width: 768px) { | ||
span { | ||
font-size: 1.8rem; | ||
} | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export interface IContainerProps { | ||
isError: boolean; | ||
} | ||
|
||
export default interface IInput | ||
extends React.InputHTMLAttributes<HTMLInputElement> { | ||
isError?: boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react'; | ||
|
||
import IInput from './IInput'; | ||
|
||
import { Container } from './styles'; | ||
|
||
const Input = ({ isError = false, ...rest }: IInput) => { | ||
return ( | ||
<Container isError={isError}> | ||
<input {...rest} /> | ||
</Container> | ||
); | ||
}; | ||
|
||
export { Input }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import styled from 'styled-components'; | ||
|
||
import { IContainerProps } from './IInput'; | ||
|
||
export const Container = styled.div<IContainerProps>` | ||
width: 100%; | ||
height: 40px; | ||
background-color: transparent; | ||
border-bottom: 2px solid | ||
${({ isError }) => | ||
isError ? 'rgba(255, 0, 0, 0.6)' : 'rgba(0, 0, 0, 0.6)'}; | ||
input { | ||
width: 100%; | ||
height: 100%; | ||
background-color: transparent; | ||
border: none; | ||
color: rgba(0, 0, 0, 0.6); | ||
&::placeholder { | ||
font-size: 1.2rem; | ||
transition: font-size 0.2s ease-in; | ||
} | ||
&:focus::placeholder { | ||
font-size: 1.6rem; | ||
} | ||
&:disabled { | ||
color: rgba(0, 0, 0, 0.3); | ||
&::placeholder { | ||
color: rgba(0, 0, 0, 0.3); | ||
} | ||
} | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
export interface IContainerProps { | ||
isStriped?: boolean; | ||
isBordered?: boolean; | ||
isHovered?: boolean; | ||
isSmall?: boolean; | ||
} | ||
|
||
export interface ITHeadProps { | ||
isBordered?: boolean; | ||
isSmall?: boolean; | ||
} | ||
|
||
export interface ITBodyProps { | ||
isStriped?: boolean; | ||
isBordered?: boolean; | ||
isHovered?: boolean; | ||
isSmall?: boolean; | ||
} | ||
|
||
export interface ITableProps { | ||
columns: { | ||
label: string; | ||
row: string; | ||
}[]; | ||
rows: any[]; | ||
isStriped?: boolean; | ||
isBordered?: boolean; | ||
isHovered?: boolean; | ||
isSmall?: boolean; | ||
} |
Oops, something went wrong.