forked from nirsky/figma-plugin-react-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Leo Palazzi
committed
Jun 10, 2024
1 parent
c8ba6b7
commit d176cf6
Showing
31 changed files
with
476 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/app/components/Atoms/UniverseBanner/UniverseBanner.style.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** @format */ | ||
|
||
.universe-banner { | ||
background: var(--Primary-3-Blue-2, #3c2fed); | ||
padding: 16px 40px; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
color: #fff; | ||
font-size: 16px; | ||
font-style: normal; | ||
font-weight: 700; | ||
text-transform: uppercase; | ||
} |
12 changes: 12 additions & 0 deletions
12
src/app/components/Atoms/UniverseBanner/UniverseBanner.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** @format */ | ||
|
||
import { useTranslation } from "react-i18next"; | ||
import "./UniverseBanner.style.scss"; | ||
|
||
const UniverseBanner = () => { | ||
const { t } = useTranslation(); | ||
|
||
return <div className="universe-banner">{t("universeBanner")}</div>; | ||
}; | ||
|
||
export default UniverseBanner; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/app/components/Organisms/AnswersSummaryCard/AnswersSummaryCard.style.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** @format */ | ||
|
||
.answers-summary-card { | ||
&__title { | ||
margin: 0; | ||
font-size: 24px; | ||
font-weight: 600; | ||
color: #1f1f1f; | ||
} | ||
&__question-container { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 8px; | ||
} | ||
|
||
&__question-index { | ||
font-size: 16px; | ||
font-weight: 400; | ||
color: #1f1f1f; | ||
} | ||
|
||
&__question-label { | ||
font-size: 16px; | ||
font-weight: 600; | ||
color: #1f1f1f; | ||
} | ||
|
||
&__answer-container{ | ||
display: flex; | ||
align-items: center; | ||
gap: 8px; | ||
} | ||
|
||
&__answer-label { | ||
font-size: 12px; | ||
color: #1f1f1f; | ||
font-weight: 600; | ||
} | ||
|
||
&__answer-title { | ||
font-size: 14px; | ||
color: #1f1f1f; | ||
font-weight: 400; | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
src/app/components/Organisms/AnswersSummaryCard/AnswersSummaryCard.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/** @format */ | ||
import SimpleCard from "../../Template/SimpleCard/SimpleCard"; | ||
import { FunctionComponent } from "react"; | ||
import { useTranslation } from "react-i18next"; | ||
// import { ScoreCardProps } from "./ScoreCard.model"; | ||
import Bem from "../../../helpers/Bem"; | ||
import "./AnswersSummaryCard.style.scss"; | ||
import ActionButton from "../../Atoms/ActionButton/ActionButton"; | ||
import correctAnswerLogo from "../../../assets/svg/correctAnswer.svg"; | ||
import wrongAnswerLogo from "../../../assets/svg/wrongAnswer.svg"; | ||
|
||
const AnswersSummaryCard: FunctionComponent<any> = ({ questions, answers, onClickRetry }) => { | ||
const { t } = useTranslation(); | ||
const b = Bem("answers-summary-card"); | ||
|
||
return ( | ||
<SimpleCard gap="24px"> | ||
<h2 className={b("title")}>Summary</h2> | ||
{questions.map((question, index) => { | ||
const currentAnswer = answers[index]; | ||
const { isCorrect, answer } = currentAnswer; | ||
console.log(question) | ||
return ( | ||
<div | ||
className={b("question-container")} | ||
key={`question-${index}`} | ||
> | ||
<span className={b("question-index")}>{`Question ${index + 1}.`}</span> | ||
<div className={b("question-label")}>{question.title}</div> | ||
<span className={b("answer-label")}>Your answer:</span> | ||
<div className={b("answer-container")}> | ||
<img | ||
src={isCorrect ? correctAnswerLogo : wrongAnswerLogo} | ||
alt={isCorrect ? "Correct answer logo" : "Wrong answer logo"} | ||
/> | ||
<span className={b("answer-title")}>{answer}</span> | ||
</div> | ||
{ | ||
!isCorrect && <> | ||
<span className={b("answer-label")}>Correct answer</span> | ||
<span className={b("answer-title")}>{question.correctAnswer}</span> | ||
</> | ||
} | ||
</div> | ||
); | ||
})} | ||
<div className={b("buttons-block")}> | ||
<ActionButton | ||
label={t("scoreCard.retry")} | ||
onClick={onClickRetry} | ||
/> | ||
</div> | ||
</SimpleCard> | ||
); | ||
}; | ||
|
||
export default AnswersSummaryCard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
export type ScoreCardProps = { | ||
score: number; | ||
questionsLength : number; | ||
onClickRetry: any; | ||
onClickCheckResults: any; | ||
} |
Oops, something went wrong.