Skip to content

Commit

Permalink
Feat: added husky and linting (#204)
Browse files Browse the repository at this point in the history
* added husky

* added husky

* added lint

* changed prettier.json

* minor changes

* fix: linting issues
  • Loading branch information
biratdatta authored Jun 19, 2024
1 parent a3a544a commit 414f801
Show file tree
Hide file tree
Showing 11 changed files with 2,128 additions and 1,706 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
8 changes: 8 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"trailingComma": "es5",
"tabWidth": 4,
"semi": true,
"singleQuote": true,
"bracketSpacing": true
}

15 changes: 12 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"lint": "next lint",
"analyze": "cross-env ANALYZE=true next build",
"analyze:server": "cross-env BUNDLE_ANALYZE=server next build",
"analyze:browser": "cross-env BUNDLE_ANALYZE=browser next build"
"analyze:browser": "cross-env BUNDLE_ANALYZE=browser next build",
"prepare": "husky"
},
"dependencies": {
"@emotion/react": "^11.11.4",
Expand Down Expand Up @@ -72,9 +73,17 @@
"dotenv-cli": "^7.2.1",
"eslint": "8.18.0",
"eslint-config-next": "12.1.6",
"prettier": "^2.5.1",
"husky": "^9.0.11",
"lint-staged": "^15.2.7",
"prettier": "^2.8.8",
"typescript": "4.7.4",
"webpack": "^5.69.1",
"webpack-dev-server": "^4.9.0"
}

},
"lint-staged": {

"*.{js,jsx,ts,tsx,md,html,css}": "prettier --write"
}

}
37 changes: 19 additions & 18 deletions src/components/message-item/assets/speaker.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
import React from 'react';

const SpeakerIcon = (props: any) => (
<svg
width="19"
height="19"
viewBox="0 0 19 19"
fill="none"
xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_4_45948)">
<path
d="M0 5.54837H4.47746L11.2131 0.0585938V18.9418L4.47746 13.452H0V5.54837ZM13.7439 4.65287C15.0676 5.97665 15.7425 7.58593 15.7684 9.48074C15.7684 11.2977 15.0936 12.855 13.7439 14.1529L12.3811 12.7513C13.3156 11.8168 13.7828 10.7137 13.7828 9.44181C13.7828 8.144 13.3156 7.01492 12.3811 6.05452L13.7439 4.65287ZM16.0799 2.35574C18.0266 4.30246 19 6.65152 19 9.40287C19 12.1542 18.0266 14.5163 16.0799 16.4889L14.6393 15.0484C16.1967 13.517 16.9754 11.6416 16.9754 9.42238C16.9754 7.20312 16.1967 5.31479 14.6393 3.7574L16.0799 2.35574Z"
fill={props.color}
/>
</g>
<defs>
<clipPath id="clip0_4_45948">
<rect width="19" height="19" fill="white" />
</clipPath>
</defs>
</svg>
<svg
width="19"
height="19"
viewBox="0 0 19 19"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g clipPath="url(#clip0_4_45948)">
<path
d="M0 5.54837H4.47746L11.2131 0.0585938V18.9418L4.47746 13.452H0V5.54837ZM13.7439 4.65287C15.0676 5.97665 15.7425 7.58593 15.7684 9.48074C15.7684 11.2977 15.0936 12.855 13.7439 14.1529L12.3811 12.7513C13.3156 11.8168 13.7828 10.7137 13.7828 9.44181C13.7828 8.144 13.3156 7.01492 12.3811 6.05452L13.7439 4.65287ZM16.0799 2.35574C18.0266 4.30246 19 6.65152 19 9.40287C19 12.1542 18.0266 14.5163 16.0799 16.4889L14.6393 15.0484C16.1967 13.517 16.9754 11.6416 16.9754 9.42238C16.9754 7.20312 16.1967 5.31479 14.6393 3.7574L16.0799 2.35574Z"
fill={props.color}
/>
</g>
<defs>
<clipPath id="clip0_4_45948">
<rect width="19" height="19" fill="white" />
</clipPath>
</defs>
</svg>
);

export default SpeakerIcon;
100 changes: 51 additions & 49 deletions src/components/message-item/assets/speakerPause.tsx
Original file line number Diff line number Diff line change
@@ -1,57 +1,59 @@
import React from 'react';

const SpeakerPauseIcon = (props: any) => (
<svg
width="20"
height="20"
viewBox="14 8 28 11"
fill="none"
xmlns="http://www.w3.org/2000/svg">
<path
d="M14 7.81446H18.7917L26 2V22L18.7917 16.1856H14V7.81446Z"
fill={props.color}
/>
<path
d="M30.137 17.035C29.4684 16.3893 28.9352 15.6169 28.5683 14.7628C28.2014 13.9088 28.0083 12.9903 28.0003 12.0608C27.9922 11.1314 28.1693 10.2096 28.5213 9.34934C28.8732 8.48906 29.393 7.7075 30.0503 7.05025C30.7075 6.393 31.4891 5.87323 32.3493 5.52127C33.2096 5.1693 34.1314 4.99219 35.0608 5.00026C35.9903 5.00834 36.9088 5.20144 37.7628 5.56831C38.6169 5.93517 39.3893 6.46845 40.035 7.13702C41.3101 8.45723 42.0157 10.2254 41.9997 12.0608C41.9838 13.8962 41.2476 15.6519 39.9497 16.9497C38.6519 18.2476 36.8962 18.9838 35.0608 18.9997C33.2254 19.0157 31.4572 18.3101 30.137 17.035ZM39.048 16.048C40.0988 14.9972 40.6891 13.5721 40.6891 12.086C40.6891 10.6 40.0988 9.17481 39.048 8.12402C37.9972 7.07323 36.5721 6.4829 35.086 6.4829C33.6 6.4829 32.1748 7.07323 31.124 8.12402C30.0732 9.17481 29.4829 10.6 29.4829 12.086C29.4829 13.5721 30.0732 14.9972 31.124 16.048C32.1748 17.0988 33.6 17.6891 35.086 17.6891C36.5721 17.6891 37.9972 17.0988 39.048 16.048ZM32.986 9.28602H34.386V14.886H32.986V9.28602ZM35.786 9.28602H37.186V14.886H35.786V9.28602Z"
fill={props.color}
/>
<defs>
<filter
id="filter0_d_12_6079"
x="0"
y="0"
width="54"
height="32"
filterUnits="userSpaceOnUse"
color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix" />
<feColorMatrix
in="SourceAlpha"
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
result="hardAlpha"
<svg
width="20"
height="20"
viewBox="14 8 28 11"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M14 7.81446H18.7917L26 2V22L18.7917 16.1856H14V7.81446Z"
fill={props.color}
/>
<feOffset dy="4" />
<feGaussianBlur stdDeviation="2" />
<feComposite in2="hardAlpha" operator="out" />
<feColorMatrix
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"
<path
d="M30.137 17.035C29.4684 16.3893 28.9352 15.6169 28.5683 14.7628C28.2014 13.9088 28.0083 12.9903 28.0003 12.0608C27.9922 11.1314 28.1693 10.2096 28.5213 9.34934C28.8732 8.48906 29.393 7.7075 30.0503 7.05025C30.7075 6.393 31.4891 5.87323 32.3493 5.52127C33.2096 5.1693 34.1314 4.99219 35.0608 5.00026C35.9903 5.00834 36.9088 5.20144 37.7628 5.56831C38.6169 5.93517 39.3893 6.46845 40.035 7.13702C41.3101 8.45723 42.0157 10.2254 41.9997 12.0608C41.9838 13.8962 41.2476 15.6519 39.9497 16.9497C38.6519 18.2476 36.8962 18.9838 35.0608 18.9997C33.2254 19.0157 31.4572 18.3101 30.137 17.035ZM39.048 16.048C40.0988 14.9972 40.6891 13.5721 40.6891 12.086C40.6891 10.6 40.0988 9.17481 39.048 8.12402C37.9972 7.07323 36.5721 6.4829 35.086 6.4829C33.6 6.4829 32.1748 7.07323 31.124 8.12402C30.0732 9.17481 29.4829 10.6 29.4829 12.086C29.4829 13.5721 30.0732 14.9972 31.124 16.048C32.1748 17.0988 33.6 17.6891 35.086 17.6891C36.5721 17.6891 37.9972 17.0988 39.048 16.048ZM32.986 9.28602H34.386V14.886H32.986V9.28602ZM35.786 9.28602H37.186V14.886H35.786V9.28602Z"
fill={props.color}
/>
<feBlend
mode="normal"
in2="BackgroundImageFix"
result="effect1_dropShadow_12_6079"
/>
<feBlend
mode="normal"
in="SourceGraphic"
in2="effect1_dropShadow_12_6079"
result="shape"
/>
</filter>
</defs>
</svg>
<defs>
<filter
id="filter0_d_12_6079"
x="0"
y="0"
width="54"
height="32"
filterUnits="userSpaceOnUse"
colorInterpolationFilters="sRGB"
>
<feFlood floodOpacity="0" result="BackgroundImageFix" />
<feColorMatrix
in="SourceAlpha"
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
result="hardAlpha"
/>
<feOffset dy="4" />
<feGaussianBlur stdDeviation="2" />
<feComposite in2="hardAlpha" operator="out" />
<feColorMatrix
type="matrix"
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"
/>
<feBlend
mode="normal"
in2="BackgroundImageFix"
result="effect1_dropShadow_12_6079"
/>
<feBlend
mode="normal"
in="SourceGraphic"
in2="effect1_dropShadow_12_6079"
result="shape"
/>
</filter>
</defs>
</svg>
);

export default SpeakerPauseIcon;
Loading

0 comments on commit 414f801

Please sign in to comment.