Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
{new Array(maxRating).fill(0).map((_, index) => {
const currentValue = index + 1;
const [StarR, starProps] = getOverrides(
StyledStar,
props,
{
color,
maxRating,
rating: value,
value: currentValue,
size,
onPress: () => onValueChange(currentValue),
},
dlv(theme, 'overrides.Rating.Star'),
overrides.Star,
);
return ;
})}
onValueChange = () => {
return;
},
overrides = {},
} = props;
const theme = useTheme();
const [Touchable, touchableProps] = getOverrides(
StyledTouchable,
props,
{
isDisabled,
size,
onPress: () => onValueChange(!value),
},
dlv(theme, 'overrides.Switch.Touchable'),
overrides.Touchable,
);
const [Background, backgroundProps] = getOverrides(
StyledBackground,
props,
{
isDisabled,
size,
value,
},
dlv(theme, 'overrides.Switch.Background'),
overrides.Background,
);
const [Circle, circleProps] = getOverrides(
StyledCircle,
props,
node {
fields {
slug
}
frontmatter {
title
date
}
}
}
}
}
`
)
return chain(get(allMarkdownRemark, 'edges'))
.map(({ node }) => ({ ...node.fields, ...node.frontmatter }))
.sort((a, b) => new Date(b.date) - new Date(a.date))
.value()
}
export const Label = (props: LabelProps) => {
const { children, position = 'top', overrides = {}, label } = props;
const theme = useTheme();
const [Root, rootProps] = getOverrides(
StyledRoot,
props,
{},
dlv(theme, 'overrides.Label.Root'),
overrides.Root,
);
const [Wrapper, wrapperProps] = getOverrides(
StyledWrapper,
props,
{ position },
dlv(theme, 'overrides.Label.Wrapper'),
overrides.Wrapper,
);
const [LabelText, labelTextProps] = getOverrides(
StyledLabelText,
props,
{ position, label },
dlv(theme, 'overrides.Label.LabelText'),
overrides.LabelText,
);
return (
{position === 'top' && }
{position === 'left' && }
{children}
run: ({ currentResults, softReset }, resp) => {
syncResults(currentResults.allBooks, "Books", resp.updateBooks ? resp.updateBooks.Books : [resp.updateBook.Book]);
softReset(currentResults);
}
},
{
when: /deleteBook/,
run: ({ refresh }, res, req) => {
syncDeletes(GetBooksQuery, [req._id], "allBooks", "Books");
refresh();
}
}
];
const { data, loading, loaded, currentQuery } = useQuery(buildQuery(GetBooksQuery, variables, { onMutation: onBooksMutation }));
const booksRaw = delve(data, "allBooks.Books") || null;
const books = adjustBooks(booksRaw);
const booksCount = loaded ? delve(data, "allBooks.Meta.count") : "";
const resultsCount = booksCount != null ? booksCount : -1;
const totalPages = useMemo(() => (resultsCount && resultsCount > 0 ? Math.ceil(resultsCount / searchState.pageSize) : 0), [resultsCount]);
return {
currentQuery,
books,
resultsCount,
totalPages,
booksLoading: loading,
booksLoaded: loaded && tagsLoaded && subjectsLoaded
};
};
const {
layout: { gutterWidth },
} = useTheme();
const theme = useTheme();
return (
);
};
const LiveDemo = ({ query, suggestions, onSubmit, isLoading }) => {
const [inputBg, setInputBg] = useState(get(query, 'overlay.background') || '')
const [inputUrl, setInputUrl] = useState(query.url || '')
const [inputWaitFor, setInputWaitFor] = useState(query.waitFor || '')
const [inputOverlay, setInputOverlay] = useState(
get(query, 'overlay.browser') || ''
)
const domain = React.useMemo(() => getDomain(inputUrl), [inputUrl])
const getValues = React.useCallback(() => {
const preprendUrl = prependHttp(inputUrl)
const overlay = pickBy({ browser: inputOverlay, background: inputBg })
return pickBy({
url: isUrl(preprendUrl) ? preprendUrl : undefined,
waitFor: ms(inputWaitFor || '0'),
overlay: isEmpty(overlay) ? undefined : overlay
})
}, [inputUrl, inputOverlay, inputBg, inputWaitFor])
let fns = toArray(arr).map(x => dlv(window, x) !== void 0);
return new Promise(r => {
{},
dlv(theme, 'overrides.WheelPicker.Root'),
overrides.Root,
);
const [ArrowUp, arrowUpProps] = getOverrides(
StyledArrowUp,
props,
{ onPress: handlePressUp },
dlv(theme, 'overrides.WheelPicker.ArrowUp'),
overrides.ArrowUp,
);
const [ArrowDown, arrowDownProps] = getOverrides(
StyledArrowDown,
props,
{ onPress: handlePressDown },
dlv(theme, 'overrides.WheelPicker.ArrowDown'),
overrides.ArrowDown,
);
const [UpperOverlay, upperOverlayProps] = getOverrides(
StyledUpperOverlay,
props,
{ pointerEvents: 'none' },
dlv(theme, 'overrides.WheelPicker.UpperOverlay'),
overrides.UpperOverlay,
);
const [BottomOverlay, bottomOverlayProps] = getOverrides(
StyledBottomOverlay,
props,
{ pointerEvents: 'none' },
dlv(theme, 'overrides.WheelPicker.BottomOverlay'),
overrides.BottomOverlay,
);
isDisabled,
size,
value,
},
dlv(theme, 'overrides.Switch.Background'),
overrides.Background,
);
const [Circle, circleProps] = getOverrides(
StyledCircle,
props,
{
isDisabled,
size,
value,
},
dlv(theme, 'overrides.Switch.Circle'),
overrides.Circle,
);
return (
);
};