Skip to content

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 No newline at end of file
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.

5 participants