@axos-web-dev/shared-components 1.0.91 → 1.0.93-ext-bal-apy-calc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -24,19 +24,29 @@ const AxosOneCalculator = ({
|
|
|
24
24
|
bodyCopy,
|
|
25
25
|
disclosure,
|
|
26
26
|
icon,
|
|
27
|
-
variant
|
|
27
|
+
variant,
|
|
28
|
+
initialBalance
|
|
28
29
|
}) => {
|
|
29
30
|
const calc_variant = getVariant(variant);
|
|
30
31
|
const AXOS_ONE_APY = +process.env.NEXT_PUBLIC_AXOS_ONE_APY;
|
|
31
|
-
const
|
|
32
|
+
const startingBalance = Number.isFinite(Number(initialBalance)) && Number(initialBalance) >= 0 ? Number(initialBalance) : 1e4;
|
|
33
|
+
const [balance, setBalance] = useState(startingBalance);
|
|
32
34
|
const [axbAPY, _setAxbAPY] = useState(AXOS_ONE_APY);
|
|
33
|
-
const [axbEarning, setAxbEarning] = useState(
|
|
35
|
+
const [axbEarning, setAxbEarning] = useState(
|
|
36
|
+
AXOS_ONE_APY / 100 * startingBalance
|
|
37
|
+
);
|
|
34
38
|
const [chaseAPY, _setChaseAPY] = useState(0.01);
|
|
35
|
-
const [chaseEarning, setChaseEarning] = useState(
|
|
39
|
+
const [chaseEarning, setChaseEarning] = useState(
|
|
40
|
+
0.01 / 100 * startingBalance
|
|
41
|
+
);
|
|
36
42
|
const [bofaAPY, _setBofaAPY] = useState(0.01);
|
|
37
|
-
const [bofaEarning, setBofaEarning] = useState(
|
|
43
|
+
const [bofaEarning, setBofaEarning] = useState(
|
|
44
|
+
0.01 / 100 * startingBalance
|
|
45
|
+
);
|
|
38
46
|
const [fargoAPY, _setFargoAPY] = useState(0.05);
|
|
39
|
-
const [fargoEarning, setFargoEarning] = useState(
|
|
47
|
+
const [fargoEarning, setFargoEarning] = useState(
|
|
48
|
+
0.05 / 100 * startingBalance
|
|
49
|
+
);
|
|
40
50
|
const removeNonNumeric = (value) => {
|
|
41
51
|
if (value === "") {
|
|
42
52
|
value = "0";
|
|
@@ -157,32 +167,32 @@ const AxosOneCalculator = ({
|
|
|
157
167
|
] }),
|
|
158
168
|
/* @__PURE__ */ jsxs(TableRow, { children: [
|
|
159
169
|
/* @__PURE__ */ jsxs(TableCell, { variant: "primary", children: [
|
|
160
|
-
"
|
|
170
|
+
"Wells Fargo",
|
|
161
171
|
/* @__PURE__ */ jsx("sup", { children: "3" })
|
|
162
172
|
] }),
|
|
163
173
|
/* @__PURE__ */ jsxs(TableCell, { variant: "primary", children: [
|
|
164
|
-
|
|
174
|
+
fargoAPY.toFixed(2),
|
|
165
175
|
"%"
|
|
166
176
|
] }),
|
|
167
177
|
/* @__PURE__ */ jsxs(TableCell, { variant: "primary", children: [
|
|
168
178
|
"$",
|
|
169
|
-
|
|
179
|
+
fargoEarning.toLocaleString(void 0, {
|
|
170
180
|
maximumFractionDigits: 2
|
|
171
181
|
})
|
|
172
182
|
] })
|
|
173
183
|
] }),
|
|
174
184
|
/* @__PURE__ */ jsxs(TableRow, { children: [
|
|
175
185
|
/* @__PURE__ */ jsxs(TableCell, { variant: "primary", children: [
|
|
176
|
-
"
|
|
186
|
+
"Bank of America",
|
|
177
187
|
/* @__PURE__ */ jsx("sup", { children: "4" })
|
|
178
188
|
] }),
|
|
179
189
|
/* @__PURE__ */ jsxs(TableCell, { variant: "primary", children: [
|
|
180
|
-
|
|
190
|
+
bofaAPY.toFixed(2),
|
|
181
191
|
"%"
|
|
182
192
|
] }),
|
|
183
193
|
/* @__PURE__ */ jsxs(TableCell, { variant: "primary", children: [
|
|
184
194
|
"$",
|
|
185
|
-
|
|
195
|
+
bofaEarning.toLocaleString(void 0, {
|
|
186
196
|
maximumFractionDigits: 2
|
|
187
197
|
})
|
|
188
198
|
] })
|
|
@@ -11,5 +11,6 @@ export interface CalculatorProps {
|
|
|
11
11
|
bodyCopy?: React.ReactNode;
|
|
12
12
|
disclosure?: React.ReactNode;
|
|
13
13
|
marketingTiles?: IconBillboardProps[];
|
|
14
|
+
initialBalance?: number;
|
|
14
15
|
}
|
|
15
16
|
export declare const Calculator: (props: CalculatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -134,7 +134,8 @@ const Calculator = (props) => {
|
|
|
134
134
|
disclosure,
|
|
135
135
|
headline,
|
|
136
136
|
name,
|
|
137
|
-
marketingTiles
|
|
137
|
+
marketingTiles,
|
|
138
|
+
initialBalance
|
|
138
139
|
} = props;
|
|
139
140
|
const ref = useRef(null);
|
|
140
141
|
const iframe = calculators.get(name || "");
|
|
@@ -225,7 +226,8 @@ const Calculator = (props) => {
|
|
|
225
226
|
bodyCopy,
|
|
226
227
|
variant,
|
|
227
228
|
disclosure,
|
|
228
|
-
icon
|
|
229
|
+
icon,
|
|
230
|
+
initialBalance
|
|
229
231
|
}
|
|
230
232
|
);
|
|
231
233
|
} else if (name === "APY Balance Summit Savings") {
|
|
@@ -185,14 +185,17 @@
|
|
|
185
185
|
._18ygy9m5 ._1m7m2av {
|
|
186
186
|
min-height: 330px;
|
|
187
187
|
}
|
|
188
|
+
._18ygy9m5:has(> :nth-child(3)) ._1m7m2av {
|
|
189
|
+
min-height: 216px;
|
|
190
|
+
}
|
|
188
191
|
._1m7m2ay {
|
|
189
192
|
background: var(--_1073cm8f);
|
|
190
193
|
color: #FFFFFF;
|
|
191
194
|
}
|
|
192
195
|
._1m7m2az {
|
|
193
|
-
padding: 1.5rem;
|
|
194
196
|
height: 100%;
|
|
195
197
|
justify-content: center;
|
|
198
|
+
padding: 1.5rem;
|
|
196
199
|
}
|
|
197
200
|
._1m7m2a10 {
|
|
198
201
|
color: #fff;
|
package/package.json
CHANGED