This repository has been archived by the owner on Nov 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 363
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: rebranding widget on dashboard (#4059)
* Feat: rebranding widger on dashboard * Rm mobile banner events * Update dashboard e2e tests * Rm unnecessary container * Hide beamer icon * Fix animated logo on mobile * Add important * style: Update banner image Co-authored-by: Usame Algan <[email protected]>
- Loading branch information
1 parent
e849047
commit 180e3ea
Showing
16 changed files
with
72 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { ReactElement } from 'react' | ||
import { useDispatch } from 'react-redux' | ||
import Track from 'src/components/Track' | ||
import { BannerCookiesType, COOKIES_KEY, COOKIE_IDS } from 'src/logic/cookies/model/cookie' | ||
import { openCookieBanner } from 'src/logic/cookies/store/actions/openCookieBanner' | ||
import { loadFromCookie } from 'src/logic/cookies/utils' | ||
import styled from 'styled-components' | ||
import { WidgetContainer, WidgetTitle } from '../styled' | ||
|
||
// Banner + hide anything inside, incl. the Beamer icon | ||
const StyledContainer = styled.div` | ||
width: 474px; | ||
height: 227px; | ||
background: url('./rebranding-banner.png') no-repeat 0 0; | ||
background-size: contain; | ||
cursor: pointer; | ||
& * { | ||
display: none !important; | ||
} | ||
` | ||
|
||
const RebrandingBanner = (): ReactElement => { | ||
const dispatch = useDispatch() | ||
|
||
const onClick = (): void => { | ||
const cookiesState = loadFromCookie<BannerCookiesType>(COOKIES_KEY) | ||
if (!cookiesState) { | ||
dispatch(openCookieBanner({ cookieBannerOpen: true })) | ||
return | ||
} | ||
if (!cookiesState.acceptedSupportAndUpdates) { | ||
dispatch( | ||
openCookieBanner({ | ||
cookieBannerOpen: true, | ||
key: COOKIE_IDS.BEAMER, | ||
}), | ||
) | ||
} | ||
} | ||
|
||
return ( | ||
<WidgetContainer> | ||
<WidgetTitle> </WidgetTitle> | ||
|
||
<Track category="rebranding" action="banner-click"> | ||
<StyledContainer onClick={onClick} className="beamer-trigger" /> | ||
</Track> | ||
</WidgetContainer> | ||
) | ||
} | ||
|
||
export default RebrandingBanner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters