generated from glrodasz/semana-template
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PR Week 6 #33
Open
EzequielCaste
wants to merge
1
commit into
undefined-academy:main
Choose a base branch
from
EzequielCaste:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
PR Week 6 #33
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module.exports = { | ||
env: { browser: true, es2020: true }, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:react/recommended', | ||
'plugin:react/jsx-runtime', | ||
'plugin:react-hooks/recommended', | ||
], | ||
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' }, | ||
settings: { react: { version: '18.2' } }, | ||
plugins: ['react-refresh'], | ||
rules: { | ||
'react-refresh/only-export-components': 'warn', | ||
}, | ||
} |
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,24 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
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,19 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link rel="preconnect" href="https://fonts.googleapis.com" /> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> | ||
<link | ||
href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;700&display=swap" | ||
rel="stylesheet" | ||
/> | ||
<title>Blog | Ezequiel Castellanos</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.jsx"></script> | ||
</body> | ||
</html> |
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,29 @@ | ||
{ | ||
"name": "blog", | ||
"private": true, | ||
"version": "0.0.0", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite", | ||
"sass": "sass main.scss main.css --watch", | ||
"build": "vite build", | ||
"lint": "eslint src --ext js,jsx --report-unused-disable-directives --max-warnings 0", | ||
"preview": "vite preview" | ||
}, | ||
"dependencies": { | ||
"dayjs": "^1.11.8", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"sass": "^1.62.1" | ||
}, | ||
"devDependencies": { | ||
"@types/react": "^18.0.37", | ||
"@types/react-dom": "^18.0.11", | ||
"@vitejs/plugin-react": "^4.0.0", | ||
"eslint": "^8.38.0", | ||
"eslint-plugin-react": "^7.32.2", | ||
"eslint-plugin-react-hooks": "^4.6.0", | ||
"eslint-plugin-react-refresh": "^0.3.4", | ||
"vite": "^4.3.9" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,25 @@ | ||
import Header from './components/Header'; | ||
import Card from './components/Card'; | ||
import {cardData as data} from './data.js'; | ||
import Footer from './components/Footer'; | ||
import sortByDate from './utils/sortByDate'; | ||
|
||
function App() { | ||
return ( | ||
<div className="container"> | ||
<Header /> | ||
|
||
<div className="card-container"> | ||
{ | ||
data.sort(sortByDate).map((cardData) => | ||
<Card key={cardData.date} data={cardData} /> | ||
) | ||
} | ||
</div> | ||
|
||
<Footer /> | ||
</div> | ||
) | ||
} | ||
|
||
export default App |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions
12
react-blogs/EzequielCaste-9004/src/components/Card/card.styles.scss
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,12 @@ | ||
@use '../../styles/variables.scss'; | ||
.card { | ||
display: flex; | ||
flex-direction: column; | ||
border: 1px solid variables.$grayChateau; | ||
} | ||
.card-title { | ||
margin-bottom: 0.5em; | ||
} | ||
.card-body { | ||
padding: 1em; | ||
} |
28 changes: 28 additions & 0 deletions
28
react-blogs/EzequielCaste-9004/src/components/Card/index.jsx
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,28 @@ | ||
import PropTypes from 'prop-types'; | ||
import './card.styles.scss'; | ||
import { capitalize, humanize } from '../../utils/humanizeDate'; | ||
|
||
const Card = ({ data }) => { | ||
const { title, date, text } = data; | ||
const humanizeDate = capitalize(humanize(date)); | ||
return ( | ||
<div className="card"> | ||
<img src="https://placehold.co/150x150" alt="blog post card" /> | ||
<div className="card-body"> | ||
<h2 className="card-title">{title}</h2> | ||
<time dateTime={date}> | ||
<span>{humanizeDate}</span> | ||
</time> | ||
<p className="card-text"> | ||
{text} | ||
</p> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
Card.propTypes = { | ||
data: PropTypes.object | ||
} | ||
|
||
export default Card |
5 changes: 5 additions & 0 deletions
5
react-blogs/EzequielCaste-9004/src/components/Footer/footer.styles.scss
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,5 @@ | ||
@use '../../styles/variables.scss'; | ||
|
||
footer { | ||
border: 1px solid variables.$grayChateau; | ||
} |
11 changes: 11 additions & 0 deletions
11
react-blogs/EzequielCaste-9004/src/components/Footer/index.jsx
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,11 @@ | ||
import './footer.styles.scss'; | ||
|
||
const Footer = () => { | ||
return ( | ||
<footer> | ||
THE FOOTER | ||
</footer> | ||
) | ||
} | ||
|
||
export default Footer |
86 changes: 86 additions & 0 deletions
86
react-blogs/EzequielCaste-9004/src/components/Header/header.styles.scss
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,86 @@ | ||
@use '../../styles/variables.scss'; | ||
|
||
header { | ||
padding: 2.5em 0; | ||
text-align: center; | ||
background-color: variables.$ghostWhite; | ||
} | ||
.col { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
.nav-toggle { | ||
cursor: pointer; | ||
border-radius: 50%; | ||
border: 0; | ||
width: 40px; | ||
height: 40px; | ||
padding: 0; | ||
position: absolute; | ||
left: 0; | ||
top: 20px; | ||
background-color: variables.$teaPapaGreen; | ||
} | ||
.hamburger { | ||
width: 50%; | ||
position: relative; | ||
} | ||
.hamburger, .hamburger::after, | ||
.hamburger::before { | ||
display: block; | ||
margin: 0 auto; | ||
height: 3px; | ||
background-color: white; | ||
} | ||
|
||
.hamburger::before { | ||
transform: translateY(-6px); | ||
} | ||
.hamburger::after { | ||
transform: translateY(3px); | ||
} | ||
|
||
.hamburger::after, | ||
.hamburger::before { | ||
content: ''; | ||
width: 100%; | ||
} | ||
|
||
.nav { | ||
display: none; | ||
} | ||
|
||
.nav--visible { | ||
display: flex; | ||
} | ||
|
||
.navigation-links { | ||
list-style: none; | ||
width: 100%; | ||
font-size: 0.75em; | ||
align-items: center; | ||
} | ||
|
||
.search-container { | ||
margin: 8px auto 0 auto; | ||
margin-top: 8px; | ||
position: relative; | ||
width: fit-content; | ||
} | ||
.search-container svg { | ||
position: absolute; | ||
top: 5px; | ||
left: 5px; | ||
width: 20px; | ||
height: 20px; | ||
stroke: variables.$teaPapaGreen; | ||
} | ||
.search { | ||
outline: none; | ||
border: 0; | ||
background-color: variables.$gullGray; | ||
padding: 0.5em; | ||
color: variables.$teaPapaGreen; | ||
border-radius: 3px; | ||
padding-left: 30px; | ||
} |
52 changes: 52 additions & 0 deletions
52
react-blogs/EzequielCaste-9004/src/components/Header/index.jsx
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,52 @@ | ||
import { useState } from 'react' | ||
import './header.styles.scss' | ||
|
||
const Header = () => { | ||
const [showMenu, setShowMenu] = useState(false); | ||
|
||
const toggleMenu = () => setShowMenu(!showMenu); | ||
|
||
return ( | ||
<header> | ||
<nav> | ||
<button | ||
onClick={toggleMenu} | ||
className={`nav-toggle ${showMenu ? 'hamburger--visible' : ''}`} | ||
> | ||
<span className="hamburger"></span> | ||
</button> | ||
<div className={`nav col ${showMenu ? 'nav--visible' : ''}`}> | ||
<ul className="navigation-links"> | ||
<li>Todos</li> | ||
<li>HTML</li> | ||
<li>CSS</li> | ||
<li>JavaScript</li> | ||
<li>Web components</li> | ||
<li>Sistema de diseño</li> | ||
</ul> | ||
<div className="search-container"> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
className="icon icon-tabler icon-tabler-search" | ||
width="44" | ||
height="44" | ||
viewBox="0 0 24 24" | ||
strokeWidth="1.5" | ||
stroke="#2c3e50" | ||
fill="none" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
> | ||
<path stroke="none" d="M0 0h24v24H0z" fill="none" /> | ||
<circle cx="10" cy="10" r="7" /> | ||
<line x1="21" y1="21" x2="15" y2="15" /> | ||
</svg> | ||
<input className="search" placeholder="Buscar" type="text" /> | ||
</div> | ||
</div> | ||
</nav> | ||
</header> | ||
) | ||
} | ||
|
||
export default Header |
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,51 @@ | ||
export const cardData = [ | ||
{ | ||
title: "lorem Ipsum", | ||
date: '01-01-2021', | ||
text: `Lorem, ipsum dolor sit amet consectetur adipisicing elit. Ab, | ||
doloremque. Ab voluptatum labore quos expedita facilis provident | ||
sint deleniti voluptates!` | ||
}, | ||
{ | ||
title: "lorem Ipsum", | ||
date: '02-02-2022', | ||
text: `Lorem, ipsum dolor sit amet consectetur adipisicing elit. Ab, | ||
doloremque. Ab voluptatum labore quos expedita facilis provident | ||
sint deleniti voluptates!` | ||
}, | ||
{ | ||
title: "lorem Ipsum", | ||
date: '03-03-2023', | ||
text: `Lorem, ipsum dolor sit amet consectetur adipisicing elit. Ab, | ||
doloremque. Ab voluptatum labore quos expedita facilis provident | ||
sint deleniti voluptates!` | ||
}, | ||
{ | ||
title: "lorem Ipsum", | ||
date: '04-20-2023', | ||
text: `Lorem, ipsum dolor sit amet consectetur adipisicing elit. Ab, | ||
doloremque. Ab voluptatum labore quos expedita facilis provident | ||
sint deleniti voluptates!` | ||
}, | ||
{ | ||
title: "lorem Ipsum", | ||
date: '05-30-2023', | ||
text: `Lorem, ipsum dolor sit amet consectetur adipisicing elit. Ab, | ||
doloremque. Ab voluptatum labore quos expedita facilis provident | ||
sint deleniti voluptates!` | ||
}, | ||
{ | ||
title: "lorem Ipsum", | ||
date: '05-20-2023', | ||
text: `Lorem, ipsum dolor sit amet consectetur adipisicing elit. Ab, | ||
doloremque. Ab voluptatum labore quos expedita facilis provident | ||
sint deleniti voluptates!` | ||
}, | ||
{ | ||
title: "lorem Ipsum", | ||
date: '01-01-2023', | ||
text: `Lorem, ipsum dolor sit amet consectetur adipisicing elit. Ab, | ||
doloremque. Ab voluptatum labore quos expedita facilis provident | ||
sint deleniti voluptates!` | ||
}, | ||
] |
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,10 @@ | ||
import React from 'react' | ||
import ReactDOM from 'react-dom/client' | ||
import App from './App.jsx' | ||
import './main.scss' | ||
|
||
ReactDOM.createRoot(document.getElementById('root')).render( | ||
<React.StrictMode> | ||
<App /> | ||
</React.StrictMode>, | ||
) |
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,4 @@ | ||
@use "./src/styles/base.scss"; | ||
@use "./src/styles/desktop.scss"; | ||
@use "./src/styles/variables.scss"; | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No creo que sea buena idea usar la fecha como key para la card, puede que haya entradas que tengan el mismo dia, mejor lo veo usar el index