-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Improve FontAwesome icons for goruped actions - Add icon to the log for grouped actions - Version 0.10.2 - Add FontAwesome - Add custom icon support to recipes/common actions - Add icons to Common Actions/recipes tab
- Loading branch information
1 parent
8c5c32a
commit 549b56d
Showing
24 changed files
with
2,119 additions
and
488 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
CODACY_PROJECT_TOKEN=your-codacy-project-token | ||
CODACY_PROJECT_TOKEN=your-codacy-project-token | ||
FONTAWESOME_KEY=your-fontawesome-key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
echo "@fortawesome:registry=https://npm.fontawesome.com/ | ||
@awesome.me:registry=https://npm.fontawesome.com/ | ||
//npm.fontawesome.com/:_authToken=$FONTAWESOME_KEY" > .npmrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import React, { CSSProperties, FC, memo, RefObject, useEffect, useState } from 'react'; | ||
import TabTitle from '@/components/TabTitle'; | ||
import { Recipes } from '@/components/Recipes'; | ||
import { FixedSizeList } from 'react-window'; | ||
import { RecipeCard } from '@/components/RecipeCard'; | ||
|
||
interface RecipesProps { | ||
viewBoxRef: RefObject<HTMLDivElement>; | ||
} | ||
|
||
export const RecipesList: FC<RecipesProps> = ({ viewBoxRef }) => { | ||
const [listHeight, setListHeight] = useState<number>( | ||
viewBoxRef.current?.getBoundingClientRect().height ?? 0 | ||
); | ||
const [listWidth, setListWidth] = useState<number>( | ||
viewBoxRef.current?.getBoundingClientRect().width ?? 0 | ||
); | ||
const MemoizedRecipeCard = memo(RecipeCard); | ||
|
||
useEffect(() => { | ||
const handleResize = () => { | ||
const viewBoxBound = viewBoxRef.current?.getBoundingClientRect(); | ||
const viewBoxHeight = viewBoxBound?.height ?? 0; | ||
const viewBoxWidth = viewBoxBound?.width ?? 0; | ||
setListHeight(viewBoxHeight); | ||
setListWidth(viewBoxWidth); | ||
}; | ||
|
||
window.addEventListener('resize', handleResize); | ||
handleResize(); // Set initial height | ||
|
||
return () => { | ||
window.removeEventListener('resize', handleResize); | ||
}; | ||
}, [viewBoxRef]); | ||
|
||
const recipesArray = Object.entries(Recipes); | ||
|
||
const Row = ({ index, style }: { index: number; style: CSSProperties }) => ( | ||
<div style={style}> | ||
<MemoizedRecipeCard recipeKey={recipesArray[index][0]} recipe={recipesArray[index][1]} /> | ||
</div> | ||
); | ||
|
||
return ( | ||
<> | ||
<TabTitle>Common Actions</TabTitle> | ||
<FixedSizeList | ||
height={listHeight} | ||
width={listWidth} | ||
itemCount={recipesArray.length} | ||
itemSize={28} | ||
style={{ width: '100%' }} | ||
> | ||
{Row} | ||
</FixedSizeList> | ||
</> | ||
); | ||
}; |
Oops, something went wrong.