Skip to content

Commit

Permalink
Merge pull request #12 from techswitch-learners/mm-401-add-logo-to-he…
Browse files Browse the repository at this point in the history
…ader

added logo to the header
  • Loading branch information
sun-amy authored Jul 31, 2024
2 parents 692231c + 61f9900 commit 8f7dfc6
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 5 deletions.
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>Marsio Kart</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
Binary file removed public/marsiokartlogo.png
Binary file not shown.
2 changes: 1 addition & 1 deletion src/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { render, screen, fireEvent } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import App from './App';
import "@testing-library/jest-dom";
import Hamburger from './Hamburgerbutton';
import Hamburger from './Hamburgerbutton/Hamburgerbutton';

// remove this test when real tests are added
test('renders header', () => {
Expand Down
3 changes: 1 addition & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
import './App.scss';
import Home from './Home/Home';
import Header from './header';
import Header from './Header/Header';
import { Quiz } from './Quiz/Quiz';
import Footer from './Footer/Footer';

Expand All @@ -12,7 +12,6 @@ function App() {
return (
<div className="App">
<Router>
<h1>MarsioKart</h1>
<Header/>
<Routes>
<Route path='/'
Expand Down
File renamed without changes.
File renamed without changes.
5 changes: 4 additions & 1 deletion src/header.tsx → src/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React from 'react';
import Hamburger from './Hamburgerbutton';
import Hamburger from '../Hamburgerbutton/Hamburgerbutton';

const logo = require('../ImageAssets/marsiokartlogo.jpg')

const Header: React.FC = () => {
const handleHamburgerClick = () => {
Expand All @@ -9,6 +11,7 @@ const Header: React.FC = () => {
return (
<div className="App">
<Hamburger onClick={handleHamburgerClick} label={""}/>
<img src={logo} alt="Marsio Kart Logo" />
</div>
);
};
Expand Down
Binary file added src/ImageAssets/marsiokartlogo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
22 changes: 22 additions & 0 deletions src/QuestionDisplay/QuestionDisplay.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// questions = [{"Where is Mars in the solar system?" : [{"Fourth planet from the sun" : true}, {"Next to Pluto" : false}, {"Closer to the sun than Earth" : false}]},
// {"What is a rover?": [{"A dog" : false}, {"A robotic space vehicle" : true}, {"A type of car" : false}]},
// {"How many rovers have NASA sent to Mars?": [{"5": true}, {"4": false}, {"20": false}]},
// {"Which of these lists real Mars rover names?": [{"Resilience, Curiosity, Perseverance": false}, {"Sojourner, Oppertunity, Perseverance" : true}, {"Discovery, Searcher, Pioneer" : false}]},
// {"What are the Mars rovers looking for?": [{"Ares God of War": false}, {"Dead rovers": false}, {"Water": true}]}]
// import getQuestions from './somewhere';

export function QuestionDisplay() {
// const questions = getQuestions();
const questions = [{"Where is Mars in the solar system?" : [{"Fourth planet from the sun" : true}, {"Next to Pluto" : false}, {"Closer to the sun than Earth" : false}]},
{"What is a rover?": [{"A dog" : false}, {"A robotic space vehicle" : true}, {"A type of car" : false}]},
{"How many rovers have NASA sent to Mars?": [{"5": true}, {"4": false}, {"20": false}]},
{"Which of these lists real Mars rover names?": [{"Resilience, Curiosity, Perseverance": false}, {"Sojourner, Opportunity, Perseverance" : true}, {"Discovery, Searcher, Pioneer" : false}]},
{"What are the Mars rovers looking for?": [{"Ares God of War": false}, {"Dead rovers": false}, {"Water": true}]}];

const question = questions[Math.floor(Math.random() * questions.length)];

return (
<></>
)

}

0 comments on commit 8f7dfc6

Please sign in to comment.