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

Change: confirm button text to create motion #3528

Merged
merged 4 commits into from
Jul 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"button.close": "Close",
"button.confirm": "Confirm",
"button.continue": "Continue",
"button.createMotion": "Create Motion",
"button.next": "Next",
"button.save": "Save",
"button.modify": "Modify",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,11 @@ const TokenEditDialog = ({
/>
<Button
appearance={{ theme: 'primary', size: 'large' }}
text={{ id: 'button.confirm' }}
text={
values.forceAction || !isVotingExtensionEnabled
? { id: 'button.confirm' }
: { id: 'button.createMotion' }
}
loading={isSubmitting}
onClick={() => handleSubmit()}
disabled={
Expand All @@ -246,7 +250,7 @@ const TokenEditDialog = ({
isLoadingAddress
}
type="submit"
style={{ width: styles.wideButton }}
style={{ minWidth: styles.wideButton }}
data-test="confirm"
/>
</DialogSection>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,10 +467,14 @@ const ManageReputationDialogForm = ({
<Button
appearance={{ theme: 'primary', size: 'large' }}
onClick={() => handleSubmit()}
text={{ id: 'button.confirm' }}
text={
values.forceAction || !isVotingExtensionEnabled
? { id: 'button.confirm' }
: { id: 'button.createMotion' }
}
loading={isSubmitting}
disabled={!isValid || inputDisabled}
style={{ width: styles.wideButton }}
style={{ minWidth: styles.wideButton }}
Copy link
Member

Choose a reason for hiding this comment

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

We usually prefer to add this via css styles not via JS.

You can do the same, by overwriting the button min-width in the styles file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rdig So my goal was to remove the width style and replace it with minWidth. Are you saying that having the width style in the tsx file wasnt the best way to do it to begin with?

Copy link
Member

Choose a reason for hiding this comment

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

Exactly. But now that I'm thinking more about this, in order to expedite this PR, leave it like it is for now.

Let's just fix your branch tommorow, then you can merge it

data-test="reputationConfirmButton"
/>
</DialogSection>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@value wideButton: 160px;

.nameAndColorContainer {
display: flex;
align-items: center;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export const wideButton: string;
export const nameAndColorContainer: string;
export const title: string;
export const domainName: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,16 @@ const CreateDomainDialogForm = ({
/>
)}
<Button
text={{ id: 'button.confirm' }}
text={
values.forceAction || !isVotingExtensionEnabled
? { id: 'button.confirm' }
: { id: 'button.createMotion' }
}
appearance={{ theme: 'primary', size: 'large' }}
onClick={() => handleSubmit()}
loading={isSubmitting}
disabled={inputDisabled || !isValid}
style={{ minWidth: styles.wideButton }}
data-test="createDomainConfirmButton"
/>
</DialogSection>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -617,14 +617,18 @@ const CreatePaymentDialogForm = ({
<Button
appearance={{ theme: 'primary', size: 'large' }}
onClick={() => handleSubmit()}
text={{ id: 'button.confirm' }}
text={
values.forceAction || !isVotingExtensionEnabled
? { id: 'button.confirm' }
: { id: 'button.createMotion' }
}
loading={isSubmitting}
/*
* Disable Form submissions if either the form is invalid, or
* if our custom state was triggered.
*/
disabled={!isValid || !!customAmountError || inputDisabled}
style={{ width: styles.wideButton }}
style={{ minWidth: styles.wideButton }}
data-test="paymentConfirmButton"
/>
</DialogSection>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@value wideButton: 160px;

.title {
font-size: var(--size-medium-l);
font-weight: var(--weight-bold);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export const wideButton: string;
export const title: string;
export const logoPlaceholder: string;
export const smallText: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,11 @@ const EditColonyDetailsDialogForm = ({
/>
<Button
appearance={{ theme: 'primary', size: 'large' }}
text={{ id: 'button.confirm' }}
text={
forceAction || !isVotingExtensionEnabled
? { id: 'button.confirm' }
: { id: 'button.createMotion' }
}
onClick={() => handleSubmit()}
loading={isSubmitting}
disabled={
Expand All @@ -289,6 +293,7 @@ const EditColonyDetailsDialogForm = ({
!canValuesBeUpdate ||
isSubmitting
}
style={{ minWidth: styles.wideButton }}
data-test="confirmButton"
/>
</DialogSection>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@value wideButton: 160px;

.nameAndColorContainer {
display: flex;
align-items: center;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export const wideButton: string;
export const nameAndColorContainer: string;
export const domainName: string;
export const noPermissionFromMessage: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,16 @@ const EditDomainDialogForm = ({
/>
)}
<Button
text={{ id: 'button.confirm' }}
text={
forceAction || !isVotingExtensionEnabled
? { id: 'button.confirm' }
: { id: 'button.createMotion' }
}
appearance={{ theme: 'primary', size: 'large' }}
onClick={() => handleSubmit()}
loading={isSubmitting}
disabled={inputDisabled || !isValid}
style={{ minWidth: styles.wideButton }}
data-test="editDomainConfirmButton"
/>
</DialogSection>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@value wideButton: 160px;

.title {
font-size: var(--size-medium-l);
font-weight: var(--weight-bold);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export const wideButton: string;
export const title: string;
export const noPermissionMessage: string;
export const contractVersionLine: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,17 @@ const NetworkContractUpgradeDialogForm = ({
)}
<Button
appearance={{ theme: 'primary', size: 'large' }}
text={{ id: 'button.confirm' }}
text={
values.forceAction || !isVotingExtensionEnabled
? { id: 'button.confirm' }
: { id: 'button.createMotion' }
}
disabled={
inputDisabled ||
PREVENT_UPGRADE_IF_LEGACY_RECOVERY_ROLES ||
isSubmitting
}
style={{ minWidth: styles.wideButton }}
onClick={() => handleSubmit()}
loading={isSubmitting || loadingLegacyRecoveyRole}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,13 @@ const PermissionManagementDialog = ({
<Button
appearance={{ theme: 'primary', size: 'large' }}
loading={isSubmitting}
text={{ id: 'button.confirm' }}
text={
values.forceAction || !isVotingExtensionEnabled
? { id: 'button.confirm' }
: { id: 'button.createMotion' }
}
type="submit"
style={{ width: styles.wideButton }}
style={{ minWidth: styles.wideButton }}
disabled={
inputDisabled ||
!isValid ||
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@value wideButton: 160px;

.title {
font-size: var(--size-medium-l);
font-weight: var(--weight-bold);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export const wideButton: string;
export const title: string;
export const permissionLabel: string;
export const noPermissionMessage: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ const RecoveryModeDialogForm = ({
onClick={() => handleSubmit()}
loading={isSubmitting}
disabled={!userHasPermission || isSubmitting}
style={{ minWidth: styles.wideButton }}
data-test="recoveryConfirmButton"
/>
</DialogSection>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,14 @@ const TokenMintForm = ({
<Button
appearance={{ theme: 'primary', size: 'large' }}
onClick={() => handleSubmit()}
text={{ id: 'button.confirm' }}
text={
values.forceAction || !isVotingExtensionEnabled
? { id: 'button.confirm' }
: { id: 'button.createMotion' }
}
loading={isSubmitting}
disabled={!isValid || inputDisabled}
style={{ width: styles.wideButton }}
style={{ minWidth: styles.wideButton }}
data-test="mintConfirmButton"
/>
</DialogSection>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,10 +455,14 @@ const TransferFundsDialogForm = ({
<Button
appearance={{ theme: 'primary', size: 'large' }}
onClick={() => handleSubmit()}
text={{ id: 'button.confirm' }}
text={
values.forceAction || !isVotingExtensionEnabled
? { id: 'button.confirm' }
: { id: 'button.createMotion' }
}
loading={isSubmitting}
disabled={!isValid || inputDisabled}
style={{ width: styles.wideButton }}
style={{ minWidth: styles.wideButton }}
data-test="transferFundsConfirmButton"
/>
</DialogSection>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@value wideButton: 160px;

.modalHeading {
padding: 32px 0 20px;
width: 100%;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export const wideButton: string;
export const modalHeading: string;
export const headingContainer: string;
export const noPermissionMessage: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,14 @@ const UnlockTokenForm = ({
<Button
appearance={{ theme: 'primary', size: 'large' }}
onClick={() => handleSubmit()}
text={{ id: 'button.confirm' }}
text={
values.forceAction || !isVotingExtensionEnabled
? { id: 'button.confirm' }
: { id: 'button.createMotion' }
}
loading={isSubmitting}
disabled={!isValid || inputDisabled}
style={{ minWidth: styles.wideButton }}
data-test="unlockTokenConfirmButton"
/>
</DialogSection>
Expand Down