Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 4 additions & 15 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
import React, { Component } from 'react';
import Welcome from './components/Welcome';
import Support from './components/Support';

class Welcome extends React.Component {
constructor(props) {
super(props);
}
render() {
return <h1>Meet the { this.props.name }</h1>;
}
}

const Hello = (props) => {
return <h1>Meet the <i>{props.name}</i></h1>
}

function App() {
const name = 'StarGazers'
Expand All @@ -20,11 +10,10 @@ function App() {
<article>
<hgroup>
<img src="images/group.svg" alt="StarGazers Group" />
<Welcome name="Stars" />
<Hello name="StarGazers" />
<Welcome name="StarsGazers" />
<p>Members of an <b>intergalactic alliance</b><br />
paving the way for peace and benevolence among all species. They are known for their enthusiasm for science, for their love of fun, and their dedication to education.</p>
<button className="outline" onClick={() => alert('Hi there')}>Click Me</button>
<Support/>
</hgroup>
</article>
</div>
Expand Down
11 changes: 11 additions & 0 deletions src/components/Support.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { useState } from "react";

export default ()=>{
const [count, setCount] = useState(0)
return(
<button className="outline" onClick={() => setCount(count + 1)}>
{count ===0 ? "Click to suppport" : `Supported ${count} times`}
</button>

)
}
3 changes: 3 additions & 0 deletions src/components/Welcome.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default (props) => {
return <h1>Meet the {props.name}</h1>
}