Skip to content

Commit

Permalink
Add badge to new champion
Browse files Browse the repository at this point in the history
  • Loading branch information
kristiandrex committed Jul 23, 2021
1 parent 147e89f commit 48b6d9e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "league-of-react",
"version": "3.1.2",
"version": "3.2.0",
"private": true,
"dependencies": {
"@actions/core": "^1.4.0",
Expand Down
1 change: 1 addition & 0 deletions src/components/Thumbnail.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ function Thumbnail({ champion }) {
<div className="thumbnail">
<Link href={`/champions/${champion.id}`}>
<a>
{champion.new && <span className="badge">NUEVO</span>}
<Image
src={`https://ddragon.leagueoflegends.com/cdn/${champion.version}/img/champion/${champion.image.full}`}
alt={champion.name}
Expand Down
1 change: 1 addition & 0 deletions src/pages/champions/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ function Champion({ champion }) {
<span className="title">{champion.title}</span>
</div>
<div className="images">
{champion.new && <span className="badge">NUEVO</span>}
<img
src={`http://ddragon.leagueoflegends.com/cdn/img/champion/loading/${champion.id}_0.jpg`}
alt={champion.name}
Expand Down
11 changes: 11 additions & 0 deletions src/styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ svg {
width: 24px;
}

.badge {
background-color: var(--YELLOW);
font-weight: bold;
padding: 0.25rem 0.5rem;
font-size: 0.85rem;
border-radius: 0.5rem 0 0 0;
position: absolute;
z-index: 1;
}

nav {
align-items: center;
background-color: var(--YELLOW);
Expand Down Expand Up @@ -116,6 +126,7 @@ main .grid {
cursor: pointer;
overflow: hidden;
text-align: center;
position: relative;
}

.thumbnail img {
Expand Down

0 comments on commit 48b6d9e

Please sign in to comment.