Skip to content

Commit

Permalink
refactor file and folders
Browse files Browse the repository at this point in the history
  • Loading branch information
martypdx committed Apr 5, 2024
1 parent 9964bf1 commit 092a3ab
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 27 deletions.
16 changes: 16 additions & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import './style.css';
import FocusFeature from './focus/FocusFeature.jsx';
import Theme from './theme/Theme.jsx';

export default function App() {
return <>
<header>
<FocusFeature />
<Theme />
</header>

<main>

</main>
</>;
}
2 changes: 1 addition & 1 deletion src/Header.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import FocusPlay from './focus/FocusPlay.jsx';
import FocusPlay from './focus/FocusFeature.jsx';
import Theme from './theme/Theme.jsx';

export default function Header() {
Expand Down
5 changes: 2 additions & 3 deletions src/focus/CurrentFocus.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ export function CurrentFocus({ current, update }) {
}

function updatableFocus(update) {

const handleEnter = ({ key, target }) => {
if(key === 'Enter' && document.hasFocus(target)) {
target.blur();
}
if(key === 'Enter' && document.hasFocus(target)) target.blur();
};

const handleInput = ({ target: { innerHTML, ariaLabel } }) => {
Expand Down
2 changes: 1 addition & 1 deletion src/focus/focus.css → src/focus/FocusFeature.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
section.focus-play {
.focus-play {

.ico-button {
outline: 0;
Expand Down
30 changes: 15 additions & 15 deletions src/focus/FocusPlay.jsx → src/focus/FocusFeature.jsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
import { FocusPath } from './FocusPath.jsx';
import { CurrentFocus } from './CurrentFocus.jsx';
import { useFocus } from './useFocus.jsx';
import './focus.css';
import './FocusFeature.css';

function FocusPlayButton() {
return <button class="ico-button">
<label>
<input name="check-working" type="checkbox" checked />
</label>
</button>;
}

export default function FocusPlay() {
export default function FocusFeature() {
const [current, stack, { update, ...changeFocus }] = useFocus();
const { Add, Remove, Path } = <FocusPath stack={stack} {...changeFocus} />;
const { Add, Remove, List } = <FocusPath stack={stack} {...changeFocus} />;

return <section class="focus-play">
<FocusPlayButton />
<ul><Path /></ul>
<section class="focus-section">
<List />
<div class="focus-section">
<Remove className="remove-button" />
<CurrentFocus current={current} update={update} />
</section>
<Add className="add-button" />
<Add className="add-button" />
</div>
</section>;
}

function FocusPlayButton() {
return <button class="ico-button">
<label>
<input name="check-working" type="checkbox" checked />
</label>
</button>;
}
3 changes: 1 addition & 2 deletions src/focus/FocusPath.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { branch } from 'azoth/chronos/channels';
import { Toggle } from 'azoth/maya';


export function FocusPath({ stack, add, remove }) {
const Add = <ChangeButton onclick={add} text="add" />;

Expand All @@ -13,7 +12,7 @@ export function FocusPath({ stack, add, remove }) {
// s => s.map(focus => <Focus {...focus} />),
);

return { Path, Add, Remove };
return { List: <ul><Path /></ul>, Add, Remove };
}

function Focus({ priority, exit }) {
Expand Down
1 change: 0 additions & 1 deletion src/focus/useFocus.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { unicast } from 'azoth/chronos/generators';
import { branch } from 'azoth/chronos/channels';
import { useLocalStorageJSON } from '../local-storage.js';
import './focus.css';

const newFocus = level => ({
priority: level ? `level ${level}` : '',
Expand Down
7 changes: 3 additions & 4 deletions src/main.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import './style.css';
import Header from './Header.jsx';
import App from './App.jsx';

document.body.prepend(<Header />);
document.body.prepend(<App />);

if(Notification) {
if(Notification.permission !== 'granted' && Notification.permission !== 'denied') {
Expand Down Expand Up @@ -61,7 +60,7 @@ function startSession() {
if(time - start > session) {
clearInterval(interval);
const li = document.createElement('li');
li.classList.add('session-circle')
li.classList.add('session-circle');
ul.prepend(li);
queueMicrotask(sessionComplete);
}
Expand Down

0 comments on commit 092a3ab

Please sign in to comment.