-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(core,extension): LW-9743 revamp "Save your recovery phrase" screen #919
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
@import '../../../../../common/src/ui/styles/abstracts/typography'; | ||
|
||
.container { | ||
height: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
gap: size_unit(6); | ||
|
||
.content { | ||
display: flex; | ||
flex-direction: column; | ||
gap: size_unit(2); | ||
|
||
.title { | ||
@include text-heading; | ||
color: var(--text-color-primary, #3d3b39); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure if we need #3d3b39 as a fallback. I mean, if we lack --text-color-primary we would not notice it. |
||
margin: 0; | ||
} | ||
|
||
.description { | ||
font-size: var(--body) !important; | ||
line-height: size_unit(3) !important; | ||
color: var(--text-color-primary, #3d3b39); | ||
margin: 0; | ||
} | ||
|
||
.videoContainer { | ||
position: relative; | ||
height: 272px; | ||
border-radius: 16px; | ||
border: 1px solid #efefef; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we don't use --text-color-secondary or similar instead of #efefef? |
||
|
||
.overlay { | ||
z-index: 1; | ||
position: absolute; | ||
width: 100%; | ||
height: 100%; | ||
border-radius: 16px; | ||
top: 0; | ||
left: 0; | ||
opacity: 0; | ||
} | ||
|
||
.video { | ||
width: 100%; | ||
height: 100%; | ||
border-radius: 16px; | ||
border: none; | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { Button } from '@lace/ui'; | ||
import { TranslationsFor } from '@ui/utils/types'; | ||
import { urls } from '@ui/utils/constants'; | ||
import React, { ReactElement, useRef, useState } from 'react'; | ||
import styles from './MnemonicVideoPopupContent.module.scss'; | ||
|
||
type MnemonicVideoPopupContentProps = { | ||
onClickVideo: () => void; | ||
onClose: () => void; | ||
translations: TranslationsFor<'title' | 'description' | 'linkText' | 'closeButton'>; | ||
videoSrc: string; | ||
}; | ||
|
||
export const MnemonicVideoPopupContent = ({ | ||
onClickVideo, | ||
onClose, | ||
translations, | ||
videoSrc | ||
}: MnemonicVideoPopupContentProps): ReactElement => { | ||
const [overlayVisible, setOverlayVisible] = useState(true); | ||
const videoRef = useRef<HTMLIFrameElement>(); | ||
|
||
return ( | ||
<div className={styles.container}> | ||
<div className={styles.content} data-testid="wallet-setup-step-header"> | ||
<h1 className={styles.title}>{translations.title}</h1> | ||
<p className={styles.description}> | ||
{translations.description}{' '} | ||
<a href={urls.faq.secretPassphrase} target="_blank" data-testid="faq-secret-passphrase-url"> | ||
{translations.linkText} | ||
</a> | ||
</p> | ||
<div | ||
className={styles.videoContainer} | ||
onClick={() => { | ||
setOverlayVisible(false); | ||
videoRef.current.src += '&autoplay=1'; | ||
onClickVideo(); | ||
}} | ||
> | ||
{overlayVisible && <div className={styles.overlay} />} | ||
<iframe | ||
ref={videoRef} | ||
className={styles.video} | ||
src={videoSrc} | ||
title="YouTube video player" | ||
allow="accelerometer; fullscreen; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" | ||
data-testid="mnemonic-intro-yt-video-frame" | ||
/> | ||
</div> | ||
</div> | ||
<Button.CallToAction label={translations.closeButton} onClick={onClose} /> | ||
</div> | ||
); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good adding TODOs with a JIRA ticket 💪