-
Notifications
You must be signed in to change notification settings - Fork 0
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: Stepper #2
Conversation
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.
Thanks @mariaozamiz code looks good! Just a couple of observations about reusing repeated components.
Also we're waiting for a beta version for the wizard component in order to mark a step as completed. EyeSeeTea/d2-ui-components#235
); | ||
}); | ||
|
||
const Container = styled.section` |
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.
Since we're repeating the same Container
and Title
component we can extract both into a separate file and reuse them for all the steps:
// ./components/step-container/StepContainer.tsx
import styled from "styled-components";
export const StepContainer = styled.section`
height: 39.125rem;
`;
export const StepTitle = styled.h2`
color: blue;
`;
and use them in each step:
export const ConfigurationStep: React.FC<PageProps> = React.memo(props => {
const { name } = props;
return (
<StepContainer>
<StepTitle>{i18n.t("Configuration")}</StepTitle>
</StepContainer>
);
});
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.
This one might need a layout, as we should insert the table and filters inside the step container later on. What do you think?
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.
Just to be sure I'm following the idea, do you mean something like:
// StepLayout.tsx
<StepLayout>
<StepContainer>
<StepTitle>{i18n.t("Configuration")}</StepTitle>
</StepContainer>
{children}
</StepLayout>
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.
In my head is like:
// StepLayout.tsx
<StepLayout or StepContainer>
<Header>
<StepTitle>{i18n.t("Configuration")}</StepTitle>
<Filters />
</Header>
{children} // table
</StepLayout or StepContainer>
Maybe it's just an early abstraction 🤔 and might get difficult later on to relate table and filters. To deal with the duplicated code I can delete the styling for now and add it later on in the project.
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.
Agree, we don't have all the information to do this abstraction.
📌 References
📝 Implementation
Using wizard component
📹 Screenshots/Screen capture
🔥 Notes to the tester
check /#/analysis page