Add Title Sponsor Nokian to Avy - #1219
Conversation
e5ea4a0 to
2d8a6c0
Compare
| <Image source={require('assets/avy-logo-transparent.png')} resizeMode="contain" style={styles.avyLogo} /> | ||
| <Title3Black color={colorLookup('text.secondary')}>+</Title3Black> | ||
| {/* eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-require-imports*/} | ||
| <Image source={require('assets/logos/Nokian_Tyres_Logo.jpg')} resizeMode="contain" style={styles.sponsorLogo} /> |
There was a problem hiding this comment.
we have both jpg and png (and we are using jpg and not png it looks like), historically png is better to use, but since we dont support dark mode this wont be an issue for now most likely
There was a problem hiding this comment.
Good point. I just downloaded their black and white logos from the Nokian asset catalog that they have. I'll see if there's a PNG for the black text one.
| const NOKIAN_TYRES_URL = 'https://na.nokiantyres.com/?utm_medium=referral&utm_source=3rd%20Party&utm_campaign=Nokian_Tyres_Avy'; | ||
| const SponsorDrawer: React.FunctionComponent<{visible: boolean; onDismiss: () => void}> = ({visible, onDismiss}) => { | ||
| const visitNokianTyres = useCallback(() => { | ||
| void WebBrowser.openBrowserAsync(NOKIAN_TYRES_URL); |
There was a problem hiding this comment.
maybe lets catch and show an error in case we cant open the browser for any reason?
| ); | ||
| }; | ||
|
|
||
| const NOKIAN_TYRES_URL = 'https://na.nokiantyres.com/?utm_medium=referral&utm_source=3rd%20Party&utm_campaign=Nokian_Tyres_Avy'; |
There was a problem hiding this comment.
do we have a better place to put this URL so it doesnt get lost? maybe makes sense to make a sponsor.ts in data that would look something like this (if we add new sponsors this hopefully makes it easier too)
// data/sponsors.ts
export interface Sponsor {
id: string;
displayName: string;
campaignUrl: string;
// eslint-disable-next-line @typescript-eslint/no-require-imports
logo: number; // require('assets/logos/…')
logoSnow: number; // white-on-dark variant for splash
logoAspectRatio: number; // width / height, drops the 416/1024 magic numbers
drawerBlurb: string;
splashBlurb: string; // "IN PARTNERSHIP WITH"
}
export const TITLE_SPONSOR: Sponsor = {
id: 'nokian-tyres',
displayName: 'Nokian Tyres',
campaignUrl:
'https://na.nokiantyres.com/?utm_medium=referral&utm_source=3rd%20Party&utm_campaign=Nokian_Tyres_Avy',
logo: require('assets/logos/Nokian_Tyres_Logo.jpg'),
logoSnow: require('assets/logos/Nokian_Tyres_Snow.png'),
logoAspectRatio: 1024 / 416,
drawerBlurb:
'Nokian Tyres invented the winter tire in 1934…',
splashBlurb: 'IN PARTNERSHIP WITH',
};| return; | ||
| } | ||
| opacity.value = withTiming(0, {duration: FADE_OUT_DURATION_MS}); | ||
| const timeout = setTimeout(handleFadeComplete, FADE_OUT_DURATION_MS); |
There was a problem hiding this comment.
Have not verified this - so apply as you see this.
claude tells me that setTimeout may cause a delay on slower devices where after you tap out of the sponsor logo, your first click for a zone may not go through. It suggests this instead
useEffect(() => {
if (!dismissed) return;
opacity.value = withTiming(
0,
{duration: FADE_OUT_DURATION_MS},
(finished) => {
if (finished) runOnJS(handleFadeComplete)();
},
);
}, [dismissed, opacity, handleFadeComplete]);also it says to add pointerEvents so even during the fade the view lets touches through.
<Animated.View
pointerEvents={dismissed ? 'none' : 'auto'}
style={[StyleSheet.absoluteFill, {backgroundColor: SPLASH_BACKGROUND_COLOR}, rootStyle]}
>There was a problem hiding this comment.
Nice I removed the pointer events so that the touches wouldn't go through the new splash screen but this is better
The Nokian Tyre sponsorship is being added to 3 areas: the splash screen, the Drawer, and the FRE
Splash Screen
The
splash.pngfile was removed in favor of usingavy-logo-transparent.pngfor the splash screen. The main reason for this is that full screen images were deprecated for splash screens, and, also, the smaller asset allows us to have more control over the image.The new flow for the splash screen is that we're now always showing the "mirrored" splash screen view that we used to show only when load up was taking a long time. The view was broken out into the
SponsorSplashScreenfile.SponsorSplashScreenshows the Avy logo in the same exact spot as the built in splash screen, and animates in the Nokian logo.This view was added directly into the
BaseAppViewto allow for a smooth transition between theSponsorSplashScreenand the app's content.SplashScreenContextwas added to prevent theAvalancheCenterSelectorModalfrom showing while theSponsorSplashScreenwas still visible.Demo: https://github.com/user-attachments/assets/0af7eada-24d0-4c3f-a30f-1444d4597683
Drawer
A new sponsor section was added to the top of the
Drawerthat predominantly shows Nokian as our sponsor. When a user taps on the section it opens the newDrawerModalto explain more about the partnership and to give users the option to go to the Nokian site using our campaign URL.FRE
The Nokian logo and an extra bullet point was added to the FRE that we're going to show with the release of the map project

Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.