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

Project #1

Open
wants to merge 2 commits into
base: review
Choose a base branch
from
Open

Project #1

wants to merge 2 commits into from

Conversation

dolphin323
Copy link
Owner

No description provided.

dolphin323 added 2 commits April 4, 2021 19:52
Copy link

@v1nn1k v1nn1k left a comment

Choose a reason for hiding this comment

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

Good one, check out other reviews

bottom: 0;
left: 0;
margin: auto;
overflow: hidden;
Copy link

Choose a reason for hiding this comment

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

install formatter and fix indentation

position: absolute;
}

@font-face {
Copy link

Choose a reason for hiding this comment

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

those should be at the top of file

@@ -0,0 +1,55 @@
import { useState } from 'react';
Copy link

Choose a reason for hiding this comment

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

import React, {useState} from 'react;
React should be in scope when using JSX

import './Card.css';
import { Data } from "./Data";

const Style_of_q = {
Copy link

Choose a reason for hiding this comment

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

use camelCase and full names. const questionStyles = {}

};

const Card = () => {
const [clicked, setClicked] = useState(false)
Copy link

Choose a reason for hiding this comment

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

<div className="all_card">
<div className="pictures">
<img src="/images/bg-pattern-desktop.svg" className="romb_img" alt="" />
<img src="/images/illustration-woman-online-desktop.svg" className="woman_img" alt="" />
Copy link

Choose a reason for hiding this comment

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

Alt text shouldn't be empty


<div className="questions">
{/* {clicked === index ? <p style={ Style_of_q } : <p>} */}
<p style={clicked === index ? Style_of_q : null} >
Copy link

Choose a reason for hiding this comment

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

Also check out the review above. Create local variable isClicked = clicked === index

);
}

export default Card
Copy link

Choose a reason for hiding this comment

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

EOF newline

Comment on lines +39 to +45
{clicked === index ? (
<div className="answers">
<p>
{item.answer}
</p>
</div>
) : null}

Choose a reason for hiding this comment

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

  • It's better to use && instead of ? in this case. So {clicked === index && (...)}
  • Not really good name clicked. It suppose to be a boolean value but it's comparing with index which is number. I would suggest something like clickedItemIndex

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.

4 participants