Skip to content
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

Sim: Alternate copy #11043

Closed
wants to merge 192 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
192 commits
Select commit Hold shift + click to select a range
c5db280
add button stack for path options
wackerow Aug 8, 2023
edd0c24
extract pathOption interface
wackerow Aug 8, 2023
e923e2a
switch to Chakra button
wackerow Aug 8, 2023
82f2bfa
Create Simulator.tsx
wackerow Aug 8, 2023
134f32b
use Simulator component on page
wackerow Aug 8, 2023
aa6d84c
adjust responsiveness
wackerow Aug 8, 2023
08db6b2
init SimulatorModal
wackerow Aug 8, 2023
fdee3e1
remove onClick from PathButton
wackerow Aug 9, 2023
3bd545e
add Phone.tsx component
wackerow Aug 9, 2023
ac54716
refactor SimulatorModel to custom modal
wackerow Aug 9, 2023
2ce1169
init simulator Template
wackerow Aug 9, 2023
560735d
Update Simulator.tsx
wackerow Aug 9, 2023
863c0fb
fix SimulatorModal sizing
wackerow Aug 14, 2023
acfbf09
update Phone components
wackerow Aug 14, 2023
8b239a3
init controller interface
wackerow Aug 14, 2023
1868528
mobile responsiveness
wackerow Aug 14, 2023
0ff8a9b
extract StartingPoint component
wackerow Aug 14, 2023
8e7f6b6
Update simulator.tsx
wackerow Aug 14, 2023
3bb66c9
add temp test pathway data
wackerow Aug 14, 2023
36a7051
Create Explanation.tsx
wackerow Aug 16, 2023
c5c23dc
Create ProgressCta.tsx
wackerow Aug 17, 2023
7b69635
Create HomeScreen.tsx
wackerow Aug 17, 2023
508c28a
Update Phone.tsx
wackerow Aug 17, 2023
3e0b9fb
export component from index
wackerow Aug 17, 2023
f0bd2d1
Update interfaces.ts
wackerow Aug 17, 2023
25b0a49
add pathId, update data for components
wackerow Aug 17, 2023
6f23025
update Simulator Template
wackerow Aug 17, 2023
59197dd
add EthGlyphIcon
wackerow Aug 18, 2023
9597472
update components
wackerow Aug 18, 2023
9c34f86
update components
wackerow Aug 18, 2023
3931443
restrict helper animation to first step
wackerow Aug 18, 2023
f134e08
update SimulatorModal and template
wackerow Aug 20, 2023
81dcae7
Update Explanation.tsx
wackerow Aug 20, 2023
4b76ef6
Update Explanation.tsx
wackerow Aug 21, 2023
1e7aaeb
update Phone screens
wackerow Aug 21, 2023
fde69a4
Update HomeScreen.tsx
wackerow Aug 21, 2023
ee3e103
adjust Phone width
wackerow Aug 21, 2023
a409d6f
Update HomeScreen.tsx
wackerow Aug 21, 2023
0ccee9c
use Emoji component
wackerow Aug 21, 2023
08ff3a3
Update Phone.tsx
wackerow Aug 21, 2023
6003e4b
Update ProgressCta.tsx
wackerow Aug 21, 2023
da3bb1f
Update Phone and ProgressCta
wackerow Aug 21, 2023
36f3429
extract screen components out of Phone
wackerow Aug 21, 2023
3413fca
extract simulator data
wackerow Aug 21, 2023
301ae8e
implement simulator data in components
wackerow Aug 21, 2023
f7c9db5
add path summaries to simulatorData
wackerow Aug 21, 2023
c6faf3f
implement pathId prop
wackerow Aug 21, 2023
361a28b
remove dev button
wackerow Aug 21, 2023
ffc09f7
add seed phrase word selector interactivity
wackerow Aug 22, 2023
0cd240e
adjust phone frame
wackerow Aug 22, 2023
064af78
update selector interactivity
wackerow Aug 22, 2023
004aafb
Merge branch 'dev' into simulator
wackerow Aug 22, 2023
1f140d2
Add NewWalletPreview with icons
wackerow Aug 22, 2023
0d81740
add final step to create-account
wackerow Aug 22, 2023
124b6b0
add placeholder for send-receive and connect-web3
wackerow Aug 22, 2023
d6e8c67
clean up
wackerow Aug 22, 2023
7d174d0
layout adjustments
wackerow Aug 23, 2023
7629475
rearrange state management
wackerow Aug 23, 2023
c2e6bd6
further state management updates
wackerow Aug 24, 2023
c43772b
extract CreateAccount components
wackerow Aug 24, 2023
3cfd41b
patch phone width
wackerow Aug 24, 2023
f330239
rm extra header text
wackerow Aug 24, 2023
6087627
reduce mobile font size for notice
wackerow Aug 24, 2023
ec47e20
rm console logs
wackerow Aug 24, 2023
82f07fe
Update HomeScreen.tsx
wackerow Aug 24, 2023
32171eb
extract Wallet components
wackerow Aug 24, 2023
7b5cecb
Update SimulatorModal.tsx
wackerow Aug 24, 2023
42b8fbe
fix: keep answer buttons toward beginning
wackerow Aug 24, 2023
e5172fc
trim space on mobile initial word list
wackerow Aug 24, 2023
bbe98d0
Update copy
wackerow Aug 24, 2023
f91d864
regenerate words on GeneratingKeys load
wackerow Aug 24, 2023
3223d83
adjust animation on welcome screen
wackerow Aug 24, 2023
8c7a78d
update SimulatorData interface
wackerow Aug 24, 2023
5031059
add finalCtaLink to data interface
wackerow Aug 24, 2023
512c788
move simulator interfaces inside Simulator folder
wackerow Aug 24, 2023
f5e2982
create-account: fine tuned styling adjustments
wackerow Aug 24, 2023
68aee9a
Animate GeneratingKeys.tsx
wackerow Aug 24, 2023
2918b4a
Animate GeneratingKeys.tsx
wackerow Aug 25, 2023
d1f5e70
Animate word selector, add autocomplete
wackerow Aug 25, 2023
8936ed8
Add MoreInfoPopover.tsx
wackerow Aug 25, 2023
a8f269e
Implement MoreInfoPopover
wackerow Aug 25, 2023
bbdc447
fix explanation description conditional display
wackerow Aug 25, 2023
8dff7be
rename NewWalletPreview to WalletHome
wackerow Aug 25, 2023
c31e030
update balance number format
wackerow Aug 25, 2023
84f3086
CreateAccount adjustments per review
wackerow Aug 25, 2023
7af55a6
hide helper on hover
wackerow Aug 27, 2023
a5bde19
add generateInvalidSafeSeed
wackerow Aug 27, 2023
3e9b5e0
feat: SendReceive to accept state props
wackerow Aug 28, 2023
7bfe2ac
update data with SendReceive step explanations
wackerow Aug 28, 2023
f9602f7
update data with ConnectWeb3 step explanations
wackerow Aug 28, 2023
23f9fec
Add ReceiveEther.tsx screen
wackerow Aug 28, 2023
9460333
add send ether welcome screen
wackerow Aug 28, 2023
d5bf611
Add SendEther screen
wackerow Aug 28, 2023
fb2b796
update ProgressCta to accept isDisabled prop
wackerow Aug 28, 2023
7285fd4
rename CategoryTabs component for general purpose
wackerow Aug 28, 2023
02967e4
use ProgressCta
wackerow Aug 28, 2023
03e6711
Add SendFromContacts component
wackerow Aug 28, 2023
2dc8e2c
Add SendSummary and Success screens
wackerow Aug 28, 2023
75cf035
add useEthPrice hook
wackerow Aug 29, 2023
aa1e7cc
Add Web3App.tsx
wackerow Aug 29, 2023
471d5dc
Add Slider.tsx
wackerow Aug 29, 2023
02edf13
Update ConnectWeb3.tsx
wackerow Aug 29, 2023
d3351be
clean up final cta links
wackerow Aug 29, 2023
cb19653
implement useEthPrice in SendReceive
wackerow Aug 29, 2023
e91b380
patch icon stroke color
wackerow Aug 29, 2023
2133409
mobile adjustments
wackerow Aug 29, 2023
bd0e719
fix mobile layout for stepper in Explanation
wackerow Aug 29, 2023
31b862b
fix mobile modal horizontal overflow
wackerow Aug 29, 2023
22206e3
thinner phone border
wackerow Aug 29, 2023
cc62aee
fix back arrow
wackerow Aug 29, 2023
4e04e32
fix dark colors, icon adjustments
wackerow Aug 30, 2023
61b81e1
fix QrCodeIcon color
wackerow Aug 30, 2023
73f0779
Merge branch 'dev' into simulator
wackerow Aug 30, 2023
ce75d5d
patch phone shadow color
wackerow Aug 30, 2023
3be630c
fix mobile ReceiveEther
wackerow Aug 30, 2023
1e9ff01
fix bugs, add animations
wackerow Aug 30, 2023
0e9ec48
remove animated arrow
wackerow Aug 30, 2023
fe1c731
restrict pulse animation to Receive button
wackerow Aug 30, 2023
88f4cc3
fixes button actions not re-rendering
wackerow Aug 30, 2023
9db1055
fixes and style improvement
wackerow Aug 30, 2023
c685fa6
fix svg react syntax casing
wackerow Aug 30, 2023
3f6abb4
add query param navigation
wackerow Aug 30, 2023
902ba51
convert usd display to use intl currency
wackerow Aug 30, 2023
96f7349
rm dev logging
wackerow Aug 31, 2023
3e6db89
fix popover spacing
wackerow Aug 31, 2023
5a26a9b
feat auto-open mobile MoreInfo, checkbox prevents
wackerow Aug 31, 2023
df042d1
Update path icons
wackerow Aug 31, 2023
a1307ba
patch PathButton layout
wackerow Aug 31, 2023
d614bff
copy updates for create-account sim
wackerow Aug 31, 2023
6d37550
copy updates for send-receive sim
wackerow Aug 31, 2023
b1718fb
design adjustments
wackerow Aug 31, 2023
a7b3adc
shrink fontSize for contact last action
wackerow Aug 31, 2023
249ff07
add ETH conversion for network fee
wackerow Sep 1, 2023
4f336c0
Merge branch 'simulator' into sim-narrated
wackerow Sep 1, 2023
99aede8
assign fake demo address to constant
wackerow Sep 1, 2023
d88955e
Merge branch 'simulator' into sim-narrated
wackerow Sep 1, 2023
572ea75
copy updates for connect-web3 sim
wackerow Sep 1, 2023
eaeac13
Update MoreInfoPopover.tsx
wackerow Sep 1, 2023
7c06952
Add AddressPill component
wackerow Sep 1, 2023
86e4086
removed "step" URL param
wackerow Sep 1, 2023
4f66162
Merge branch 'simulator' into sim-narrated
wackerow Sep 1, 2023
1f17f1f
patch updates
wackerow Sep 1, 2023
237bc70
Merge branch 'simulator' into sim-narrated
wackerow Sep 1, 2023
8cf60ca
hide back button on first step
wackerow Sep 1, 2023
c970321
Merge branch 'simulator' into sim-narrated
wackerow Sep 1, 2023
fbcda9a
feat: share on twitter button
wackerow Sep 1, 2023
ba348a5
Add Matomo event tracking
wackerow Sep 3, 2023
6a75ca4
remove use of window and useState for pathId
wackerow Sep 5, 2023
63461ce
refactor Template contents
wackerow Sep 6, 2023
843b14b
refactor ProgressCta button
wackerow Sep 6, 2023
4c012ab
extract util getValidPathId
wackerow Sep 6, 2023
8257044
pass data from parent, make StartingPoint reusable
wackerow Sep 6, 2023
571ef89
Merge branch 'simulator' into sim-narrated
wackerow Sep 6, 2023
8e6aeca
copy update
wackerow Sep 6, 2023
dee897f
copy updates per review
wackerow Sep 6, 2023
10086b3
use primary.base for pulse animation
wackerow Sep 6, 2023
6c365ff
reorganize screen component file structure
wackerow Sep 6, 2023
501264a
clean up
wackerow Sep 6, 2023
c5ce608
implement sims on english wallets page
wackerow Sep 6, 2023
95e0979
Update share button on Explanation
wackerow Sep 6, 2023
fd326a1
Merge branch 'simulator' into sim-narrated
wackerow Sep 6, 2023
7a74820
rename "state" to "nav"
wackerow Sep 6, 2023
bc0c7e5
update MoreInfoPopover with animated first step
wackerow Sep 6, 2023
a9eccfc
adjust mobile padding
wackerow Sep 6, 2023
1723ac5
Merge branch 'simulator' into sim-narrated
wackerow Sep 6, 2023
04f4889
fix positioning
wackerow Sep 7, 2023
3270f83
fix: anchor window position to starting point
wackerow Sep 7, 2023
994ebaf
clean up data
wackerow Sep 7, 2023
96b4b4a
feat: add animated ReceivedEther component
wackerow Sep 7, 2023
fe21e88
Merge branch 'simulator' into sim-narrated
wackerow Sep 7, 2023
03764b9
extract PulseAnimation component
wackerow Sep 8, 2023
fe3e031
feat: Add ClickAnimation component
wackerow Sep 8, 2023
a15aa21
update PulseAnimation
wackerow Sep 8, 2023
6a7fd72
Merge branch 'simulator' into sim-narrated
wackerow Sep 8, 2023
5db4106
restructure Simulator file system
wackerow Sep 8, 2023
6770657
delay Send button until funds received
wackerow Sep 8, 2023
7b86cf2
Merge branch 'simulator' into sim-narrated
wackerow Sep 8, 2023
0dc3e16
refine getValidPathId
wackerow Sep 8, 2023
b940cca
Merge branch 'simulator' into sim-narrated
wackerow Sep 8, 2023
f3d08c4
use getData for fetch cacheing
wackerow Sep 8, 2023
e780a28
clean up
wackerow Sep 8, 2023
c4f7e3a
Merge branch 'simulator' into sim-narrated
wackerow Sep 8, 2023
f3c9a18
typo patch
wackerow Sep 8, 2023
cc6a24c
design adjustments
wackerow Sep 8, 2023
e6fc1e3
Merge branch 'simulator' into sim-narrated
wackerow Sep 8, 2023
7322b1a
patch phone spacing
wackerow Sep 10, 2023
c29101a
Merge branch 'simulator' into sim-narrated
wackerow Sep 10, 2023
0bc85a1
patch missing import
wackerow Sep 10, 2023
5861752
patch missing step copy
wackerow Sep 10, 2023
4789f57
patch alignment
wackerow Sep 10, 2023
038b936
fixes from reviews and feedback
wackerow Sep 11, 2023
08a3409
apply suggestions from code reviews/feedback
wackerow Sep 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added src/assets/deep-panic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions src/components/PageHero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,8 @@ const PageHero: React.FC<IProps> = ({
{buttons.map((button, idx) => {
if (isButtonLink(button)) {
return (
<WrapItem>
<WrapItem key={idx}>
<ButtonLink
key={idx}
variant={button.variant}
to={button.to}
onClick={() =>
Expand Down
71 changes: 71 additions & 0 deletions src/components/Simulator/ClickAnimation.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import React, { useEffect, useState } from "react"
import { createIcon, Flex, Text, TextProps } from "@chakra-ui/react"
import { motion, type Transition } from "framer-motion"

const MotionFlex = motion(Flex)

const DownArrowLong = motion(
createIcon({
displayName: "DownArrowLong",
viewBox: "0 0 8 24",
defaultProps: { fill: "currentColor" },
path: (
<path d="M3.64645 23.3536C3.84171 23.5488 4.15829 23.5488 4.35355 23.3536L7.53553 20.1716C7.7308 19.9763 7.7308 19.6597 7.53553 19.4645C7.34027 19.2692 7.02369 19.2692 6.82843 19.4645L4 22.2929L1.17157 19.4645C0.976312 19.2692 0.659729 19.2692 0.464467 19.4645C0.269205 19.6597 0.269205 19.9763 0.464467 20.1716L3.64645 23.3536ZM3.5 2.18557e-08L3.5 23L4.5 23L4.5 -2.18557e-08L3.5 2.18557e-08Z" />
),
})
)

interface IProps extends Pick<TextProps, "children"> {
below?: boolean
delay?: number
}
export const ClickAnimation: React.FC<IProps> = ({
below,
delay = 5000,
children,
}) => {
const [visible, setVisible] = useState(false)
useEffect(() => {
const timeout = setTimeout(() => setVisible(true), delay)
return () => clearTimeout(timeout)
}, [])
const transition: Transition = {
duration: 2.5,
times: [0, 0.25, 0.5],
repeat: Infinity,
}
const top = below ? "calc(100% + 0.5rem)" : "auto"
const bottom = below ? "auto" : "calc(100% + 1rem)"
const y = below ? [0, 20, 0] : [0, -20, 0]
const direction = below ? "column-reverse" : "column"
const transformOrigin = below ? { bottom: 0 } : { top: 0 }
const rotate = below ? 180 : 0
return visible ? (
<MotionFlex
animate={{ opacity: [0, 1] }} // Fade in once
position="absolute"
top={top}
justify="center"
bottom={bottom}
insetInline={0}
color="primary.base"
>
<MotionFlex
direction={direction}
alignItems="center"
animate={{ y }} // Slide up and down
transition={transition}
>
<Text fontSize="xs" fontStyle="italic" textTransform="lowercase" m={0}>
{children}
</Text>
<DownArrowLong
transformOrigin={transformOrigin}
initial={{ scaleY: 1, rotate }}
animate={{ scaleY: [1, 1.25, 1] }} // Arrow scales up and down
transition={transition}
/>
</MotionFlex>
</MotionFlex>
) : null
}
152 changes: 152 additions & 0 deletions src/components/Simulator/Explanation.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
import React from "react"
import { Box, type BoxProps, Flex, Text, Grid, Divider } from "@chakra-ui/react"
import { MdArrowBack } from "react-icons/md"
import Button from "../Button"
import type {
LabelHref,
SimulatorExplanation,
SimulatorPathSummary,
SimulatorNavProps,
} from "./interfaces"
import type { PathId } from "./types"
import { MoreInfoPopover } from "./MoreInfoPopover"
import { PathButton } from "./PathButton"
import ButtonLink from "../ButtonLink"
import Link from "../Link"
import { motion } from "framer-motion"
import { shareOnTwitter } from "./utils"
import { FaTwitter } from "react-icons/fa"

interface ExplanationProps extends SimulatorNavProps {
explanation: SimulatorExplanation
nextPathSummary: SimulatorPathSummary | null
nextPathId: PathId | null
finalCtaLink: LabelHref
openPath?: (pathId: PathId) => void
logFinalCta?: () => void
}
export const Explanation: React.FC<ExplanationProps> = ({
nav,
explanation,
nextPathSummary,
nextPathId,
finalCtaLink,
openPath,
logFinalCta,
}) => {
const { regressStepper, step, totalSteps } = nav
const { header, description } = explanation

const Description: React.FC<BoxProps> = (props) => (
<Box {...props}>{description}</Box>
)
const isLastStep = nav.step + 1 === totalSteps

const backButtonVariants = {
visible: { opacity: 1 },
hidden: { opacity: 0 },
}
return (
<Flex direction="column" flex={1} zIndex={1}>
{/* Back button */}
<Button
as={motion.button}
variant="ghost"
leftIcon={<MdArrowBack size="18px" />}
sx={{ paddingInlineStart: 0 }}
mt={{ base: -6, md: 0 }}
mb={{ base: 2, md: 8 }}
onClick={regressStepper}
pointerEvents={step === 0 ? "none" : "all"}
variants={backButtonVariants}
initial="hidden"
animate={step === 0 ? "hidden" : "visible"}
transitionDuration="10ms"
w="fit-content"
>
Back
</Button>
<Flex direction={{ base: "row", md: "column" }} gap={{ base: 3, md: 2 }}>
{/* Step counter */}
<Grid
placeItems="center"
bg="body.light"
borderRadius="lg"
p={2}
w={9}
h={8}
fontSize="xs"
>
<Text as="span" lineHeight={1} fontWeight="bold" m={0}>
{step + 1}/{totalSteps}
</Text>
</Grid>
{/* Header and description */}
<Box>
<Text
fontSize={{ base: "xl", sm: "2xl", md: "3xl", lg: "4xl" }}
lineHeight={{ base: 8, md: 10 }}
fontWeight="bold"
mb={{ base: 4, md: 8 }}
>
{header}
</Text>
{description && (
<Box display={{ base: "block", md: "none" }} position="relative">
<MoreInfoPopover isFirstStep={nav.step === 0}>
<Description />
</MoreInfoPopover>
</Box>
)}
</Box>
</Flex>
{description && <Description display={{ base: "none", md: "block" }} />}
{/* Last step navigation buttons */}
{isLastStep && (
<Flex
direction="column"
gap={4}
maxW="300px"
w="full"
mx={{ base: "auto", md: 0 }}
mt={4}
zIndex={-1}
>
{nextPathSummary && openPath && nextPathId && (
<PathButton
pathSummary={nextPathSummary}
handleClick={() => openPath(nextPathId)}
/>
)}
{/* TODO: Decide on button/link approach and remove unused */}
{/* <ButtonLink
variant={finalCtaLink.isPrimary ? "solid" : "outline"}
href={finalCtaLink.href}
onClick={logFinalCta}
>
{finalCtaLink.label}
</ButtonLink> */}
<Flex alignItems="center" gap={6}>
<Divider borderColor="body.medium" />
<Text textTransform="uppercase" m={0} color="body.medium">
or
</Text>
<Divider borderColor="body.medium" />
</Flex>
<Link href={finalCtaLink.href} isExternal onClick={logFinalCta}>
{finalCtaLink.label}
</Link>
<Button
variant="outline-color"
leftIcon={<FaTwitter />}
onClick={shareOnTwitter}
w={{ base: "full", lg: "auto" }}
mt={{ base: 2, lg: 0 }}
>
Share on Twitter
</Button>
</Flex>
)}
</Flex>
)
}
64 changes: 64 additions & 0 deletions src/components/Simulator/MoreInfoPopover.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import {
Popover,
PopoverTrigger,
Button,
Icon,
PopoverContent,
PopoverArrow,
PopoverBody,
type PopoverBodyProps,
PopoverCloseButton,
PopoverHeader,
} from "@chakra-ui/react"
import { motion } from "framer-motion"
import React, { useState } from "react"
import { MdInfoOutline } from "react-icons/md"
import { PulseAnimation } from "./PulseAnimation"

const MotionButton = motion(Button)

interface IProps extends Pick<PopoverBodyProps, "children"> {
isFirstStep: boolean
}
export const MoreInfoPopover: React.FC<IProps> = ({
isFirstStep,
children,
}) => {
const [clicked, setClicked] = useState(false)
return (
<Popover>
<PopoverTrigger>
<MotionButton
rightIcon={<Icon as={MdInfoOutline} size={24} />}
variant="ghost"
sx={{ paddingInlineStart: 0 }}
color="body.medium"
fontSize="sm"
p={0}
onClick={() => setClicked(true)}
position="relative"
>
More info
{isFirstStep && !clicked && <PulseAnimation type="narrow-button" />}
</MotionButton>
</PopoverTrigger>
<PopoverContent
bg="background.highlight"
px={4}
py={6}
insetStart={{ base: 4, sm: 8 }}
maxW={{ base: "calc(100vw - 3rem)", sm: "calc(100vw - 5rem)" }}
borderRadius="base"
boxShadow="tooltip"
>
<PopoverArrow bg="background.highlight" boxShadow="2xl" />
<PopoverHeader mb={2}>
<PopoverCloseButton ms="auto" />
</PopoverHeader>
<PopoverBody sx={{ "p:last-of-type": { mb: 2 } }}>
{children}
</PopoverBody>
</PopoverContent>
</Popover>
)
}
46 changes: 46 additions & 0 deletions src/components/Simulator/PathButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import React from "react"
import { Button, Flex, Text } from "@chakra-ui/react"
import type { SimulatorPathSummary } from "./interfaces"

interface IProps {
pathSummary: SimulatorPathSummary
handleClick: () => void
}
export const PathButton: React.FC<IProps> = ({ pathSummary, handleClick }) => {
const { primaryText, secondaryText, Icon } = pathSummary
return (
<Button
variant="outline"
leftIcon={<Icon />}
justifyContent="start"
gap={3}
textAlign="start"
w="full"
py={6}
onClick={handleClick}
>
<Flex direction="column" as="span">
<Text
as="span"
fontWeight="bold"
m={0}
lineHeight={6}
letterSpacing="-1.1%"
>
{primaryText}
</Text>
{secondaryText && (
<Text
as="span"
m={0}
color="body.medium"
fontSize="xs"
lineHeight={5}
>
{secondaryText}
</Text>
)}
</Flex>
</Button>
)
}
35 changes: 35 additions & 0 deletions src/components/Simulator/Phone.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React from "react"
import { Box, type BoxProps } from "@chakra-ui/react"

interface IProps extends Pick<BoxProps, "children"> {}
export const Phone: React.FC<IProps> = ({ children }) => (
<Box as="figure" minW="min(100%, 322px)" maxW="min(100%, 322px)" mx="auto">
{/* Phone frame */}
<Box
h={{ base: 480, md: 600 }}
maxH="full"
w="full"
border="5px solid"
borderColor="body.medium"
borderRadius="3xl"
bg="background.base"
position="relative"
zIndex={0}
overflow="hidden"
>
{children}
</Box>
{/* Phone drop shadow */}
<Box
h={6}
mb={-6}
w="full"
borderRadius="100%"
position="relative"
filter="blur(14px)"
bg="black"
opacity={0.4}
zIndex={-1}
/>
</Box>
)
Loading
Loading