Skip to content

Commit

Permalink
remove redundant section
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswilty committed Apr 9, 2024
1 parent e5115ea commit 703c2fa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Counter Demo</title>
<title>Disabled Buttons Demo</title>
</head>
<body>
<div id="root"></div>
Expand Down
3 changes: 1 addition & 2 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ body {
justify-content: center;
}

main,
main section {
main {
display: grid;
align-items: center;
gap: 0.75rem;
Expand Down
18 changes: 8 additions & 10 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState } from 'react';
import './App.css';

function App() {
const App = () => {
const [count, setCount] = useState(0);
const downIsDisabled = count <= 0;

Expand All @@ -12,14 +12,12 @@ function App() {

return (
<main>
<section aria-labelledby="count-heading">
<h1 id="count-heading" className="boxed">
Counter
</h1>
<div aria-live="polite" className="value boxed">
{count}
</div>
</section>
<h1 className="boxed">
Counter
</h1>
<div aria-live="polite" className="value boxed">
{count}
</div>
<div className="control-box">
<button
aria-disabled={downIsDisabled}
Expand All @@ -44,6 +42,6 @@ function App() {
</div>
</main>
);
}
};

export default App;

0 comments on commit 703c2fa

Please sign in to comment.