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

chore: Make SettingsForm shared and generic #3308

Merged
merged 1 commit into from
Jun 20, 2024

Conversation

DafyddLlyr
Copy link
Contributor

@DafyddLlyr DafyddLlyr commented Jun 20, 2024

What does this PR do?

  • Moves SettingsForm to a shared location so that it can be used outside the context of design settings
  • Updates props to become generic, meaning we could pass in a form other than TeamTheme
  • No functional changes

import InputLegend from "ui/editor/InputLegend";
import ErrorWrapper from "ui/shared/ErrorWrapper";

type SettingsFormProps<TFormikValues> = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here's the core difference in this PR.

The previous props took a hardcoded TeamTheme, we're now using a generic type here.

preview?: React.ReactElement;
};

export const SettingsForm = <TFormikValues,>({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apart from changes to types and an update of the ErrorWrapper id, this component is copy/pasted from /DesignSettings/index.tsx

@DafyddLlyr DafyddLlyr requested a review from a team June 20, 2024 16:02
@DafyddLlyr DafyddLlyr marked this pull request as ready for review June 20, 2024 16:02
Copy link
Contributor

@RODO94 RODO94 left a comment

Choose a reason for hiding this comment

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

Looks good to me, I can apply it to the Team Settings PR #3305 and suggest changes if any arise

@DafyddLlyr
Copy link
Contributor Author

@RODO94 Once CI is done I'll merge to main and you should be able to rebase to pick up these changes 👍

Copy link

github-actions bot commented Jun 20, 2024

Removed vultr server and associated DNS entries

@DafyddLlyr DafyddLlyr merged commit 0cb8424 into main Jun 20, 2024
12 checks passed
@DafyddLlyr DafyddLlyr deleted the dp/generic-settings-form branch June 20, 2024 16:29
RODO94 pushed a commit that referenced this pull request Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants