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
// Array of timesheet for the selected week. from = "02-02-2020", to = "08-02-2020" | |
const timeSheetData = [ | |
{ | |
id: "P-011", | |
taskId: "T-011", | |
// more fields such as taskname, projectname and more | |
timeEntriesForWeek: { | |
"02-02-2020": 1, | |
"03-02-2020": 4, |
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 weeklyTimeSheetData = [ | |
{ | |
id: "P-011", | |
taskId: "T-011", | |
timeEntriesForWeek: {} | |
}, | |
{ | |
id: "P-012", | |
taskId: "T-70", | |
timeEntriesForWeek: {} |
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 { editable, editableOpts } = this.props; | |
return ( | |
<Child {...(editable && { editable: editableOpts } )} /> | |
); |
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
content: item => ( | |
<> | |
<ContentWrapper> | |
<LinkWrapper | |
to={{ | |
pathname: `/settings/employees/${item.companyId}/grants/${ | |
item.id | |
}`, | |
state: { | |
companyName: item.name |
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 getInitialValues = props => { | |
const {company} = props | |
const filteredData = {...company} | |
if (company && company.companyCategory) { | |
const { | |
companyCategory: {id}, | |
} = company | |
delete filteredData.companyCategory | |
filteredData.companyCategoryId = parseInt(id, 10) | |
} |
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
/* eslint-disable jsx-a11y/label-has-for */ | |
import React from 'react'; | |
import { capitalizeFirstLetters } from 'Utils'; | |
type Props = { | |
name: string, | |
label: string, | |
options: Object, | |
idKey: string, | |
nameKey: string, |
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
console.log([false, null, 2, 0, undefined].filter(Boolean)); | |
const isRequired = () => { throw new Error('param is required'); }; | |
const hello = (name = isRequired()) => { console.log(`hello ${name}`) }; |
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
=> #<Client:0x00007fc6b1d7f0f8 | |
id: 35, | |
company_name: "Moneyballok", | |
company_url: "www.mvnbasfi.com", | |
company_email: "[email protected]", | |
company_size: nil, | |
phone_number: nil, | |
fax: nil, | |
address: nil, | |
address_alt: nil, |
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
// presentational component | |
const Greeting = ({ name }) => { | |
if (!name) { | |
return <div>Connecting...</div>; | |
} | |
return <div>Hi {name}!</div>; | |
}; | |
// hoc |
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
function validate(phone) { | |
var regex = /^\+(?:[0-9]?){6,14}[0-9]$/; | |
if (regex.test(phone)) { | |
// Valid international phone number | |
return 'valid' | |
} else { | |
return 'invalid' | |
// Invalid international phone number | |
} |
NewerOlder