Skip to content

Commit

Permalink
feature: add working light theme to itemtile
Browse files Browse the repository at this point in the history
* feature: add working light theme to ItemTile

* fix: responsive of the component
  • Loading branch information
TheWoxPL authored Jan 22, 2024
1 parent c9f112d commit c7b8182
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
15 changes: 12 additions & 3 deletions src/components/ItemTile/ItemTile.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import { graphql, useStaticQuery } from 'gatsby';
import { GatsbyImage, getImage } from 'gatsby-plugin-image';
import PropTypes from 'prop-types';
import React from 'react';
import React, { useContext } from 'react';

import { container, content, image, text, title } from './ItemTile.module.scss';
import { ThemeContext } from '../../context/ThemeContex';
import {
container,
content,
darkContainer,
image,
text,
title,
} from './ItemTile.module.scss';

export const ItemTile = ({
itemTitle,
Expand Down Expand Up @@ -39,9 +47,10 @@ export const ItemTile = ({
);

const imageSrc = getImage(matchedImage);
const { theme } = useContext(ThemeContext);

return (
<div className={container}>
<div className={theme(container, darkContainer)}>
<GatsbyImage image={imageSrc} alt={itemImageAlt} className={image} />
<div className={content}>
<div className={title}>{itemTitle}</div>
Expand Down
21 changes: 16 additions & 5 deletions src/components/ItemTile/ItemTile.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,32 @@

.container {
display: flex;
width: 374px;
max-width: 374px;
opacity: 0.9;
background-color: $black_100_35;
background-color: $white_100_35;
border-radius: 10px;
flex-direction: column;
align-items: center;
margin: 0px 8px;
}
.image {
margin: 4px 4px 0px 4px;
width: 366px;
max-width: 366px;
height: 245px;
border-radius: 10px 10px 0px 0px;
-webkit-box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
-moz-box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
}
.content {
width: 326px;
align-self: flex-start;
max-width: 326px;
height: 219px;
overflow-y: hidden;
color: $white;
color: $black;
padding: 0px 24px;
margin-bottom: 32px;
box-sizing: content-box;
}
.title {
font-size: 20px;
Expand All @@ -37,3 +41,10 @@
line-height: 19.36px;
margin-top: 15px;
}
.darkContainer {
background-color: $black_100_35;

.content {
color: $white;
}
}

0 comments on commit c7b8182

Please sign in to comment.