Skip to content

Commit

Permalink
Merge branch 'main' into fix-relative-time
Browse files Browse the repository at this point in the history
  • Loading branch information
kkosiorowska authored Nov 15, 2024
2 parents 42f06c8 + 92f66fd commit f0a535a
Show file tree
Hide file tree
Showing 16 changed files with 57 additions and 384 deletions.
3 changes: 3 additions & 0 deletions dapp/src/components/Header/ConnectWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
IconWallet,
IconUserCode,
} from "@tabler/icons-react"
import { useMatch } from "react-router-dom"

function isChangeAccountFeatureSupported(embeddedApp: string | undefined) {
return referralProgram.isEmbedApp(embeddedApp)
Expand All @@ -37,6 +38,7 @@ export default function ConnectWallet() {
variant: "card",
size: "lg",
})
const isDashboardPage = useMatch("/dashboard")

const handleConnectWallet = (isReconnecting: boolean = false) => {
openModal(MODAL_TYPES.CONNECT_WALLET, { isReconnecting })
Expand All @@ -54,6 +56,7 @@ export default function ConnectWallet() {
isOpenGlobalErrorModal) && {
pointerEvents: "none",
})}
isDisabled={!isDashboardPage}
>
{`Connect ${isEmbed ? "account" : "wallet"}`}
</Button>
Expand Down
111 changes: 47 additions & 64 deletions dapp/src/components/WelcomeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
ModalBody,
ModalHeader,
Box,
ModalCloseButton,
Stepper,
Step,
StepIndicator,
Expand Down Expand Up @@ -34,7 +33,7 @@ const dappModeToContent: Record<DappMode, () => ReactElement> = {
"ledger-live": () => (
<Highlight query="Ledger Live">
Acre makes earning rewards with your BTC simple and secure. Tailored for
Ledger Live everyone, it&apos;s fun and easy to use. No advanced knowledge
Ledger Live, it&apos;s fun and easy to use. No advanced knowledge
required.
</Highlight>
),
Expand Down Expand Up @@ -79,7 +78,7 @@ const steps = [
id: 2,
title: (
<H3 fontWeight="semibold">
One dashboard{" "}
One dashboard,{" "}
<Box as="span" display="block" color="orange.30">
endless rewards
</Box>
Expand All @@ -100,18 +99,6 @@ const stepIndicatorStyleProps: StepIndicatorProps = {
sx: {
"[data-status=active] &": {
opacity: 1,
w: "4",
rounded: "6",
_after: {
content: '""',
position: "absolute",
opacity: "0.15",
w: "4",
h: "2.5",
rounded: "5",
left: "1.5",
bgColor: "orange.50",
},
},
"&[data-status=complete], [data-status=incomplete] &": {
bgColor: "orange.50",
Expand All @@ -122,7 +109,6 @@ const stepIndicatorStyleProps: StepIndicatorProps = {
h: "2.5",
rounded: "50%",
bgColor: "orange.50",
position: "relative",
opacity: "0.15",
_hover: {
cursor: "pointer",
Expand All @@ -141,55 +127,52 @@ function WelcomeModalBase({ closeModal }: BaseModalProps) {
const activeStepData = steps[activeStep]

return (
<>
<ModalCloseButton />
<SimpleGrid columns={2} templateColumns="1fr auto">
<Box>
<ModalHeader gap={3} pb={8}>
<TextSm mb="12" color="neutral.70">
Welcome to Acre,
</TextSm>
{activeStepData.title}
</ModalHeader>
<ModalBody textAlign="left" display="block" color="brown.80" px="10">
{activeStepData.content(embeddedApp)}
</ModalBody>
<ModalFooter
display="flex"
flexDirection="row"
justifyContent="space-between"
mt="14"
<SimpleGrid columns={2} templateColumns="1fr auto">
<Box>
<ModalHeader gap={3} pb={8}>
<TextSm mb="12" color="neutral.70">
Welcome to Acre,
</TextSm>
{activeStepData.title}
</ModalHeader>
<ModalBody textAlign="left" display="block" color="brown.80" px="10">
{activeStepData.content(embeddedApp)}
</ModalBody>
<ModalFooter
display="flex"
flexDirection="row"
justifyContent="space-between"
mt="14"
>
<Stepper index={activeStep} gap="3">
{steps.map((step) => (
<Step key={step.id} onClick={() => setActiveStep(step.id)}>
<StepIndicator {...stepIndicatorStyleProps} />
</Step>
))}
</Stepper>
<Button
variant={isLastStep ? undefined : "outline"}
onClick={isLastStep ? closeModal : goToNext}
>
<Stepper index={activeStep} gap="3">
{steps.map((step) => (
<Step key={step.id} onClick={() => setActiveStep(step.id)}>
<StepIndicator {...stepIndicatorStyleProps} />
</Step>
))}
</Stepper>
<Button
variant={isLastStep ? undefined : "outline"}
onClick={isLastStep ? closeModal : goToNext}
>
{isLastStep ? "Get started" : "Skip"}
</Button>
</ModalFooter>
</Box>
<Box
as="video"
src={activeStepData.video}
width="24rem"
height="full"
autoPlay
muted
loop
objectFit="cover"
roundedRight="xl"
outline="1px solid #f6ead5"
outlineOffset="-1px"
/>
</SimpleGrid>
</>
{isLastStep ? "Get started" : "Next"}
</Button>
</ModalFooter>
</Box>
<Box
as="video"
src={activeStepData.video}
width="24rem"
height="full"
autoPlay
muted
loop
objectFit="cover"
roundedRight="xl"
outline="1px solid #f6ead5"
outlineOffset="-1px"
/>
</SimpleGrid>
)
}

Expand Down
59 changes: 0 additions & 59 deletions dapp/src/components/shared/ActivitiesList/ActivitiesList.tsx

This file was deleted.

85 changes: 0 additions & 85 deletions dapp/src/components/shared/ActivitiesList/ActivitiesListItem.tsx

This file was deleted.

1 change: 0 additions & 1 deletion dapp/src/components/shared/ActivitiesList/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion dapp/src/hooks/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ export * from "./useActionFlowPause"
export * from "./useIsSignedMessage"
export { default as useHasFetchedActivities } from "./useHasFetchedActivities"
export { default as useActivities } from "./useActivities"
export { default as useLatestCompletedActivities } from "./useLatestCompletedActivities"
6 changes: 0 additions & 6 deletions dapp/src/hooks/store/useLatestCompletedActivities.ts

This file was deleted.

2 changes: 0 additions & 2 deletions dapp/src/pages/DashboardPage/DashboardCard.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import React from "react"
import { Card, CardBody, CardProps, VStack } from "@chakra-ui/react"
import { ActivitiesList } from "#/components/shared/ActivitiesList"
import TransactionHistory from "./TransactionHistory"
import PositionDetails from "./PositionDetails"

export default function DashboardCard(props: CardProps) {
return (
<Card p="dashboard_card_padding" overflow="hidden" {...props}>
<CardBody as={VStack} spacing={10}>
<ActivitiesList />
<PositionDetails />
<TransactionHistory />
</CardBody>
Expand Down
1 change: 1 addition & 0 deletions dapp/src/pages/WelcomePage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function WelcomePage() {

return (
<WelcomeModal
closeOnEsc={false}
closeModal={() => {
setShouldDisplayWelcomeModal(false)
navigate("/dashboard")
Expand Down
Loading

0 comments on commit f0a535a

Please sign in to comment.