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

feat: back transition from validate to configure #2982

Merged
merged 3 commits into from
Jan 25, 2023

Conversation

kwasniew
Copy link
Contributor

@kwasniew kwasniew commented Jan 25, 2023

About the changes

  • keep the state (env, payload) between the configuration stages (moving state up to the parent modal from each individual stage)
  • show import button when no errors

Important files

Discussion points

@vercel
Copy link

vercel bot commented Jan 25, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Jan 25, 2023 at 9:02AM (UTC)
1 Ignored Deployment
Name Status Preview Comments Updated
unleash-docs ⬜️ Ignored (Inspect) Jan 25, 2023 at 9:02AM (UTC)

const [importStage, setImportStage] = useState<ImportStage>({
name: 'configure',
});
const [importStage, setImportStage] = useState<ImportStage>('configure');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved state up to the parent to keep it for the entire flow

...configuration,
})
tabs={
<ConfigurationTabs
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a technique called "slots not props". Instead of prop drilling data I compose child components where the state is and pass them as ReactNodes.

environment: string;
payload: string;
}
export const ConfigurationTabs: FC<{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

configuration stage exposes small components. They can be composed in the parent who owns the state

);

export const ConfigurationStage: FC<{
tabs: ReactNode;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a typical signature for "slots not props" technique. ReactNode instead of lots of string fields

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants