Skip to content

Commit

Permalink
project file
Browse files Browse the repository at this point in the history
  • Loading branch information
eltonlazzarin committed Dec 31, 2019
1 parent 5028ae1 commit e3af0dc
Show file tree
Hide file tree
Showing 10 changed files with 204 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';

import Routes from './routes'
import GlobalStyle from './styles/global'

function App() {
return (
<>
<Routes />
<GlobalStyle />
</>
);
}

export default App;
Binary file added src/assets/footerLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/widget.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';

ReactDOM.render(<App />, document.getElementById('root'));

47 changes: 47 additions & 0 deletions src/pages/Main/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import React, { useState, useEffect } from 'react';

import logo from '../../assets/footerLogo.png';
import api from '../../services/api';

import { Container } from './styles';

export default function Main() {
const [data, setData] = useState([]);


useEffect(() => {
async function fecthData() {
const result = await api.get('/oportunidades.json');

setData(result.data);
}

fecthData();

}, []);

return (
<Container>
<header>
<h3>Vagas: Trampo.co & Lorem Ipsum SID</h3>
</header>
<ul>

{data.map(trampo => (
<a href={trampo.opportunity.permalink} target="_blank" rel="noopener noreferrer">
<li key={trampo.opportunity.id}>
<div>
<h3>{trampo.opportunity.name}</h3>
<p>{trampo.opportunity.company_name}</p>
</div>
</li>
</a>
))}

</ul>
<footer>
<img src={logo} alt="Logo Footer" />
</footer>
</Container>
);
}
91 changes: 91 additions & 0 deletions src/pages/Main/styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
import styled from 'styled-components';

export const Container = styled.div`
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 100vw;
height: 100vh;
header {
display: flex;
flex-direction: column;
justify-content: center;
width: 413px;
height: 55px;
background-color: #241f1d;
text-indent: 24px;
color: #fff;
h3 {
margin-left: 6px;
font-size: 15px;
text-transform: uppercase;
}
}
ul {
list-style: none;
height: 220px;
overflow-x: hidden;
overflow-y: scroll;
::-webkit-scrollbar-track {
background: #55504d;
}
::-webkit-scrollbar {
width: 6px;
background: #dcdcdc;
}
::-webkit-scrollbar-thumb {
background: #dcdcdc;
}
}
li {
display: flex;
flex-direction: column;
justify-content: center;
text-transform: uppercase;
color: #fff;
width: 407px;
height: 55px;
background: #2b2623;
border-left: 6px solid #dfc125;
border-bottom: 1px solid #38322f;
&:hover {
background: #38322f;
}
}
div {
margin-left: 24px;
}
a {
text-decoration: none;
h2 {
font-size: 16px;
}
p {
font-size: 10px;
}
}
footer {
width: 413px;
height: 52px;
background: #241f1d;
text-indent: 24px;
img {
margin-top: 12px;
}
}
`;
14 changes: 14 additions & 0 deletions src/routes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react'
import { BrowserRouter, Switch, Route } from 'react-router-dom'

import Main from './pages/Main'

export default function Routes() {
return (
<BrowserRouter>
<Switch>
<Route path='/' exact component={Main} />
</Switch>
</BrowserRouter>
)
}
Binary file added src/screenshot/widgetPage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src/services/api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import axios from 'axios';

const api = axios.create({
baseURL: 'http://trampos.co/api',
})

export default api;
24 changes: 24 additions & 0 deletions src/styles/global.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { createGlobalStyle } from 'styled-components';

export default createGlobalStyle`
* {
margin: 0;
padding: 0;
outline: 0;
box-sizing: border-box;
}
html, body, #root {
min-height: 100%;
}
body {
background: #fff;
-webkit-font-smoothing: antialiased !important;
}
body, input, button {
font-size: 14px;
font-family: "MS Sans Serif";
}
button {
cursor: pointer;
}
`;

0 comments on commit e3af0dc

Please sign in to comment.