Skip to content

Commit

Permalink
header added
Browse files Browse the repository at this point in the history
  • Loading branch information
Rakibhasaniu committed Oct 12, 2022
1 parent f78737b commit a7310d8
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 10 deletions.
Binary file removed public/favicon.ico
Binary file not shown.
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>Web Dev Quiz</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
Binary file removed public/logo192.png
Binary file not shown.
Binary file removed public/logo512.png
Binary file not shown.
8 changes: 7 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import logo from './logo.svg';

import './App.css';
import { createBrowserRouter, RouterProvider } from 'react-router-dom';
import Main from './layout/Main';
Expand All @@ -7,6 +7,8 @@ import Topics from './components/Topics/Topics'
import Statictics from './components/Statictics/Statictics';
import Question from './components/Question/Question';
import ErrorPage from './components/ErrorPage/Errorpage';
import Quiz from './components/Quiz/Quiz';
import Header from './components/Header/Header';

const router = createBrowserRouter([
{
Expand All @@ -23,6 +25,10 @@ const router = createBrowserRouter([
path:'/home',
element: <Home></Home>
},
{
path:'/header',
element: <Header></Header>
},
{
path:'/statictics',
element: <Statictics></Statictics>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Header/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from 'react';

const Header = () => {
return (
<div>
<h2>This Is Header</h2>
<div className='py-4 bg-slate-600 rounded mb-4'>
<h2 className='text-red-100 text-5xl:'>Web Dev Quiz</h2>
</div>
);
};
Expand Down
4 changes: 3 additions & 1 deletion src/components/Home/Home.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useContext } from 'react';
import { DataContext } from '../../layout/Main';
import Display from '../Display/Display';
import Header from '../Header/Header';

const Home = () => {

Expand All @@ -10,7 +11,8 @@ const Home = () => {


return (
<div className='px-4 py-16 mx-auto sm:max-w-xl md:max-w-full lg:max-w-screen-xl md:px-24 lg:px-8 lg:py-20'>
<div className='px-4 py-4 mx-auto sm:max-w-xl md:max-w-full lg:max-w-screen-xl md:px-4 lg:px-8 lg:py-4'>
<Header></Header>
<div className='grid gap-8 row-gap-5 mb-8 lg:grid-cols-3 lg:row-gap-8'>
{
dt.map(quiz => <Display key={quiz.id} quiz={quiz}></Display> )
Expand Down
5 changes: 3 additions & 2 deletions src/components/Navbar/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Link } from 'react-router-dom';

const Navbar = () => {
return (
<div className='text-center p-8'>
<div className='text-center bg-slate-500 mx-auto sm:max-w-xl md:max-w-full lg:max-w-screen-xl md:px-4 lg:px-4 lg:py-4 rounded '>
<Link className='mr-4' to='/home'> Home</Link>
<Link className='mr-4' to='/topics'>Quiz</Link>
<Link className='mr-4' to='/statictics'>Chart</Link>
Expand All @@ -13,4 +13,5 @@ const Navbar = () => {
);
};

export default Navbar;
export default Navbar;

6 changes: 4 additions & 2 deletions src/components/Quiz/Quiz.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React, { useState } from "react";



const Quiz = ({ quiz }) => {

const { options, question,correctAnswer } = quiz;
Expand All @@ -8,10 +10,10 @@ const Quiz = ({ quiz }) => {

const handleQuiz = (answer, correctAns) => {
if(answer == correctAns){
alert("Your answer is true")
alert('correct')
}
else{
alert("your answer is false")
alert('false')
}

}
Expand Down
1 change: 0 additions & 1 deletion src/logo.svg

This file was deleted.

0 comments on commit a7310d8

Please sign in to comment.