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

Bugfix Styles in the login popup do not work #542

Merged
merged 2 commits into from
Aug 23, 2021
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
35 changes: 35 additions & 0 deletions src/old/lib/components/Users/LoginModal.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.congratulation-container .swal2-popup {
width: 480px;
}

.congratulation-title-text {
font-family: 'Raleway', sans-serif;
font-weight: 500;
font-size: 64px;
line-height: 66px;
margin-top: -25px; /* -15px and -35px, without 90px */
}

.congratulation-sub-text {
font-family: 'Raleway', sans-serif;
font-weight: 500;
font-size: 24px;
line-height: 38px;
margin-top: -22px;
}

.congratulation-button {
padding: 14px 60px;
border-radius: 50px;
background-color: #4fdfff;
color: whitesmoke;
font-weight: 700;
font-size: 18px;
font-family: 'Raleway', sans-serif;
margin: 10px 0 60px 0; /* '10px 0 40px or 60px 0' bottom, without '18px 0 71px 0' */
}

.congratulation-button:hover {
background-color: #106ba3;
cursor: pointer;
}
34 changes: 0 additions & 34 deletions src/old/lib/components/Users/LoginModal.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,38 +140,4 @@ export const useStyles = makeStyles((theme: Theme) => ({
backgroundColor: '#ffaa00',
},
},
congratulationContainer: {
'& .swal2-popup': {
width: 480,
},
},
congratulationTitleText: {
fontFamily: 'Raleway',
fontWeight: 500,
fontSize: '64px',
lineHeight: '66px',
marginTop: '-25px', // -15px and -35px, without 90px
},
congratulationSubText: {
fontFamily: 'Raleway',
fontWeight: 500,
fontSize: '24px',
lineHeight: '38px',
padding: '0 -20px',
marginTop: '-22px',
},
congratulationButton: {
padding: '14px 60px',
borderRadius: 50,
backgroundColor: '#4FDFFF',
color: theme.palette.common.white,
fontWeight: 700,
fontSize: '18px',
fontFamily: 'Raleway',
margin: '10px 0 60px 0', // '10px 0 40px or 60px 0' bottom, without '18px 0 71px 0'
'&:hover': {
backgroundColor: '#106ba3',
cursor: 'pointer',
},
},
}));
24 changes: 14 additions & 10 deletions src/old/lib/components/Users/LoginModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { langTokens } from '../../../../locales/localizationInit';
import { BasicButton, BasicInput } from '../../../../components/Form';
import { useActions } from '../../../../shared/hooks';
import { getAuthoritiesAsyncAction } from '../../../../models/authorities';
import './LoginModal.css';

export const LoginModal: React.FC = () => {
const { t } = useTranslation();
Expand Down Expand Up @@ -54,10 +55,10 @@ export const LoginModal: React.FC = () => {

const swalWithCustomButton = Swal.mixin({
customClass: {
container: classes.congratulationContainer,
title: classes.congratulationTitleText,
htmlContainer: classes.congratulationSubText,
confirmButton: classes.congratulationButton,
container: 'congratulation-container',
title: 'congratulation-title-text',
htmlContainer: 'congratulation-sub-text',
confirmButton: 'congratulation-button',
},
buttonsStyling: false,
});
Expand All @@ -70,12 +71,15 @@ export const LoginModal: React.FC = () => {
setAuthorization(response.data.accessToken);
boundAuthorities();
handleLoginClose();
swalWithCustomButton.fire(
t(langTokens.loginRegistration.congratulation),
t(langTokens.loginRegistration.youAreWelcome),
'success',
).then(()=>history.push('/'));
}).catch((err) => {
swalWithCustomButton
.fire(
t(langTokens.loginRegistration.congratulation),
t(langTokens.loginRegistration.youAreWelcome),
'success',
)
.then(() => history.push('/'));
})
.catch((err) => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
setError(err.response.data.status);
});
Expand Down