Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
myix765 committed Nov 3, 2024
1 parent 37d64dd commit 9a7e02a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
25 changes: 14 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>

<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/dillar_logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Dillar Academy</title>
</head>

<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>

</html>
1 change: 0 additions & 1 deletion src/components/Button.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';

const Button = ({ isOutline, label }) => {
return (
Expand Down
20 changes: 9 additions & 11 deletions src/components/Dropdown.jsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
import React, { useState } from 'react';
import { useState } from 'react';

const Dropdown = ({ label, children }) => {
//use isOpen to keep track of whether the dropdown menu is visible
const [isOpen, setIsOpen] = useState(false);

return (
<div
// style below for menu
<div
className="absolute inline-block"

//If the mouse is on the menu, turn state to true, otherwise false
onClick={() => {
if(isOpen) {
setIsOpen(false);
} else{
setIsOpen(true);
}
if (isOpen) {
setIsOpen(false);
} else {
setIsOpen(true);
}
}
}
>
<button className="dropdown-button text-right">{label}</button>
{isOpen && (
// style below for children
<div className="absolute text-right flex flex-col">
<div className="absolute text-right flex flex-col">
{children}
</div>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Home.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';

import dummyBg from '../assets/dummy-bg.png';

const sections = [
Expand Down

0 comments on commit 9a7e02a

Please sign in to comment.