Fix tags - Make them scrollable

This commit is contained in:
2018-11-18 21:51:50 +05:30
parent ce47398bed
commit 2e88121020
6 changed files with 37 additions and 33 deletions
-10
View File
@@ -1,10 +0,0 @@
.categories-wrapper {
width: 100%;
overflow: auto;
}
.categories-inner {
/* width: auto; */
display: inline-flex;
flex-direction: row;
}
+2 -2
View File
@@ -5,8 +5,8 @@ import './categories.css';
function Categories(props) { function Categories(props) {
return ( return (
` `
<div class="categories-wrapper"> <div class="swipable-outer">
<div class="categories-inner"> <div class="swipable-inner">
${ ${
props.categories.map((category) => ( props.categories.map((category) => (
CategoryCard({ CategoryCard({
+9 -7
View File
@@ -14,9 +14,10 @@
} }
.recipe-card-bottom { .recipe-card-bottom {
padding: 8px; margin: 8px;
padding-right: 16px; padding-right: 8px;
height: 120px; height: calc(120px - 16px);
width: calc(100% - 16px);
} }
.recipe-card-image { .recipe-card-image {
@@ -39,7 +40,7 @@
} }
.recipe-card-logo-wrapper { .recipe-card-logo-wrapper {
width: 25%; width: 60px;
height: 100%; height: 100%;
} }
@@ -77,15 +78,16 @@
} }
.recipe-card-tags { .recipe-card-tags {
width: 100%;
display: inline-flex; display: inline-flex;
flex-direction: row; flex-direction: row;
height: 40px; height: 40%;
} }
.recipe-card-tag { .recipe-card-tag {
margin: 0 16px; margin: 4px;
margin-top: 4px;
padding: 4px 8px; padding: 4px 8px;
width: max-content;
border-radius: 4px; border-radius: 4px;
background-color: darkgray; background-color: darkgray;
} }
+3 -2
View File
@@ -48,7 +48,8 @@ export default function RecipeCard(props) {
</div> </div>
</div> </div>
</div> </div>
<div class="recipe-card-tags"> <div class="recipe-card-tags swipable-outer">
<div class="swipable-inner">
${ ${
props.recipe.tags.map(tag => ( props.recipe.tags.map(tag => (
` `
@@ -60,7 +61,7 @@ export default function RecipeCard(props) {
` `
)).join('') )).join('')
} }
</div>
</div> </div>
</div> </div>
</div> </div>
+11
View File
@@ -12,3 +12,14 @@ code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace; monospace;
} }
.swipable-outer {
width: 100%;
overflow: auto;
}
.swipable-inner {
/* width: auto; */
display: inline-flex;
flex-direction: row;
}
+1 -1
View File
@@ -1,5 +1,5 @@
import './index.css';
import App from './App'; import App from './App';
import './index.css';
window.addEventListener("load", function () { window.addEventListener("load", function () {
const app = new App(); const app = new App();