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
<Image | |
src={imgUrl} | |
alt={title!} | |
width={0} | |
height={0} | |
sizes="100vw" | |
style={{ width: '100%', height: 'auto' }} | |
/> |
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
Show hidden characters
{ | |
// Configuration for JavaScript files | |
"extends": [ | |
"airbnb-base", | |
"next/core-web-vitals", // Needed to avoid warning in next.js build: 'The Next.js plugin was not detected in your ESLint configuration' | |
"plugin:prettier/recommended" | |
], | |
"ignorePatterns":["**/PocWidget/**"], | |
"rules": { | |
"prettier/prettier": [ |
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
import { I<%= name %>Props } from './<%= name %>.types'; | |
export const use<%= name %> = (props: I<%= name %>Props) => { | |
// Logic and hooks go here. | |
const someValue = 'Hello from hook!'; | |
return { | |
someValue | |
}; |
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
/** | |
* Fix layout by removing the empty rows | |
* @param {array} layout | |
* @returns array layout | |
*/ | |
export const _removeEmptyRowsFromLayout = layout => { | |
// Find the max Y coordinate which an item reached (The last row num) | |
const maxY = Math.max(...layout.map(i => i.y)); | |
const emptyRows = []; |
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
const {override,fixBabelImports,addLessLoader} = require('customize-cra'); | |
module.exports = override( | |
fixBabelImports('import',{ | |
libraryName:'antd', | |
libraryDirectory:'es', | |
style:true, | |
}), | |
addLessLoader({ | |
lessOptions:{ |
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
{"plugins": [[ | |
"import", | |
[{ | |
"libraryName": "antd", | |
"style": "css" | |
}] | |
]]} |
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
"scripts": { | |
"start": "react-app-rewired start", | |
"build": "react-app-rewired build", | |
}, |
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
npm i less less-loader react-app-rewired babel-plugin-import customize-cra |
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
const isInitialMount = useRef(true); | |
const createQuestionRes = useSelector( s => s.dialog.createQuestionRes); | |
useEffect(() => { | |
if(isInitialMount.current){ | |
isInitialMount.current = false; | |
}else{ // Trigger useEffect only on update (no in did mount) | |
if(_.has(createQuestionRes, 'hasError') && !createQuestionRes.hasError){ | |
history.push(getMenuItem('QA').path); | |
} |
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
useEffect(() => { | |
if(_.has(createQuestionRes, 'hasError') && !createQuestionRes.hasError){ | |
history.push(getMenuItem('QA').path); | |
} | |
}, [createQuestionRes]); |
NewerOlder