Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
lechinal committed Oct 9, 2023
1 parent 403685d commit bdd0a1e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useState } from 'react';

import Button from './components/Button/Button';
import StepMessage from 'components/StepMessage/StepMessage';

const messages = [
'Learn React ⚛️',
Expand Down Expand Up @@ -47,9 +48,18 @@ export default function App() {
<div className={step >= 3 ? 'active' : ''}>3</div>
</div>

<p className="message">
Step {step}:{messages[step - 1]}
</p>
<StepMessage step={step}>
{messages[step - 1]}
<div className="buttons">
<Button
backgroundColor="#e7e7e7"
textColor="#333"
onClick={() => alert(`Lear how to ${messages[step - 1]}`)}
>
Lear how
</Button>
</div>
</StepMessage>

<div className="buttons">
<Button
Expand Down
12 changes: 12 additions & 0 deletions src/components/StepMessage/StepMessage.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';

function StepMessage({ step, children }) {
return (
<div className="message">
<h3>Step {step}</h3>
{children}
</div>
);
}

export default StepMessage;

0 comments on commit bdd0a1e

Please sign in to comment.