Skip to content

Commit

Permalink
Merge pull request #560 from evershopcommerce/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
treoden authored Jun 6, 2024
2 parents 195616e + 80d3ec7 commit f48a879
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 39 deletions.
2 changes: 1 addition & 1 deletion packages/azure_file_storage/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@evershop/azure_file_storage",
"version": "1.0.0",
"version": "1.1.0",
"description": "An extension for EverShop to use Azure File Storage",
"repository": {
"type": "git",
Expand Down
11 changes: 7 additions & 4 deletions packages/evershop/bin/lib/onListening.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
const boxen = require('boxen');
const { success } = require('@evershop/evershop/src/lib/log/logger');
const { green } = require('kleur');
const normalizePort = require('./normalizePort');

const port = normalizePort();
/**
* Event listener for HTTP server "listening" event.
*/
module.exports = function onListening() {
success(
boxen(`Your website is running at "http://localhost:${port}"`, {
const message = boxen(
`Your website is running at "http://localhost:${port}"`,
{
title: 'EverShop',
titleAlignment: 'center',
padding: 1,
margin: 1,
borderColor: 'green'
})
}
);
// eslint-disable-next-line no-console
console.log(green(message));
};
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,7 @@ function CategoryItem({ category, selectedCategory, setSelectedCategory }) {
const { data, fetching, error } = result;

if (error) {
return (
<p>
Oh no...
{error.message}
</p>
);
return <p className="text-critical">{error.message}</p>;
}
return (
<li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,29 @@ function CategoryTree({ selectedCategory, setSelectedCategory }) {
const { data, fetching, error } = result;

if (fetching) {
return <Spinner width={30} height={30} />;
return (
<div className="category-tree-container absolute top-5 left-0 right-0 border rounded">
<Spinner width={30} height={30} />
</div>
);
}
if (error) {
return (
<p>
Oh no...
{error.message}
</p>
<div className="category-tree-container absolute top-5 left-0 right-0 border rounded">
<p className="text-critical">{error.message}</p>
</div>
);
}
if (data.categories.items.length === 0) {
return <div>There is no category</div>;
return (
<div className="category-tree-container absolute top-5 left-0 right-0 border rounded">
<div>There is no category</div>
</div>
);
}

return (
<div>
<div className="category-tree-container absolute top-5 left-0 right-0 border rounded">
<ul className="category-tree">
{data.categories.items.map((category) => (
<CategoryItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,14 @@
ul {
margin-left: 20px;
}
}
.category-tree-container {
background-color: #fff;
z-index: 100;
border-color: #c9cccf;
padding:10px;
box-sizing: border-box;
max-height: 250px;
overflow-y: auto;
overflow-x: hidden;
}
1 change: 1 addition & 0 deletions packages/evershop/src/components/common/modal/Alert.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
max-height: calc(100vh - 4rem);
.modal {
max-height: calc(100vh - 4rem);
overflow-y: auto;
}
.modal-content {
max-height: calc(100vh - 18rem);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,16 @@ function ParentCategory({ currentId, parent }) {
</a>
)}
{selecting && (
<div className="absolute top-5 left-0 right-0 bg-[#eff2f5] z-50 border rounded border-[#c9cccf] p-[10px]">
<CategoryTree
selectedCategory={category}
setSelectedCategory={(c) => {
if (c.categoryId === currentId) {
return;
}
setCategory(c);
setSelecting(false);
}}
/>
</div>
<CategoryTree
selectedCategory={category}
setSelectedCategory={(c) => {
if (c.categoryId === currentId) {
return;
}
setCategory(c);
setSelecting(false);
}}
/>
)}
<input
type="hidden"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,13 @@ function Category({ product }) {
</a>
)}
{selecting && (
<div className="absolute top-5 left-0 right-0 bg-[#eff2f5] z-50 border rounded border-[#c9cccf] p-[10px]">
<CategoryTree
selectedCategory={category}
setSelectedCategory={(cat) => {
setCategory(cat);
setSelecting(false);
}}
/>
</div>
<CategoryTree
selectedCategory={category}
setSelectedCategory={(cat) => {
setCategory(cat);
setSelecting(false);
}}
/>
)}
{category && (
<input type="hidden" name="category_id" value={category?.categoryId} />
Expand Down

0 comments on commit f48a879

Please sign in to comment.