-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: review
Are you sure you want to change the base?
Project #1
Conversation
There was a problem hiding this 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; |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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'; |
There was a problem hiding this comment.
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 = { |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check out this review
meltaway/dsc-studygroup-react#1 (comment)
<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="" /> |
There was a problem hiding this comment.
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} > |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EOF newline
{clicked === index ? ( | ||
<div className="answers"> | ||
<p> | ||
{item.answer} | ||
</p> | ||
</div> | ||
) : null} |
There was a problem hiding this comment.
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 likeclickedItemIndex
No description provided.