Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Kiduzk/nuclear
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiduzk committed Apr 22, 2024
2 parents 4ac7bbf + c8fe120 commit 4c59514
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 48 deletions.
47 changes: 0 additions & 47 deletions packages/app/app/components/NavButtons/index.js

This file was deleted.

34 changes: 34 additions & 0 deletions packages/app/app/components/NavButtons/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import React, { useEffect, useState } from 'react';
import FontAwesome from 'react-fontawesome';
import { useHistory } from 'react-router';
import { History } from 'history';

import styles from './styles.scss';


const NavButtons: React.FC = () => {
const history = useHistory() as History & {index: number};

const [backButtonEnabled, setBackButtonEnabled] = useState(false);
const [forwardButtonEnabled, setForwardButtonEnabled] = useState(false);

useEffect(() => {
setBackButtonEnabled(history.index > 1);
setForwardButtonEnabled(history.index < (history.length - 1));
}, [history.index, history.length]);

return (
<div className={styles.nav_buttons}>
<a href='#' onClick={backButtonEnabled ? history.goBack : undefined}
className={backButtonEnabled ? undefined : 'disable'}>
<FontAwesome name='chevron-left'/>
</a>
<a href='#' onClick={forwardButtonEnabled ? history.goForward : undefined}
className={forwardButtonEnabled ? undefined : 'disable'}>
<FontAwesome name='chevron-right'/>
</a>
</div>
);
};

export default NavButtons;
3 changes: 2 additions & 1 deletion packages/ui/lib/components/NeumorphicBox/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ $contrast: 5%;

&.small {
box-shadow: $smallDisplacement $smallDisplacement $smallBlur darken($background, $contrast),
(-$smallDisplacement) (-$smallDisplacement) $smallBlur lighten($background, $contrast);
(-$smallDisplacement) (-$smallDisplacement) $smallBlur lighten($background, $contrast);
z-index:1000;
}

&.pressed {
Expand Down

0 comments on commit 4c59514

Please sign in to comment.