Skip to content

Commit

Permalink
chore(deps): explicitly include className prop on stylable components
Browse files Browse the repository at this point in the history
  • Loading branch information
wKovacs64 committed Dec 2, 2020
1 parent f9a7a00 commit 3cef6ee
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 15 deletions.
14 changes: 12 additions & 2 deletions src/components/legend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ import { ColorMap, LabelMap } from '../legend';
import LegendItem from './legend-item';

interface LegendProps {
className?: string;
colors: ColorMap;
labels: LabelMap;
}

function Legend({ colors, labels, ...props }: LegendProps): JSX.Element {
function Legend({
className,
colors,
labels,
...props
}: LegendProps): JSX.Element {
return (
<section data-testid="legend" {...props}>
<section data-testid="legend" className={className} {...props}>
<p>Legend:</p>
<LegendItem color={colors.number} label={labels.number} />
<LegendItem color={colors.uppercase} label={labels.uppercase} />
Expand All @@ -19,4 +25,8 @@ function Legend({ colors, labels, ...props }: LegendProps): JSX.Element {
);
}

Legend.defaultProps = {
className: '',
};

export default Legend;
11 changes: 7 additions & 4 deletions src/components/pwned-info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,13 @@ const pwnedInfoMachine = createMachine<
);

interface PwnedInfoProps {
className?: string;
// delayLoadingMs: number;
password: string;
}

function PwnedInfo({
className,
/* delayLoadingMs, */ password,
...props
}: PwnedInfoProps): JSX.Element {
Expand All @@ -120,7 +122,7 @@ function PwnedInfo({
}, [send, password]);

return (
<section data-testid="pwned-info" {...props}>
<section data-testid="pwned-info" className={className} {...props}>
<p>Public Exposure:</p>
{error ? (
<p>
Expand All @@ -145,8 +147,9 @@ function PwnedInfo({
);
}

// PwnedInfo.defaultProps = {
// delayLoadingMs: 750,
// };
PwnedInfo.defaultProps = {
className: '',
// delayLoadingMs: 750,
};

export default PwnedInfo;
8 changes: 7 additions & 1 deletion src/components/results.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,23 @@ const AdditionalInfo = styled.section`
`;

interface ResultsProps {
className?: string;
colors: ColorMap;
labels: LabelMap;
passwordInput: string;
passwordToCheck: string;
}

function Results({
className,
colors,
labels,
passwordInput,
passwordToCheck,
...props
}: ResultsProps): JSX.Element {
return (
<section data-testid="results" {...props}>
<section data-testid="results" className={className} {...props}>
<PasswordThroughLense
colors={colors}
labels={labels}
Expand All @@ -53,4 +55,8 @@ function Results({
);
}

Results.defaultProps = {
className: '',
};

export default Results;
7 changes: 0 additions & 7 deletions src/emotion.d.ts

This file was deleted.

3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"compilerOptions": {
"target": "esnext",
"moduleResolution": "node",
"jsx": "react",
"jsx": "react-jsx",
"jsxImportSource": "@emotion/react",
"esModuleInterop": true,
"noEmit": true,
"strict": true,
Expand Down

0 comments on commit 3cef6ee

Please sign in to comment.