Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewwalsh0 committed Nov 28, 2024
1 parent 8144d6e commit 52a0e95
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ exports[`SnapUIAddress renders Ethereum address 1`] = `
<rect
fill="#F29602"
height="32"
transform="translate(-2.8175089622830405 4.951916544006229) rotate(230.4 16 16)"
transform="translate(-2.81750896228304 4.951916544006229) rotate(230.4 16 16)"
width="32"
x="0"
y="0"
Expand Down Expand Up @@ -476,7 +476,7 @@ exports[`SnapUIAddress renders legacy Ethereum address 1`] = `
<rect
fill="#F29602"
height="32"
transform="translate(-2.8175089622830405 4.951916544006229) rotate(230.4 16 16)"
transform="translate(-2.81750896228304 4.951916544006229) rotate(230.4 16 16)"
width="32"
x="0"
y="0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ exports[`Connect More Accounts Modal should render correctly 1`] = `
<rect
fill="#FA4300"
height="32"
transform="translate(-1.712066926084717 -0.6920409130150887) rotate(264.3 16 16)"
transform="translate(-1.712066926084717 -0.6920409130150889) rotate(264.3 16 16)"
width="32"
x="0"
y="0"
Expand Down Expand Up @@ -202,7 +202,7 @@ exports[`Connect More Accounts Modal should render correctly 1`] = `
<rect
fill="#FA4300"
height="32"
transform="translate(-1.712066926084717 -0.6920409130150887) rotate(264.3 16 16)"
transform="translate(-1.712066926084717 -0.6920409130150889) rotate(264.3 16 16)"
width="32"
x="0"
y="0"
Expand Down Expand Up @@ -261,7 +261,7 @@ exports[`Connect More Accounts Modal should render correctly 1`] = `
<rect
fill="#FA4300"
height="32"
transform="translate(-1.712066926084717 -0.6920409130150887) rotate(264.3 16 16)"
transform="translate(-1.712066926084717 -0.6920409130150889) rotate(264.3 16 16)"
width="32"
x="0"
y="0"
Expand Down Expand Up @@ -304,7 +304,7 @@ exports[`Connect More Accounts Modal should render correctly 1`] = `
<rect
fill="#FA4300"
height="32"
transform="translate(-1.712066926084717 -0.6920409130150887) rotate(264.3 16 16)"
transform="translate(-1.712066926084717 -0.6920409130150889) rotate(264.3 16 16)"
width="32"
x="0"
y="0"
Expand Down
18 changes: 8 additions & 10 deletions ui/pages/confirmations/confirmation/confirmation.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,18 +195,14 @@ function useTemplateState(pendingConfirmation) {
return [templateState];
}

const Header = ({ pendingConfirmation, onCancel }) => {
const { origin } = pendingConfirmation ?? {};

const isSnapCustomUIDialog = SNAP_CUSTOM_UI_DIALOG.includes(
pendingConfirmation?.type,
);
function Header({ confirmation, isSnapCustomUIDialog, onCancel }) {
const { count } = useConfirmationNavigation();
const { origin } = confirmation ?? {};

const hideSnapBranding = useSelector((state) =>
getHideSnapBranding(state, origin),
);

const { count } = useConfirmationNavigation();
const requiresSnapHeader = isSnapCustomUIDialog && !hideSnapBranding;

if (count <= 1 && !requiresSnapHeader) {
Expand All @@ -221,7 +217,7 @@ const Header = ({ pendingConfirmation, onCancel }) => {
)}
</Box>
);
};
}

export default function ConfirmationPage({
redirectToHomeOnZeroConfirmations = true,
Expand Down Expand Up @@ -249,7 +245,8 @@ export default function ConfirmationPage({
(confirmation) => confirmation.id === id,
);

const pendingConfirmation = pendingRoutedConfirmation ?? pendingConfirmations[0];
const pendingConfirmation =
pendingRoutedConfirmation ?? pendingConfirmations[0];

const [matchedChain, setMatchedChain] = useState({});
const [chainFetchComplete, setChainFetchComplete] = useState(false);
Expand Down Expand Up @@ -500,7 +497,8 @@ export default function ConfirmationPage({
<ConfirmContextProvider>
<div className="confirmation-page">
<Header
pendingConfirmation={pendingConfirmation}
confirmation={pendingConfirmation}
isSnapCustomUIDialog={isSnapCustomUIDialog}
onCancel={handleSnapDialogCancel}
/>
<Box
Expand Down

0 comments on commit 52a0e95

Please sign in to comment.