run prettier

main
Mike Fix 3 years ago
parent 3034f92643
commit 1aae2480fb
No known key found for this signature in database
GPG Key ID: 1D85E862314CA79F

@ -58,16 +58,8 @@ class Dropdown extends React.PureComponent {
userInputtedValue = '' userInputtedValue = ''
render() { render() {
const { const { innerRef, color, selected, onChange, itemWrapper, icon, disableInput, title } =
innerRef, this.props
color,
selected,
onChange,
itemWrapper,
icon,
disableInput,
title,
} = this.props
const { itemsToShow, inputValue } = this.state const { itemsToShow, inputValue } = this.state
const labelId = title ? `${title.toLowerCase()}-dropdown` : undefined const labelId = title ? `${title.toLowerCase()}-dropdown` : undefined
@ -98,51 +90,53 @@ class Dropdown extends React.PureComponent {
} }
} }
const renderDropdown = ({ color, list, itemWrapper, icon, disableInput, title, labelId }) => ({ const renderDropdown =
isOpen, ({ color, list, itemWrapper, icon, disableInput, title, labelId }) =>
highlightedIndex, ({
selectedItem, isOpen,
getRootProps, highlightedIndex,
getToggleButtonProps, selectedItem,
getInputProps, getRootProps,
getItemProps, getToggleButtonProps,
}) => { getInputProps,
return ( getItemProps,
<DropdownContainer {...getRootProps({ refKey: 'innerRef' })}> }) => {
{title && <VisuallyHidden id={labelId}>{title}</VisuallyHidden>} return (
<DropdownIcon isOpen={isOpen}>{icon}</DropdownIcon> <DropdownContainer {...getRootProps({ refKey: 'innerRef' })}>
<SelectedItem {title && <VisuallyHidden id={labelId}>{title}</VisuallyHidden>}
getToggleButtonProps={getToggleButtonProps} <DropdownIcon isOpen={isOpen}>{icon}</DropdownIcon>
getInputProps={getInputProps} <SelectedItem
isOpen={isOpen} getToggleButtonProps={getToggleButtonProps}
color={color} getInputProps={getInputProps}
hasIcon={!!icon} isOpen={isOpen}
disabled={disableInput} color={color}
> hasIcon={!!icon}
{selectedItem.name} disabled={disableInput}
</SelectedItem> >
{isOpen ? ( {selectedItem.name}
<ListItems color={color}> </SelectedItem>
{list.map((item, index) => ( {isOpen ? (
<ListItem <ListItems color={color}>
key={index} {list.map((item, index) => (
color={color} <ListItem
item={item} key={index}
itemWrapper={itemWrapper} color={color}
{...getItemProps({ item={item}
item, itemWrapper={itemWrapper}
isSelected: selectedItem.name === item.name, {...getItemProps({
isHighlighted: highlightedIndex === index, item,
})} isSelected: selectedItem.name === item.name,
> isHighlighted: highlightedIndex === index,
{item.name} })}
</ListItem> >
))} {item.name}
</ListItems> </ListItem>
) : null} ))}
</DropdownContainer> </ListItems>
) ) : null}
} </DropdownContainer>
)
}
const DropdownContainer = ({ children, innerRef, ...rest }) => { const DropdownContainer = ({ children, innerRef, ...rest }) => {
return ( return (

@ -5,7 +5,7 @@ function userTiming({ category, status, value }) {
window.gtag('event', status, { window.gtag('event', status, {
event_category: 'Performance', event_category: 'Performance',
event_label: category, event_label: category,
value value,
}) })
} catch (err) { } catch (err) {
// pass // pass
@ -20,7 +20,7 @@ export function usePerformanceMeasurement() {
userTiming({ userTiming({
category: 'paint', category: 'paint',
status: entry.name, status: entry.name,
value: entry.startTime value: entry.startTime,
}) })
}) })
const navigationTiming = window.performance.getEntriesByType('navigation') const navigationTiming = window.performance.getEntriesByType('navigation')
@ -30,7 +30,7 @@ export function usePerformanceMeasurement() {
userTiming({ userTiming({
category: 'paint', category: 'paint',
status: 'time to first byte', status: 'time to first byte',
value: navigationTiming.responseEnd - navigationTiming.requestStart value: navigationTiming.responseEnd - navigationTiming.requestStart,
}) })
} }
@ -45,7 +45,7 @@ export function usePerformanceMeasurement() {
userTiming({ userTiming({
category: 'javascript', category: 'javascript',
status: 'script count', status: 'script count',
value: javascriptFiles.length value: javascriptFiles.length,
}) })
/* /*
@ -55,7 +55,7 @@ export function usePerformanceMeasurement() {
userTiming({ userTiming({
category: 'javascript', category: 'javascript',
status: 'script size', status: 'script size',
value: javascriptFiles.reduce((sum, script) => script.encodedBodySize + sum, 0) value: javascriptFiles.reduce((sum, script) => script.encodedBodySize + sum, 0),
}) })
} }
} catch (error) { } catch (error) {

@ -18,10 +18,16 @@ module.exports = withBundleAnalyzer(
use: [options.defaultLoaders.babel], use: [options.defaultLoaders.babel],
}) })
config.plugins.push( config.plugins.push(
new options.webpack.IgnorePlugin({ resourceRegExp: /\.html$/, contextRegExp: /node_modules/ }) new options.webpack.IgnorePlugin({
resourceRegExp: /\.html$/,
contextRegExp: /node_modules/,
})
) )
config.plugins.push( config.plugins.push(
new options.webpack.IgnorePlugin({ resourceRegExp: /\.css$/, contextRegExp: /node_modules/ }) new options.webpack.IgnorePlugin({
resourceRegExp: /\.css$/,
contextRegExp: /node_modules/,
})
) )
return config return config

Loading…
Cancel
Save