Skip to content

Project#1

Open
dolphin323 wants to merge 2 commits intoreviewfrom
project
Open

Project#1
dolphin323 wants to merge 2 commits intoreviewfrom
project

Conversation

@dolphin323
Copy link
Copy Markdown
Owner

No description provided.

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

@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

Comment thread src/Components/Card.css
bottom: 0;
left: 0;
margin: auto;
overflow: 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.

install formatter and fix indentation

Comment thread src/Components/Card.css
position: absolute;
}

@font-face {
Copy link
Copy Markdown

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

Comment thread src/Components/Card.js
@@ -0,0 +1,55 @@
import { useState } from 'react';
Copy link
Copy Markdown

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

Comment thread src/Components/Card.js
import './Card.css';
import { Data } from "./Data";

const Style_of_q = {
Copy link
Copy Markdown

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 = {}

Comment thread src/Components/Card.js
};

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

Choose a reason for hiding this comment

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

Comment thread src/Components/Card.js
<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
Copy Markdown

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

Comment thread src/Components/Card.js

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

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

Comment thread src/Components/Card.js
);
}

export default Card No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

EOF newline

Comment thread src/Components/Card.js
Comment on lines +39 to +45
{clicked === index ? (
<div className="answers">
<p>
{item.answer}
</p>
</div>
) : null}
Copy link
Copy Markdown

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