-
Notifications
You must be signed in to change notification settings - Fork 4
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
Landing page's SeasonCountdownSection
component
#368
Conversation
Adjusted section's background, added additional theme spacing values, adjusted Tag component theme, fixed potential memory leak in background dynamic noise seed.
✅ Deploy Preview for acre-dapp-testnet ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Please add information about the number of the closed task in PR description:
Closes: #368
I mean using a link to a task related to this PR (#368), not to an epic (#355) :) |
I don't see any problems. I indicated the issue #355 (not epic) as a reference to this PR. |
Ahh, I assumed that every PR created refers to a subtask created in #355 :) In the future, let's try to create PR per task, and provide the division you used in separate commits 👍🏻 |
Screen.Recording.2024-04-17.at.18.52.16.movLet's update the cursor type to default on hover. |
7736be0
to
e958c8e
Compare
Ref commit: b876889 |
We should catch these glitches on window resize (useSize hook should be helpful): Screen.Recording.2024-04-23.at.12.02.40.mov |
Resolved the issue. Used Ref commit: 32db87b |
Applied adjustments accordingly to Figma updates
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.
Left few non-blocking comments overall the code LGTM.
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.
I would consider moving the SeasonCountdownSection
dir to the pages/LandingPages/components
because it is rather not a shared component but specific for landing page.
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.
Ref commit: a26e6ea
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.
I agree that it should be in the pages/LandingPages
directory but I am not convinced about nesting it in the components directory. More info here.
<Box | ||
as="rect" | ||
mixBlendMode="soft-light" | ||
// TOOD: Investigate width update delay |
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.
Are we going to address it in a separate PR? Or maybe it's already addressed?
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.
It's a barely noticeable issue. Most of ppl won't even notice.
I gave it a shot and it looks like we can't do much with it. It's browser specific and depends on how the browser (Chromium in Ledger Live's case) processes SVG transformations.
Let's leave it for possible future consideration.
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.
If we want to spend more time on the investigation in the future let's create an issue and add it to the list at #154 EPIC.
If there is nothing more we can do let's live with it and remove the TODO.
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.
Done
Moved to `components` subdirectory
I still see Also, there is a weird scroll effect lot of space at the bottom. Not sure if this is intentional. Nagranie.z.ekranu.2024-04-26.o.18.29.07.mov |
There was a bug where the negative values returned by `useCountdown` hook were parsed incorrectly. This commit simplifies the approach leveraging `reduce` array method. Also added new type definition - Tuple
There is an issue with preview deployment target branch resolution as discussed on weekly call. Nevertheless by deeper analysis of I resolved it on the level of component. Perhaps we'd like to resolve it globally on the level of hook. Not sure if negative values is expected behaviour. As i said - counter intuitive to me. Ref commit: 99ba8fb |
defaultProps: { variant: "outline" }, | ||
baseStyle: { | ||
container: containerStyle, | ||
}, | ||
variants: { | ||
solid: { | ||
container: { | ||
borderWidth: 0, | ||
}, | ||
}, | ||
outline: { | ||
container: { | ||
borderColor: "white", | ||
borderWidth: 1, | ||
}, | ||
}, | ||
}, |
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.
I would like to avoid this approach. I feel that this makes the theme less readable. What do you think about it? Chakra does it similarly see here.
const multiStyleConfig = createMultiStyleConfigHelpers(parts.keys)
const baseStyleContainer = defineStyle({
borderRadius: "full",
w: "fit-content",
bg: "gold.100",
paddingX: 4,
paddingY: 2.5,
shadow: "none",
})
const baseStyle = multiStyleConfig.definePartsStyle({
container: baseStyleContainer,
})
const variantSolid = multiStyleConfig.definePartsStyle({
container: {
borderWidth: 0,
},
})
const variantOutline = multiStyleConfig.definePartsStyle({
container: {
borderColor: "white",
borderWidth: 1,
},
})
const variants = {
solid: variantSolid,
outline: variantOutline,
}
export const tagTheme = multiStyleConfig.defineMultiStyleConfig({
defaultProps: { variant: "outline" },
baseStyle,
variants,
})
<Heading fontSize="5xl" fontWeight="bold" mb={4}> | ||
Season 1. Pre-launch staking | ||
</Heading> |
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.
We would probably want to use an already prepared component for this. I know that style guide is not yet ready but I believe that it will make it easier for us to standardize later.
<Heading fontSize="5xl" fontWeight="bold" mb={4}> | |
Season 1. Pre-launch staking | |
</Heading> | |
<H3 fontWeight="bold" mb={4}> | |
Season 1. Pre-launch staking | |
</H3> |
<Text fontSize="lg" fontWeight="medium" mb={10}> | ||
Season 1 users that stake bitcoin before Acre launches earn the <br /> | ||
highest rewards and first access to upcoming Seasons. | ||
</Text> |
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.
Similar situation as above.
<Text fontSize="lg" fontWeight="medium" mb={10}> | |
Season 1 users that stake bitcoin before Acre launches earn the <br /> | |
highest rewards and first access to upcoming Seasons. | |
</Text> | |
<TextLg mb={10}> | |
Season 1 users that stake bitcoin before Acre launches earn the <br /> | |
highest rewards and first access to upcoming Seasons. | |
</TextLg> |
CountdownTimer, | ||
} from "#/components/shared/SeasonCountdownSection" | ||
|
||
const MOCK_SEASON_DUE_TIMESTAMP = new Date(2024, 3, 30).getTime() / 1000 |
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.
We can do it later but just flagging. We would probably want to save this as an env
variable. Then save this value in constants.
VITE_SEASON_START_DATE="2024-03-30"
Example solution for VITE_REFERRAL
:
acre/dapp/src/constants/staking.ts
Line 1 in efcb6ed
export const REFERRAL = import.meta.env.VITE_REFERRAL |
px={10} | ||
px={16} // 40px + 24px | ||
pb={10} | ||
maxW="100.625rem" | ||
maxW="87.25rem" // 1268px + 2 * (40px + 24px) | ||
mx="auto" | ||
> | ||
<HeroSection /> | ||
<SeasonCountdownSection /> | ||
</Flex> |
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.
I don't quite understand what's going on here. 😅 I don't quite understand why we set maxW
.
Why can't we do it like this? 🤔
<Flex flexDirection="column">
<HeroSection />
<SeasonCountdownSection />
</Flex>
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.
I would suggest to change the name of this directory. More information here. SeasonCountdownSection
as a directory has no exports and likely will never export a component with this name. If we can let's use lowercasing directory names like this that are purely categorical.
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.
I think we don't need to nest these components in the components directory. I have a feeling that this may cause some confusion. Please check this thread. I believe that if the LandingPage
folder grows we will think about some refactoring on structure.
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.
I don't want to block this PR. Overall, it looks good. I left some comments/suggestions for improvements later. 🚀
Closes: #363 ## Goal: To implement Landing Page This PR aggregates all component PRs to finally complete the implementation of landing page ## Component PRs: The list of PRs is given in the issue's description. Each component PR merges to this PR. - #357 - #358 - #364 - #368 - #369 ## Designs: <img width="1205" alt="image" src="https://github.com/thesis/acre/assets/11503879/be6b6ed2-a808-483e-9daf-43d2c042cba4">
Ref: #355
Goal:
To implement Landing page's
SeasonCountdownSection
componentFeatures:
CountdownTimer
component with fancy digits animationLive
tag element