Skip to content

Commit

Permalink
Fix accordion UI
Browse files Browse the repository at this point in the history
  • Loading branch information
maryanchuk04 committed Aug 6, 2023
1 parent ef52b5a commit 6f540f0
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 16 deletions.
Binary file modified YeProfspilka.Frontend/public/favicon.ico
Binary file not shown.
9 changes: 6 additions & 3 deletions YeProfspilka.Frontend/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/images/logo-big.png" />
<link rel="icon" href="%PUBLIC_URL%/images/logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Web site created using create-react-app" />
<meta
name="description"
content="Супер пупер веб-сайт який вам дає нереальні можливості! Але це все жарт) Ви просто зробите своє студентське життя трохи дешевше :)"
/>
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
rel="stylesheet"
href="https://site-assets.fontawesome.com/releases/v6.1.1/css/all.css"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/images/logo-big.png" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/images/logo.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
Expand Down
Binary file removed YeProfspilka.Frontend/public/logo192.png
Binary file not shown.
Binary file removed YeProfspilka.Frontend/public/logo512.png
Binary file not shown.
29 changes: 16 additions & 13 deletions YeProfspilka.Frontend/src/components/Accordion/index.jsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
import React, { useState } from 'react'
import React, { useState } from 'react';

const Accordion = ({ title, details }) => {
const [open, setOpen] = useState(false);

const toggle = () => {
setOpen(!open);
}
};

return (
<div className="p-8 duration-200 pr-16 relative border border-standart border-black rounded-standart my-8" onClick={toggle}>
<h2>{title}</h2>
{open && (
<p className='mt-8'>
{details}
</p>
)}
<i className={`${open && "rotate-180"} fas fa-angle-down duration-300 absolute top-8 right-8 text-3xl`}></i>
<div
className='p-8 duration-200 pr-16 relative border border-standart border-black rounded-standart my-8 max-sm:p-4'
onClick={toggle}
>
<h2 className='max-sm:pr-16'>{title}</h2>
{open && <p className='mt-8'>{details}</p>}
<i
className={`${
open && 'rotate-180'
} fas fa-angle-down duration-300 absolute top-8 right-8 text-3xl`}
></i>
</div>
)
}
);
};

export default Accordion
export default Accordion;

0 comments on commit 6f540f0

Please sign in to comment.