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

More component library button updates #879

Merged
merged 5 commits into from
Mar 28, 2024
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
18 changes: 9 additions & 9 deletions client/src/components/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const LoginWithoutI18n = (props: LoginProps) => {
onChange: onChangeUserType,
} = useInput("");

const [verifyResent, setVerifyResent] = React.useState(false);
const [isEmailResent, setIsEmailResent] = React.useState(false);

const [placeholderEmail, setPlaceholderEmail] = useState("");

Expand Down Expand Up @@ -189,17 +189,17 @@ const LoginWithoutI18n = (props: LoginProps) => {
) : (
<>
<Trans>Don't have an account?</Trans>
<Button
variant="text"
labelText={i18n._(t`Sign up`)}
className="ml-5 pt-20"
<button
className="button is-text ml-5 pt-20"
onClick={() => {
toggleLoginSignup(Step.RegisterAccount);
if (registerInModal && !showRegisterModal) {
setShowRegisterModal(true);
}
}}
/>
>
<Trans>Sign up</Trans>
</button>
</>
)}
</div>
Expand All @@ -211,13 +211,13 @@ const LoginWithoutI18n = (props: LoginProps) => {
return (
<div className="verify-email-container">
<p>{i18n._(t`Click the link we sent to ${email}. It may take a few minutes to arrive.`)}</p>
{!verifyResent && (
{!isEmailResent && (
<Trans render="span" className="resend-verify-label">
Didn’t get the link?
</Trans>
)}
<SendNewLink
setParentState={setVerifyResent}
setParentState={setIsEmailResent}
variant="secondary"
className="is-full-width"
onClick={() => AuthClient.resendVerifyEmail()}
Expand All @@ -237,7 +237,7 @@ const LoginWithoutI18n = (props: LoginProps) => {
<br />
<br />
<SendNewLink
setParentState={setVerifyResent}
setParentState={setIsEmailResent}
variant="secondary"
className="is-full-width"
onClick={() => AuthClient.resendVerifyEmail()}
Expand Down
19 changes: 10 additions & 9 deletions client/src/components/UserSettingField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const EmailSettingFieldWithoutI18n = (props: EmailSettingFieldProps) => {
const { i18n, currentValue, onSubmit } = props;
const userContext = useContext(UserContext);
const { email: oldEmail, verified } = userContext.user as JustfixUser;
const [verifyResent, setVerifyResent] = React.useState(false);
const [isEmailResent, setIsEmailResent] = React.useState(false);
const [existingUserError, setExistingUserError] = useState(false);
const {
value: email,
Expand Down Expand Up @@ -162,9 +162,9 @@ const EmailSettingFieldWithoutI18n = (props: EmailSettingFieldProps) => {
Email address not verified. Click the link we sent to {email} start receiving Building
Updates.
</Trans>
{!verifyResent && <Trans render="p">Didn’t get the link?</Trans>}
{!isEmailResent && <Trans render="p">Didn’t get the link?</Trans>}
<SendNewLink
setParentState={setVerifyResent}
setParentState={setIsEmailResent}
variant="secondary"
onClick={() => AuthClient.resendVerifyEmail()}
/>
Expand Down Expand Up @@ -238,7 +238,7 @@ const UserSettingFieldWithoutI18n = (props: UserSettingFieldProps) => {
<div className="user-setting-actions">
<Button type="submit" variant="primary" size="small" labelText={i18n._(t`Save`)} />
<Button
type="submit"
type="button"
Copy link
Member

Choose a reason for hiding this comment

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

what is the point of specifying type="button" on Buttons that aren't submit or reset? just wondering if i should also have been doing this

variant="text"
size="small"
labelText={i18n._(t`Cancel`)}
Expand All @@ -253,13 +253,14 @@ const UserSettingFieldWithoutI18n = (props: UserSettingFieldProps) => {
</Trans>
<div>
<span>{preview}</span>
<button
<Button
type="button"
className="button is-text edit-button"
variant="text"
size="small"
className="edit-button"
labelText={i18n._(t`Edit`)}
onClick={() => setEditing(true)}
>
<Trans>Edit</Trans>
</button>
/>
</div>
{!!verifyCallout && verifyCallout}
</>
Expand Down
2 changes: 1 addition & 1 deletion client/src/containers/UnsubscribePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const UnsubscribePage = withI18n()((props: withI18nProps) => {
))}
<div className="unsubscribe-all-field">
<Button
variant="text"
variant="secondary"
size="small"
labelText={i18n._(t`Unsubscribe from all`)}
onClick={handleUnsubscribeAll}
Expand Down