Skip to content

Test1#1

Open
frontendpm wants to merge 2 commits intomainfrom
test1
Open

Test1#1
frontendpm wants to merge 2 commits intomainfrom
test1

Conversation

@frontendpm
Copy link
Copy Markdown
Owner

No description provided.

Comment thread main.js
5. bonus: use Class
*/
function dialogBox($component) {
const questionContainer = $component.find('.question');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Points for using const

Comment thread main.js
function dialogBox($component) {
const questionContainer = $component.find('.question');
const questionContainerHtml = questionContainer.html();
const socialItem = $('.social-link');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
const socialItem = $('.social-link');
const socialItems = $('.social-link');

Comment thread main.js
const buttonOk = $component.find('.button--ok');
const buttonCancel = $component.find('.button--cancel');
const dialogContainer = $('.dialog');
let socialLink = socialItem.attr('data-url');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

There's no point putting this in this scope. This will be overwritten after each click, so could be a const inside event-handling function.

Comment thread main.js
closeDialog();
}

init();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What's the point of separate init function?

Comment thread main.js

init();

function attachDialogBox() {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Attach what to what? 🤔

Comment thread main.scss
&--youtube {
background: url(https://www.magneticpoint.com/themes/custom/mp/assets/images/ic-youtube.svg)
center no-repeat;
filter: invert(21%) sepia(97%) saturate(6285%) hue-rotate(359deg)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

That's nice.

Comment thread main.scss
center no-repeat;
filter: invert(21%) sepia(97%) saturate(6285%) hue-rotate(359deg)
brightness(100%) contrast(123%);
box-shadow: 2px 2px 2px rgb(165, 165, 165);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No variable for color.

Comment thread main.scss
background-color: rgba($color-black, 0.5);
}

&--ok {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nesting without indentation. I'm calling Amnesty International.

Comment thread main.scss

&.is-hidden {
// display: none;
visibility: hidden;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hmm, what's the difference? It will add .1s delay, thanks to transition, but what for?

Comment thread main.scss
color: #000;
position: fixed;
@include mobile {
display: flex;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Mobile second :(

Comment thread main.js
const socialItem = $('.social-link');
const buttonOk = $component.find('.button--ok');
const buttonCancel = $component.find('.button--cancel');
const dialogContainer = $('.dialog');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

redundant - $component passed as argument in dialogBox function is $('.dialog')

Comment thread main.scss

@mixin transition($property) {
transition-duration: .3s;
transition-delay: .1s;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

inconsistent - once you are using .1 other time you are adding leading zero (0.5)

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.

3 participants