Skip to content

Commit 8de0364

Browse files
chore(runway): cherry-pick fix: cp-12.13.0 replace 3D flask mascot with 2D version (#30597)
- fix: cp-12.13.0 replace 3D flask mascot with 2D version (#30592) ## **Description** Issue: The new Flask 3D asset isn't fully supported Solution: Replace all instances of the 3D asset for Flask with the 2D counterpart temporarily until we fix the issue [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/30592?quickstart=1) ## **Related issues** Fixes: [#30338](#30338) ## **Manual testing steps** 1. Run `yarn start:flask` 2. Confirm that the 2D flask logo is visible in the following flows 3. Swap Quote flow 4. Create Wallet flow 5. Login ## **Screenshots/Recordings** `ui/pages/onboarding-flow/welcome/welcome.js` | Before | After | |:---:|:---:| |![before_welcome](https://github.com/user-attachments/assets/5acd7341-ac4f-4c3f-9279-01f31b8a1e51)|![after_welcome](https://github.com/user-attachments/assets/4891ba78-23d2-4e7f-98f3-610131fd8134)| `ui/pages/swaps/awaiting-swap/awaiting-swap.js` | Before | After | |:---:|:---:| |![before_await_swap](https://github.com/user-attachments/assets/81dec14b-9f93-431e-8e2e-8baa546513ab)|![after_await_swap](https://github.com/user-attachments/assets/a096033c-357f-47de-b74b-123824d80a52)| `ui/pages/swaps/loading-swaps-quotes/loading-swaps-quotes.js` | Before | After | |:---:|:---:| |![before_loading_swap_quote](https://github.com/user-attachments/assets/2fca315b-8ff4-4f7a-904f-13fcb630f0b1)|![after_loading_swap_quote](https://github.com/user-attachments/assets/cca208b1-f45d-4583-a35b-7d9a851624a0)| `ui/pages/swaps/mascot-background-animation/mascot-background-animation.js` | Before | After | |:---:|:---:| |![before_background_animation](https://github.com/user-attachments/assets/d9869718-04ab-41c1-8371-4aca613c4a79)|![after_background_animation](https://github.com/user-attachments/assets/f50c948c-c3e4-45a3-999c-152ab0f7b7df)| `ui/pages/unlock-page/unlock-page.component.js` | Before | After | |:---:|:---:| |![before](https://github.com/user-attachments/assets/4267afb5-2d28-4cd9-8f34-6027bf9308ed)|![after](https://github.com/user-attachments/assets/32f8eec7-e5ba-4c97-afe8-207f100b1828)| ### **Before** NA ### **After** NA ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. [c186fb0](c186fb0) Co-authored-by: Vince Howard <[email protected]>
1 parent c85f971 commit 8de0364

File tree

6 files changed

+91
-31
lines changed

6 files changed

+91
-31
lines changed

ui/pages/onboarding-flow/welcome/welcome.js

+12-7
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,17 @@ export default function OnboardingWelcome() {
115115
///: END:ONLY_INCLUDE_IF
116116
};
117117

118+
const renderMascot = () => {
119+
if (process.env.METAMASK_BUILD_TYPE === 'flask') {
120+
return (
121+
<img src="./images/logo/metamask-fox.svg" width="240" height="240" />
122+
);
123+
}
124+
return (
125+
<Mascot animationEventEmitter={eventEmitter} width="250" height="300" />
126+
);
127+
};
128+
118129
return (
119130
<div className="onboarding-welcome" data-testid="onboarding-welcome">
120131
{
@@ -132,13 +143,7 @@ export default function OnboardingWelcome() {
132143
<Text textAlign={TextAlign.Center} marginLeft={6} marginRight={6}>
133144
{t('welcomeToMetaMaskIntro')}
134145
</Text>
135-
<div className="onboarding-welcome__mascot">
136-
<Mascot
137-
animationEventEmitter={eventEmitter}
138-
width="250"
139-
height="300"
140-
/>
141-
</div>
146+
<div className="onboarding-welcome__mascot">{renderMascot()}</div>
142147
</div>
143148
<div>
144149
<Text

ui/pages/swaps/awaiting-swap/awaiting-swap.js

+18-7
Original file line numberDiff line numberDiff line change
@@ -272,16 +272,27 @@ export default function AwaitingSwap({
272272
}
273273
}, [dispatch, errorKey]);
274274

275+
const renderMascot = () => {
276+
if (process.env.METAMASK_BUILD_TYPE === 'flask') {
277+
return (
278+
<div className="awaiting-swap__mascot">
279+
<img src="./images/logo/metamask-fox.svg" width="90" height="90" />
280+
</div>
281+
);
282+
}
283+
return (
284+
<Mascot
285+
animationEventEmitter={animationEventEmitter.current}
286+
width="90"
287+
height="90"
288+
/>
289+
);
290+
};
291+
275292
return (
276293
<div className="awaiting-swap">
277294
<div className="awaiting-swap__content">
278-
{!(swapComplete || errorKey) && (
279-
<Mascot
280-
animationEventEmitter={animationEventEmitter.current}
281-
width="90"
282-
height="90"
283-
/>
284-
)}
295+
{!(swapComplete || errorKey) && renderMascot()}
285296
<div className="awaiting-swap__status-image">{statusImage}</div>
286297
<div
287298
className="awaiting-swap__header"

ui/pages/swaps/awaiting-swap/index.scss

+7
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@
1616
padding-right: 32px;
1717
}
1818

19+
&__mascot {
20+
margin-bottom: 16px;
21+
display: flex;
22+
align-self: center;
23+
justify-content: center;
24+
}
25+
1926
div {
2027
text-align: center;
2128
display: flex;

ui/pages/swaps/loading-swaps-quotes/loading-swaps-quotes.js

+17-6
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,22 @@ export default function LoadingSwapsQuotes({
8686
const [quoteCount, updateQuoteCount] = useState(0);
8787
const [midPointTarget, setMidpointTarget] = useState(null);
8888

89+
const renderMascot = () => {
90+
if (process.env.METAMASK_BUILD_TYPE === 'flask') {
91+
return (
92+
<img src="./images/logo/metamask-fox.svg" width="90" height="90" />
93+
);
94+
}
95+
return (
96+
<Mascot
97+
animationEventEmitter={animationEventEmitter.current}
98+
width="90"
99+
height="90"
100+
lookAtTarget={midPointTarget}
101+
/>
102+
);
103+
};
104+
89105
useEffect(() => {
90106
let timeoutLength;
91107

@@ -170,12 +186,7 @@ export default function LoadingSwapsQuotes({
170186
className="loading-swaps-quotes__mascot-container"
171187
ref={mascotContainer}
172188
>
173-
<Mascot
174-
animationEventEmitter={animationEventEmitter.current}
175-
width="90"
176-
height="90"
177-
lookAtTarget={midPointTarget}
178-
/>
189+
{renderMascot()}
179190
</div>
180191
</div>
181192
</div>

ui/pages/swaps/mascot-background-animation/mascot-background-animation.js

+21-6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,26 @@ import Mascot from '../../../components/ui/mascot';
88
export default function MascotBackgroundAnimation({ height, width }) {
99
const animationEventEmitter = useRef(new EventEmitter());
1010

11+
const renderMascot = () => {
12+
if (process.env.METAMASK_BUILD_TYPE === 'flask') {
13+
return (
14+
<img
15+
src="./images/logo/metamask-fox.svg"
16+
width={width ?? '42'}
17+
height={height ?? '42'}
18+
/>
19+
);
20+
}
21+
return (
22+
<Mascot
23+
animationEventEmitter={animationEventEmitter.current}
24+
width={width ?? '42'}
25+
height={height ?? '42'}
26+
followMouse={false}
27+
/>
28+
);
29+
};
30+
1131
return (
1232
<div className="mascot-background-animation__animation">
1333
<div
@@ -219,12 +239,7 @@ export default function MascotBackgroundAnimation({ height, width }) {
219239
className="mascot-background-animation__mascot-container"
220240
data-testid="mascot-background-animation-mascot-container"
221241
>
222-
<Mascot
223-
animationEventEmitter={animationEventEmitter.current}
224-
width={width ?? '42'}
225-
height={height ?? '42'}
226-
followMouse={false}
227-
/>
242+
{renderMascot()}
228243
</div>
229244
</div>
230245
);

ui/pages/unlock-page/unlock-page.component.js

+16-5
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,21 @@ export default class UnlockPage extends Component {
152152
);
153153
}
154154

155+
renderMascot = () => {
156+
if (process.env.METAMASK_BUILD_TYPE === 'flask') {
157+
return (
158+
<img src="./images/logo/metamask-fox.svg" width="120" height="120" />
159+
);
160+
}
161+
return (
162+
<Mascot
163+
animationEventEmitter={this.animationEventEmitter}
164+
width="120"
165+
height="120"
166+
/>
167+
);
168+
};
169+
155170
render() {
156171
const { password, error } = this.state;
157172
const { t } = this.context;
@@ -163,11 +178,7 @@ export default class UnlockPage extends Component {
163178
<div className="unlock-page__container">
164179
<div className="unlock-page" data-testid="unlock-page">
165180
<div className="unlock-page__mascot-container">
166-
<Mascot
167-
animationEventEmitter={this.animationEventEmitter}
168-
width="120"
169-
height="120"
170-
/>
181+
{this.renderMascot()}
171182
{isBeta() ? (
172183
<div className="unlock-page__mascot-container__beta">
173184
{t('beta')}

0 commit comments

Comments
 (0)