Skip to content

Commit

Permalink
closes issue dhruvpatidar359#61
Browse files Browse the repository at this point in the history
  • Loading branch information
AMISH-KHAN committed May 24, 2024
1 parent c976d39 commit e12a61c
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 17 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NEXT_PUBLIC_WEB_SOCKET=http://localhost:3001/
29 changes: 17 additions & 12 deletions components/PropertiesBar/PropertiesBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ import { setElement } from '../Redux/features/elementSlice'
import { MdRoundedCorner } from "react-icons/md"
import { GlobalProps } from '../Redux/GlobalProps'

import { FaItalic } from "react-icons/fa";
import { RiFontFamily } from "react-icons/ri";
import { ImBold } from "react-icons/im";;


const PropertiesBar = () => {

Expand Down Expand Up @@ -341,14 +345,15 @@ const PropertiesBar = () => {
<span className='text-xs'>Fill style</span>
<div className="flex flex-wrap max-w-[230px] gap-2 mt-1">
{fillStyles.map((style) => (
<div key={style} className={`border border-1 cursor-pointer active:scale-105 inline-flex items-center rounded-md bg-gray-50 px-2 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 ${fillStyle === style ? 'border-2 border-black ' : null}`}
<div key={style} className={`border border-1 cursor-pointer active:scale-105 inline-flex items-center rounded-md bg-gray-50 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 ${fillStyle === style ? 'border-2 border-black ' : null}`}
onClick={() => {
setChangedByUser(true);
setFillStyle(style);
}}>
}} title={style}>
<p className="text-xs rounded-md ">
{style}
</p>
<img src={`/${style}.png`} className="w-[1.5rem] h-[1.5rem] rounded-md" alt="" />

</p>
</div>
))}
</div>
Expand All @@ -360,17 +365,17 @@ const PropertiesBar = () => {
{(tool === 'text' && selectedElement === null) || (selectedElement != null && selectedElement.type === 'text') ? <CardContent>
<span className='text-xs'>Font style</span>
<div className='flex flex-row'>
<Button onClick={() => {
<Button title="Normal" onClick={() => {
setChangedByUser(true);
setFontStyle("normal");
}} variant={"ghost"} className={`rounded-md h-6 w-auto m-1 cursor-pointer active:scale-105 bg-indigo-100 ${fontStyle == "normal" ? "bg-[#d4d9d6]" : null} `}>
<span className='text-sm font-normal'>Normal</span>
<span className='text-sm font-normal'><RiFontFamily /></span>
</Button>
<Button onClick={() => {
<Button title="Italic" onClick={() => {
setChangedByUser(true);
setFontStyle("italic");
}} variant={"ghost"} className={`rounded-md h-6 w-auto m-1 cursor-pointer active:scale-105 bg-indigo-100 ${fontStyle == "italic" ? "bg-[#d4d9d6]" : null} `}>
<span className='text-sm italic font-normal'>Italic</span>
<span className='text-sm italic font-normal'><FaItalic/></span>
</Button>
</div>

Expand All @@ -386,17 +391,17 @@ const PropertiesBar = () => {
}} variant={"ghost"} className={`rounded-md h-6 w-auto m-1 cursor-pointer active:scale-105 bg-indigo-100 ${fontWeight === "normal" ? "bg-[#d4d9d6]" : null} `}>
<span className='text-sm font-normal'>Normal</span>
</Button> */}
<Button onClick={() => {
<Button title="Lighter" onClick={() => {
setChangedByUser(true);
setFontWeight("lighter");
}} variant={"ghost"} className={`rounded-md h-6 w-auto m-1 cursor-pointer active:scale-105 bg-indigo-100 ${fontWeight === "lighter" ? "bg-[#d4d9d6]" : null} `}>
<span className='text-sm font-thin'>Lighter</span>
<span className='text-sm font-thin'>L</span>
</Button>
<Button onClick={() => {
<Button title="Bold" onClick={() => {
setChangedByUser(true);
setFontWeight("bold");
}} variant={"ghost"} className={`rounded-md h-6 w-auto m-1 cursor-pointer active:scale-105 bg-indigo-100 ${fontWeight === "bold" ? "bg-[#d4d9d6]" : null} `}>
<span className='text-sm font-bold'>Bold</span>
<span className='text-sm font-bold' ><ImBold /></span>
</Button>
</div>

Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"perfect-freehand": "^1.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^5.0.1",
"react-icons": "^5.2.1",
"react-redux": "^9.0.4",
"redux": "^5.0.1",
"roughjs": "^4.6.6",
Expand Down
Binary file added public/cross-hatch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/dashed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/solid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/sunburst.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/zigzag-line.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/zigzag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e12a61c

Please sign in to comment.