Skip to content

Commit 997bb8d

Browse files
committed
Merge remote-tracking branch 'origin/main' into Add-a-Landing-Page-#10
2 parents c3e2c08 + 2e94e37 commit 997bb8d

4 files changed

Lines changed: 18 additions & 4 deletions

File tree

components/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ export {default as CopyShapeSource} from "./core/CopyShapeSource";
88
// utils
99
export { default as Header } from "./utils/Header";
1010
export { default as ShapeList } from './utils/ShapeList';
11-
export { default as Radios } from './utils/Radios';
11+
export { default as Radios } from './utils/Radios';
12+
export { default as NoShapeFound } from './utils/NoShapeFound';

components/utils/Header.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ const Header = ({
170170
value={searchTerm}
171171
onChange={(e) => setSearchTerm(e.target.value)}
172172
/>
173-
<CloseIcon title="Clear Search Query" color='#ffffff' size='24px' onClick={() => setSearchTerm('')}/>
173+
{searchTerm && <CloseIcon title="Clear Search Query" color='#ffffff' size='24px' onClick={() => setSearchTerm('')}/>}
174174
</NavbarSearchInput>
175175
<DropdownButton variant="outline-secondary" size="sm" id="dropdown-basic-button" title={`Sort by ${sort}`} className="border-0">
176176
<Dropdown.Item

components/utils/NoShapeFound.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import React from 'react';
2+
3+
const NoShapeFound = () => {
4+
5+
return(
6+
<h1>No Shape Found!</h1>
7+
)
8+
};
9+
10+
export default NoShapeFound;

components/utils/ShapeList.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import { BiExport } from "react-icons/bi";
2828
import { BsFillHeartFill, BsHeart} from "react-icons/bs";
2929

3030
// Export Shape
31-
import { ExportShape, CopyShapeSource } from '..';
31+
import { ExportShape, CopyShapeSource, NoShapeFound } from '..';
3232

3333
// misc unitless
3434
import { getShapeFileName, getShapeId } from '../../utils/misc';
@@ -347,6 +347,8 @@ const ShapeList = (
347347
}
348348
};
349349

350+
351+
350352
return (
351353
<ShapeCardsContainer>
352354
<Container>
@@ -362,7 +364,8 @@ const ShapeList = (
362364
shape= { shapeToSourceCopy } />
363365
}
364366

365-
{filteredShape.map((shape, index) => (
367+
{
368+
filteredShape.length === 0 ? <NoShapeFound /> : filteredShape.map((shape, index) => (
366369
<React.Fragment key={index}>
367370
<ShapeCard>
368371
<ShapeCardBody>

0 commit comments

Comments
 (0)