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

fix: styling issues #8914

Merged
merged 2 commits into from
Nov 12, 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
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
@import "../../../colors";
@import "../../colors";

.driver-popover.tutorials-highlight,
.driver-popover.project-journey {
display: flex;
flex-direction: column;
display: flex !important;
flex-direction: row-reverse;
justify-content: space-between;
align-items: center;
background-color: $ui-purple-dark;
padding: 0.5rem;

.driver-popover-close-btn {
display: flex !important;
justify-content: center;
align-items: center;
position: relative;
height: 2.5rem;
width: 2.5rem;
border-radius: 50%;
margin: 0.5rem;
font-size: 2rem;
font-weight: bold;
color: $type-white;
background-color: $ui-purple-dark;

.close-btn-img {
height: 1.25rem;
width: 1.25rem;
}
}

.driver-popover-arrow-side-left.driver-popover-arrow {
Expand Down
16 changes: 15 additions & 1 deletion src/components/journeys/driver-journey/driver-journey.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@ const DriverJourney = ({configProps, driverObj}) => {
callback();
}
const portalData = [];

const closeButton = document.getElementsByClassName('driver-popover-close-btn')[0];
if (closeButton) {
closeButton.textContent = '';
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these element property changes necessary because driver.js is setting up the button in a way that we can't fully control?

Copy link
Contributor Author

@MiroslavDionisiev MiroslavDionisiev Nov 12, 2024

Choose a reason for hiding this comment

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

@cwillisf it is using for the cross sign the sign for multiplication and when the browsers running on mac tries to render it is it not centered


const closeButtonImage = document.createElement('img');
closeButtonImage.src = '/svgs/modal/close-x.svg';
closeButtonImage.className = 'close-btn-img';

closeButton.appendChild(closeButtonImage);
closeButton.addEventListener('click', () => driverObj.destroy());
}

for (const [section, component] of Object.entries(
sectionComponents
)) {
Expand Down Expand Up @@ -62,7 +75,8 @@ DriverJourney.propTypes = {
}),
driverObj: PropTypes.shape({
setConfig: PropTypes.func,
drive: PropTypes.func
drive: PropTypes.func,
destroy: PropTypes.func
})
};

Expand Down
4 changes: 2 additions & 2 deletions src/components/journeys/editor-journey/editor-journey.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const messages = defineMessages({
},
projectGenreStepTitle: {
id: 'gui.journey.controls.choose.projectGenre',
defaultMessage: 'What do you whant to create?',
defaultMessage: 'What do you want to create?',
description: 'Choose project genre step title'
},
typeStepTitle: {
Expand Down Expand Up @@ -151,7 +151,7 @@ const EditorJourney = ({onActivateDeck, setCanViewTutorialsHighlight, setShowJou
editorJourneyStep: editorJourneyStep
});
driverObj.moveTo(stepNumber);
}, driverObj);
}, [driverObj]);

const createStep = useCallback((projectId, tutorialId) => ({
title: intl.formatMessage(messages.createStepTitle),
Expand Down
12 changes: 9 additions & 3 deletions src/components/journeys/editor-journey/editor-journey.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
@import "../../../frameless";

.driver-popover.gui-journey {
font-family: "Helvetica Neue", "Helvetica", Arial, sans-serif;
max-width: unset;
padding: 0;
border-radius: 15px;
Expand All @@ -11,20 +10,27 @@
transform: translate(-50%, -50%);

.driver-popover-close-btn {
display: flex !important;
justify-content: center;
align-items: center;
height: 2.5rem;
width: 2.5rem;
border-radius: 50%;
margin: 0.5rem;
font-size: 2rem;
font-weight: bold;
color: $type-white;
background-color: $ui-aqua-dark;

.close-btn-img {
height: 1.25rem;
width: 1.25rem;
}
}

.driver-popover-title {
padding: 1rem 0;
font-size: 1rem;
font-weight: 700;
font-family: "Helvetica Neue", "Helvetica", Arial, sans-serif;
text-align: center;
color: $type-white;
margin: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const DriverJourney = require('../driver-journey/driver-journey.jsx');
const {defineMessages, useIntl} = require('react-intl');
const {useState} = require('react');
const PropTypes = require('prop-types');
require('./project-journey.scss');
require('../common-journey.scss');

const messages = defineMessages({
playProject: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const DriverJourney = require('../driver-journey/driver-journey.jsx');
const {defineMessages, useIntl} = require('react-intl');
const PropTypes = require('prop-types');
const {useState} = require('react');
require('./tutorials-highlight.scss');
require('../common-journey.scss');

const messages = defineMessages({
tutorialsHighlight: {
Expand Down

This file was deleted.

13 changes: 9 additions & 4 deletions src/lib/onboarding.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,14 @@ const isUserEligible = (user, permissions) =>
!isBanned(user);

const calculateAgeGroup = (birthYear, birthMonth) => {
if (!birthMonth || !birthYear) {
return '[unset]';
}

const today = new Date();
let age = today.getFullYear() - parseInt(birthYear, 10);
const monthDiff = today.getMonth() + 1 - parseInt(birthMonth, 10);
let age = today.getFullYear() - birthYear;
const monthDiff = today.getMonth() + 1 - birthMonth;

if (monthDiff < 0) {
age--;
}
Expand Down Expand Up @@ -71,6 +76,8 @@ export const triggerAnalyticsEvent = eventVaribles => {
};

export const sendUserProperties = (user, permissions) => {
window.dataLayer = window.dataLayer || [];

if (!isUserEligible(user, permissions)) {
window.dataLayer.push({
Comment on lines +79 to 82
Copy link
Contributor

Choose a reason for hiding this comment

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

😅

testGroup: null,
Expand All @@ -80,8 +87,6 @@ export const sendUserProperties = (user, permissions) => {
return;
}

window.dataLayer = window.dataLayer || [];

const {gender, birthYear, birthMonth} = user;

window.dataLayer.push({
Expand Down